Type Synthesis Guide

Type synthesis runs the ψ-pipeline in inverse mode: you specify a desired topological signature and the TypeSynthesisResolver constructs a SynthesizedType that achieves it.

Step 1 — Declare a TypeSynthesisGoal

Create a TypeSynthesisGoal individual with the target signature:

@prefix type:     <https://uor.foundation/type/> .
@prefix owl:      <http://www.w3.org/2002/07/owl#> .
@prefix xsd:      <http://www.w3.org/2001/XMLSchema#> .

type:my_goal a owl:NamedIndividual, type:TypeSynthesisGoal ;
    type:targetEulerCharacteristic  "4"^^xsd:integer ;
    type:targetBettiNumber          "1"^^xsd:nonNegativeInteger ;
    type:targetBettiNumber          "0"^^xsd:nonNegativeInteger .

The targetEulerCharacteristic is functional (one χ* value). targetBettiNumber is non-functional — one assertion per Betti degree in ascending order.

Step 2 — Attach a TypeSynthesisResolver

@prefix resolver: <https://uor.foundation/resolver/> .

resolver:my_tsr a owl:NamedIndividual, resolver:TypeSynthesisResolver ;
    resolver:synthesisGoal  type:my_goal .

The resolver maintains a ConstraintSearchState internally, recording exploredCount and currentCandidate as it searches.

Step 3 — Inspect the Result

On success the resolver produces:

  1. A TypeSynthesisResult linked from the SynthesizedType via synthesisResult.
  2. A MinimalConstraintBasis with basisSize = n (the minimal constraint count).
  3. A SynthesisSignature per SynthesisStep showing the Euler and Betti progress (via derivation:signatureBefore / derivation:signatureAfter).

Step 4 — Certify the Result

Feed the SynthesizedType into a CompletenessResolver to verify it satisfies IT_7d and obtain a CompletenessCertificate. Identity TS_5 guarantees the SynthesizedType achieves completeness iff the resolver certifies it.

Complexity

Identity TS_4 bounds the number of synthesis steps at ≤ n for a realisable n-site target. With Jacobian-guided exploration (TS_6), the expected step count is O(n log n).

Related