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 quantum level 8
let context = Context {
quantum: 8,
capacity: 256,
};
The corresponding ontology individual:
<my:ctx>
a state:Context ;
state:quantum "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> .
Complete Example
See SHACL test test7_end_to_end in conformance/src/tests/fixtures/test7_end_to_end.rs
for a complete end-to-end instance graph.