Implementing PRISM
PRISM (Polymorphic Resolution and Isometric Symmetry Machine) is the reference implementation pattern for a UOR-compliant resolver.
Overview
A PRISM implementation must:
- Accept a Query
- Use a Resolver to factorize the input
- Produce a Partition
- Measure Observable properties
- Issue a Certificate
- Record a ComputationTrace
Step 1: Define the Context
// Establish the evaluation context at Witt level 8
let context = Context {
witt_length: 8,
capacity: 256,
};
The corresponding ontology individual:
<my:ctx>
a state:Context ;
state:wittLength "8"^^xsd:nonNegativeInteger ;
state:capacity "256"^^xsd:nonNegativeInteger .
Step 2: Create a Query
Choose the appropriate query type:
- CoordinateQuery for spatial resolution
- MetricQuery for metric measurement
- RepresentationQuery for canonical form
<my:query>
a query:RepresentationQuery ;
query:inputType <my:target-address> .
Step 3: Apply the Resolver
The DihedralFactorizationResolver performs the core computation:
<my:resolver>
a resolver:DihedralFactorizationResolver ;
resolver:inputType <my:type-u8> ;
resolver:strategy "dihedral-factorization" .
Step 4: Inspect the Partition
The resolver produces a Partition:
<my:partition>
a partition:Partition ;
partition:irreducibles <my:irred-set> ;
partition:reducibles <my:red-set> ;
partition:units <my:unit-set> ;
partition:exterior <my:ext-set> .
Step 5: Issue a Certificate
<my:cert>
a cert:Certificate ;
cert:certifies <my:partition> .
Certificate types available:
Step 6: Record the Trace
<my:trace>
a trace:ComputationTrace ;
trace:certifiedBy <my:cert> .
Iterative Resolution (Amendment 11)
The single-pass pipeline above works when the type is fully determined. For partially-constrained types, PRISM supports an iterative resolution loop:
- Declare — create a ConstrainedType with initial constraints
- Resolve — run the resolver to produce a partition with a FreeRank
- Observe — check isClosed on the budget
- Refine — if not closed, apply a RefinementSuggestion to pin more sites
- Iterate — repeat until the budget closes or convergence stalls
The ResolutionState tracks iteration count, site deficit, and convergenceRate. Each iteration produces a RefinementStep recording the applied constraint and sites closed.
Completeness Certification (Amendment 25)
To certify that a type resolves in O(1), promote it to a CompletenessCandidate and run the ψ pipeline via a CompletenessResolver:
- Promote — associate the type with a ResolutionState and CechNerve via candidateNerve.
- Accumulate witnesses — each site-closing step produces a CompletenessWitness recording the applied constraint and sitesClosed.
- Check IT_7d — the resolver reads the cached nerveEulerCharacteristic. If χ(N(C)) = n and all β_k = 0, the kernel issues a CompletenessCertificate.
- Audit — the certificate's auditTrail links to a CompletenessAuditTrail with the full witness sequence and witnessCount.
W16 Resolver (Amendment 26)
To run any resolver at Witt level W16 instead of W8, use a
WittLevelResolver with
quantumLevel set to
schema:W16. The W16 ring is W16Ring:
Z/(2^16)Z with W16bitWidth = 16 and
65,536 elements.
Identities marked op:universallyValid true (such as the critical identity
and all QL_ individuals) hold at W16 and every higher level without
re-verification.
Session Lifecycle (Amendment 27)
Multi-turn Prism deployments use a SessionResolver that maintains a BindingAccumulator across queries:
- Open session — create a Session with an empty sessionBindings context.
- Submit queries — each SessionQuery declares sessionMembership; resolved bindings are appended to the accumulator.
- Monitor deficit — the aggregateSiteDeficit on the accumulator decreases monotonically (SR_1 invariant).
- Handle boundaries — when convergence stalls or a contradiction arises,
a SessionBoundary resets the context.
The boundaryType is one of
state:ExplicitReset,state:ConvergenceBoundary, orstate:ContradictionBoundary.
Composition (Amendment 12)
Transforms compose categorically via Composition.
The critical composition law criticalComposition
asserts that neg ∘ bnot = succ, connecting the two involutions to cyclic rotation.
Use Identity for identity transforms and composesWith to declare composability.
Complete Example
See SHACL test test7_end_to_end in conformance/src/tests/fixtures/test7_end_to_end.rs
for a complete single-pass pipeline, and test12_factorization for a full PRISM pipeline
with free rank and certification using certifies
and certifiedBy.