Constraint Algebra
Definition
The constraint algebra provides composable predicates that refine types by pinning site indices. A Constraint is a predicate that, when applied to a type, determines the value of one or more sites in the iterated Z/2Z fibration.
Constraint Hierarchy
Four concrete constraint kinds are provided, mutually disjoint:
| Class | Description |
|---|---|
| ResidueConstraint | Membership in a residue class: x = r (mod m) |
| CarryConstraint | Carry propagation pattern in ring arithmetic |
| DepthConstraint | Bounds on factorization depth |
| CompositeConstraint | Composition of two or more simpler constraints |
A ConstrainedType links to its constraints via hasConstraint.
Constraint Properties
Each constraint kind has specialized parameters:
| Property | Domain | Range | Description |
|---|---|---|---|
| modulus | ResidueConstraint | xsd:positiveInteger | The modulus m |
| residue | ResidueConstraint | xsd:nonNegativeInteger | The residue r |
| carryPattern | CarryConstraint | xsd:string | Binary carry pattern |
| minDepth | DepthConstraint | xsd:nonNegativeInteger | Minimum depth |
| maxDepth | DepthConstraint | xsd:nonNegativeInteger | Maximum depth |
| composedFrom | CompositeConstraint | Constraint | Component constraints |
Metric Axes
Every constraint operates along a MetricAxis, classified by its geometric effect. The three axes form the tri-metric coordinate system of UOR:
| Individual | Description |
|---|---|
| verticalAxis | Ring/additive: residue classes, divisibility |
| horizontalAxis | Hamming/bitwise: bit positions, carry patterns |
| diagonalAxis | Incompatibility: the gap between ring and Hamming |
The property metricAxis assigns each constraint to its axis. The property crossingCost records how many axis boundaries a constraint must traverse.
Site Pinning
The property pinsSites declares which SiteIndex instances a constraint pins when applied. A CompositeConstraint pins the union of sites pinned by its components.
Example: Residue + Depth
<https://uor.foundation/instance/constraint-odd>
a type:ResidueConstraint ;
type:modulus "2"^^xsd:positiveInteger ;
type:residue "1"^^xsd:nonNegativeInteger ;
type:metricAxis type:verticalAxis .
<https://uor.foundation/instance/constraint-shallow>
a type:DepthConstraint ;
type:minDepth "0"^^xsd:nonNegativeInteger ;
type:maxDepth "2"^^xsd:nonNegativeInteger ;
type:metricAxis type:verticalAxis .
Each constraint pins specific sites tracked by the FreeRank — see Free Rank for how pinned sites accumulate toward resolution closure.