Expand description
A compiled form of actions and invariants (the default; EVERYSTATE_EVAL=tree turns it off); the tree-walker of eval.rs stays the reference.
Before the search each top-level action and each invariant is turned into a tree of closures: identifiers are resolved to what they denote (a state variable’s index, a slot of a frame, a constant), applications of definitions with value parameters are inlined, and the enumerator’s work (which conjunct assigns which primed variable, which leave variables unchanged, where the branches are) is decided once instead of being rediscovered for every state. Nothing is memoised across states.
The rules that keep it equal to the tree-walker:
- Whatever the compiler does not handle is compiled to a fallback: the expression is evaluated by the tree-walker in a context rebuilt from the frame. Coverage is a matter of speed only.
- A parameter of an inlined definition is bound by name: every use evaluates the argument where it is used (so an unused argument is never evaluated, as with the tree-walker’s thunks); the value is kept for the rest of the call when the argument is a state-level expression.
- The compiled code only has to be right when it succeeds. If it fails in any way, what it produced for the action (or invariant) is discarded and the tree-walker evaluates it again from the start, so error messages, locations and precedence are the tree-walker’s by construction. For that to be sound, an action that may reach an operator with an effect (printing, TLCSet, random choice, I/O, a new string) is not compiled at all.
Structs§
- ActPlan
- Counters
- Cx
- FpCtx
- What fingerprinting a successor from its parent’s ids needs (see
Checker::row_fingerprint). - Meas
- The measurement shared by the units of one
Plans: the number of the state being expanded, when its expansion began, and the units on trial that were evaluated in it. - Plans
- Pred
Plan - Rec
- What the evaluation of a unit read and did, noted for the step cache.
- Unit
Stat - Verdict
- What the measurements of one unit of the step cache concluded (
Plans::verdicts), with where the unit is (the plans of one model on two threads have the same units in the same order).
Functions§
- cache_
enabled - The step cache is on with the compiled evaluator; EVERYSTATE_STEP_CACHE=off turns it off. (
onandalwaysask for it even with EVERYSTATE_EVAL=tree;alwaysgives it to every unit, for testing.) In WebAssembly it is off: there is no clock to measure whether it pays, so no unit would ever keep it. - compile
cache: with the step cache, unless the environment turns it off (cache_enabled).- enabled
- The compiled evaluator is the default; EVERYSTATE_EVAL=tree selects the tree-walker alone.
- verify_
deltas - EVERYSTATE_VERIFY_DELTAS=1: every fingerprint computed from changes is checked against the one of the successor built (for testing).