Skip to main content

Module constraint

Module constraint 

Source
Expand description

Declarative constraint algebra.

Each parameter kind has its own constraint enum with kind-specific leaves plus the shared Boolean combinators (And, Or, Not, Always, Never; BoolConstraint drops And/Or since the underlying value only takes two states). The outer Constraint enum discriminates by kind and dispatches test by native payload.

Canonicalisation (per SRD-0004 D5) collapses identity elements, flattens nested same-kind combinators, peels double negation, and deduplicates children. The final sort step that gives us fingerprint-stable canonical forms requires a total order over every leaf (including f64 leaves); that lands alongside constraint fingerprinting in a follow-up slice. Until then canonicalize does everything except sort.

Enumsยง

BoolConstraint
Boolean-value constraint.
Constraint
Kind-tagged constraint for dispatch against a Value.
DoubleConstraint
Double-precision float constraint.
IntConstraint
Integer-value constraint.
SelectionConstraint
Constraint over a selection value (an ordered set of items).
StringConstraint
String-value constraint.