Metakit / Verify a state machine
A transition is refuted by a null, or by a number past 2^53 − 1
The solver reads a rule as Expr.eval does. A field that may be null (Schema.NullOr, Schema.optionalKey, a field under a nullable parent) makes every comparison of it null, and a rule holds only where it is true: say what a null means with Expr.any(Null.isNull(x), …) (Null is imported from @doeixd/metakit like Num). An integer result outside ±(2^53 − 1) is refused by evaluation, so a rule over unbounded integers that adds or multiplies them is refuted at the edge: bound the fields.
A transition that writes a whole struct is checked against the rules that read its fields, and a written value is held to the bounds its field declares, also inside Schema.NullOr.