Skip to main content

dive_core/
plan.rs

1//! The compiled plan: compact node arrays indexed by `u32`, not boxed trees.
2//!
3//! Value nodes ([`Node`]) evaluate to a handle. Generator nodes ([`GNode`])
4//! enumerate successors with TLC's `getNextStates` rules. Every local is a
5//! slot of one flat frame per role (or per recursive operator activation);
6//! operator applications are inlined, with their arguments substituted,
7//! cached in thunk slots, or re-evaluated by name.
8
9use crate::handle::Handle;
10
11/// A value node id.
12pub type P = u32;
13/// A generator node id.
14pub type G = u32;
15
16/// Integer arithmetic.
17#[derive(Clone, Copy, Debug, PartialEq, Eq)]
18pub enum Arith {
19    /// `+`
20    Add,
21    /// `-`
22    Sub,
23    /// `*`
24    Mul,
25    /// `\div`
26    Div,
27    /// `\div` from `Naturals` without `Integers` (`Naturals.Divide`; floored
28    /// in big mode, as `Div`).
29    DivNaturals,
30    /// `%`
31    Mod,
32    /// `^`
33    Pow,
34}
35
36/// Integer comparison.
37#[derive(Clone, Copy, Debug, PartialEq, Eq)]
38pub enum Cmp {
39    /// `<`
40    Lt,
41    /// `<=`
42    Le,
43    /// `>`
44    Gt,
45    /// `>=`
46    Ge,
47}
48
49/// Binary set operators.
50#[derive(Clone, Copy, Debug, PartialEq, Eq)]
51pub enum SetOp {
52    /// `\cup`
53    Cup,
54    /// `\cap`
55    Cap,
56    /// `\`
57    Minus,
58}
59
60/// Quantifiers in value position.
61#[derive(Clone, Copy, Debug, PartialEq, Eq)]
62pub enum Quant {
63    /// `\E`
64    Exists,
65    /// `\A`
66    Forall,
67    /// `CHOOSE`
68    Choose,
69}
70
71/// Standard-module operators the core implements.
72#[derive(Clone, Copy, Debug, PartialEq, Eq)]
73pub enum StdFn {
74    /// `Len(s)`
75    Len,
76    /// `Head(s)`
77    Head,
78    /// `Tail(s)`
79    Tail,
80    /// `Append(s, e)`
81    Append,
82    /// `s \o t`
83    Concat,
84    /// `SubSeq(s, m, n)`
85    SubSeq,
86    /// `Cardinality(S)`
87    Cardinality,
88    /// `Seq(S)`
89    Seq,
90    /// `IsFiniteSet(S)`
91    IsFiniteSet,
92    /// `EmptyBag` (Bags)
93    EmptyBag,
94    /// `SetToBag(S)` (Bags)
95    SetToBag,
96    /// `BagToSet(B)` (Bags)
97    BagToSet,
98    /// `BagIn(e, B)` (Bags)
99    BagIn,
100    /// `CopiesIn(e, B)` (Bags)
101    CopiesIn,
102}
103
104/// One bound group: `x, y \in S` or `<<x, y>> \in S`.
105#[derive(Clone, Debug)]
106pub struct Bind {
107    /// The bound variables' frame slots.
108    pub slots: Box<[u32]>,
109    /// A tuple pattern.
110    pub tuple: bool,
111    /// The domain.
112    pub domain: P,
113}
114
115/// One `EXCEPT` clause.
116#[derive(Clone, Debug)]
117pub struct Update {
118    /// The path.
119    pub path: Box<[P]>,
120    /// The slot `@` is bound in.
121    pub at: u32,
122    /// The new value.
123    pub value: P,
124}
125
126/// An argument of a higher-order library operator ([`Node::LibHo`]).
127#[derive(Clone, Debug)]
128pub enum LibArg {
129    /// A value, evaluated (normalized) before the call.
130    Value(P),
131    /// An operator: its parameters' slots and its body, which the library
132    /// evaluates once per application.
133    Op {
134        /// The parameters' slots.
135        params: Box<[u32]>,
136        /// The body.
137        body: P,
138    },
139}
140
141/// A value node.
142#[derive(Clone, Debug)]
143pub enum Node {
144    /// A constant (persistent or scalar).
145    Const(Handle),
146    /// A frame slot holding a value.
147    Slot(u32),
148    /// A thunk: evaluated on first use and cached in its slot until the
149    /// enclosing scope is entered again.
150    Lazy {
151        /// The cache slot.
152        slot: u32,
153        /// The argument.
154        body: P,
155    },
156    /// An unprimed state variable.
157    Var(u16),
158    /// A primed state variable (the successor buffer).
159    Primed(u16),
160    /// `~e`
161    Not(P),
162    /// Conjunction, short-circuit.
163    And(Box<[P]>),
164    /// Disjunction, short-circuit.
165    Or(Box<[P]>),
166    /// `a => b`
167    Implies(P, P),
168    /// `a <=> b`
169    Equiv(P, P),
170    /// Pure bounded `A \\cdot B`, tested against the complete successor.
171    Composition {
172        /// Enumerable first-stage action.
173        first: G,
174        /// Deterministic action assigning every final variable.
175        then: G,
176        /// Captured lexical slots.
177        free: Box<[u32]>,
178        /// State-dependent thunk slots of this frame, reset whenever the
179        /// stages change the rows they read.
180        reset: Box<[u32]>,
181    },
182    /// `IF c THEN a ELSE b`
183    If(P, P, P),
184    /// `CASE`
185    Case(Box<[(P, P)]>, Option<P>),
186    /// `a = b`
187    Eq(P, P),
188    /// `e = e'` for a subscript `e` compiled to a tuple, possibly nested and
189    /// behind thunks, of state variables (`changed_test`). `eq` is that
190    /// `Eq`. Outside TLC comparisons, when no thunk on the way is forced and
191    /// every leaf of both states is materialized, the result is each leaf's
192    /// `Heap::eq`, without building either tuple or forcing a thunk;
193    /// otherwise `eq` is evaluated.
194    SameVars {
195        /// The original `Eq` of the two tuples.
196        eq: P,
197        /// Each leaf variable and its depth (1 for an outer element).
198        leaves: Box<[(u16, u8)]>,
199        /// The slots of the thunks (`Node::Lazy`) between `eq` and the leaves.
200        thunks: Box<[u32]>,
201    },
202    /// `a /= b`
203    Neq(P, P),
204    /// `a \in S`
205    In(P, P),
206    /// `a \notin S`
207    NotIn(P, P),
208    /// `A \subseteq B`
209    Subseteq(P, P),
210    /// Integer arithmetic.
211    Arith(Arith, P, P),
212    /// Integer comparison.
213    Cmp(Cmp, P, P),
214    /// `-a`
215    Neg(P),
216    /// `a..b`
217    Range(P, P),
218    /// `{a, b, ...}`; finite sets use canonical order by default.
219    SetEnum(Box<[P]>),
220    /// `A \cup B` and friends.
221    SetBin(SetOp, P, P),
222    /// `SUBSET S`
223    Powerset(P),
224    /// `UNION S`
225    BigUnion(P),
226    /// `S1 \X ... \X Sn`
227    Product(Box<[P]>),
228    /// `[D -> R]`
229    FcnSet(P, P),
230    /// `[f : S, ...]`, field names sorted.
231    RecSet(Box<[(Handle, P)]>),
232    /// `{x \in S : P}`
233    Filter {
234        /// The bound.
235        bind: Bind,
236        /// The predicate.
237        pred: P,
238        /// A proven rewrite of `{E \in SUBSET T : \A e \in E : Q}` as
239        /// `SUBSET F`: the node of `F = {e \in T : Q}`. The compiler sets it
240        /// only when `Q` is pure, makes no call and does not read `E`, so
241        /// the filter's elements are exactly the subsets of `F`. Only
242        /// enumeration uses it; membership keeps the filter's own order of
243        /// evaluation, and an evaluation error in `F` falls back to the
244        /// filter itself.
245        subset: Option<P>,
246    },
247    /// `{e : x \in S, ...}`
248    Map {
249        /// The bounds.
250        binds: Box<[Bind]>,
251        /// The element.
252        body: P,
253    },
254    /// `[x \in S |-> e]`
255    FcnCons {
256        /// The bounds.
257        binds: Box<[Bind]>,
258        /// The body.
259        body: P,
260    },
261    /// `\E`, `\A`, `CHOOSE`.
262    Quant {
263        /// Which.
264        kind: Quant,
265        /// The bounds.
266        binds: Box<[Bind]>,
267        /// The body.
268        body: P,
269    },
270    /// `f[a]`
271    Apply(P, P),
272    /// `r.f`
273    Select(P, Handle),
274    /// `DOMAIN f`
275    Domain(P),
276    /// `[f EXCEPT ...]`
277    Except {
278        /// The function.
279        base: P,
280        /// The clauses.
281        updates: Box<[Update]>,
282    },
283    /// `<<a, b>>`
284    Tuple(Box<[P]>),
285    /// `[a |-> e, ...]`, field names sorted.
286    Record(Box<[(Handle, P)]>),
287    /// Resets thunk slots, then evaluates the body (an inlined operator or
288    /// a `LET`).
289    Scope {
290        /// Thunk slots to reset.
291        reset: Box<[u32]>,
292        /// The body.
293        body: P,
294    },
295    /// A call of a recursive operator, in a new frame.
296    Call {
297        /// The function.
298        fun: u32,
299        /// The arguments, evaluated eagerly.
300        args: Box<[P]>,
301    },
302    /// A standard operator.
303    Std(StdFn, Box<[P]>),
304    /// A standard or CommunityModules operator implemented in
305    /// [`crate::stdlib`], on normalized arguments.
306    Lib {
307        /// The library operator.
308        op: dive_ir::StdOp,
309        /// Its arguments, evaluated in source order.
310        args: Box<[P]>,
311        /// Whether reevaluation is proven effect-free without calls or free slots.
312        repeatable_args: bool,
313    },
314    /// A [`crate::stdlib`] operator with operator arguments.
315    LibHo(dive_ir::StdOp, Box<[LibArg]>),
316    /// `ENABLED A`: whether the action `A` has a successor from the current
317    /// state, complete or not (TLC's `Tool.enabled`). `free` holds the
318    /// frame slots `A` reads from outside it.
319    Enabled {
320        /// The action.
321        g: G,
322        /// The slots read from outside the action.
323        free: Box<[u32]>,
324    },
325    /// An expression the core evaluates eagerly where TLC evaluates it
326    /// lazily: an evaluation error inside it
327    /// is reported as `unsupported`, because TLC might never raise it.
328    Spec(P),
329    /// `a \in S` (or `a \notin S` with `neg`) with `S` a set TLC keeps
330    /// lazy: a filter or a binary set operation, possibly behind thunks.
331    /// Membership is decided on the structure, as TLC's `SetPredValue`,
332    /// `SetCupValue`, `SetCapValue` and `SetDiffValue` do, without building
333    /// the set.
334    InLazy {
335        /// The element.
336        elem: P,
337        /// The set's node.
338        set: P,
339        /// `\notin`.
340        neg: bool,
341    },
342    /// `f[arg]` with `f` a function constructor TLC keeps lazy
343    /// (`FcnLambdaValue.apply`): the body is evaluated for `arg` alone, after
344    /// a domain check. `chain` leads to the constructor `fc` through thunks;
345    /// a thunk already forced is applied as a value.
346    Beta {
347        /// The function expression.
348        chain: P,
349        /// The `FcnCons` node, whose bound variables have no tuple pattern.
350        fc: P,
351        /// The argument.
352        arg: P,
353    },
354    /// The body of a recursive function `f[x \in S] == e`: checks that the
355    /// argument in `slot` is in `domain`, then evaluates `body`.
356    DomCheck {
357        /// The argument's slot.
358        slot: u32,
359        /// The domain.
360        domain: P,
361        /// The body.
362        body: P,
363    },
364    /// A memoized pure body.
365    Memo {
366        /// The site.
367        site: u32,
368        /// The body.
369        body: P,
370    },
371}
372
373/// A generator node.
374#[derive(Clone, Debug)]
375pub enum GNode {
376    /// Pure bounded `A \\cdot B`, with complete intermediate rows and a
377    /// deterministic tail assigning every final variable.
378    Composition {
379        /// Enumerable first-stage action.
380        first: G,
381        /// Fully assigning deterministic tail.
382        then: G,
383        /// State-dependent thunk slots of this frame, reset whenever the
384        /// stages change the rows they read.
385        reset: Box<[u32]>,
386    },
387    /// A conjunction: items processed left to right as continuations; each
388    /// item has a boolean form for the all-assigned shortcut.
389    Conj(Box<[(G, P)]>),
390    /// A disjunction.
391    Disj(Box<[G]>),
392    /// Bounded `\E`.
393    Exists {
394        /// The bounds.
395        binds: Box<[Bind]>,
396        /// The body.
397        body: G,
398        /// The body's boolean form.
399        body_p: P,
400    },
401    /// Bounded `\A`: the first binding, then the others last first.
402    Forall {
403        /// The bounds.
404        binds: Box<[Bind]>,
405        /// The body.
406        body: G,
407        /// The body's boolean form.
408        body_p: P,
409    },
410    /// `IF`
411    If {
412        /// The guard.
413        cond: P,
414        /// `THEN`
415        then: G,
416        /// `ELSE`
417        other: G,
418    },
419    /// `CASE`
420    Case {
421        /// The arms.
422        arms: Box<[(P, G)]>,
423        /// `OTHER`
424        other: Option<G>,
425    },
426    /// `P => Q`
427    Implies {
428        /// `P`
429        lhs: P,
430        /// `Q`
431        rhs: G,
432    },
433    /// `x' = e`
434    Assign {
435        /// The variable.
436        var: u16,
437        /// The right side.
438        rhs: P,
439    },
440    /// `x' \in S`
441    AssignIn {
442        /// The variable.
443        var: u16,
444        /// The set.
445        set: P,
446    },
447    /// `x' \in S` where TLC's `elements()` of `S` may list an element more
448    /// than once (a lazy union): `raw`
449    /// reproduces TLC's multiplicity, and the run refuses when it differs
450    /// from the normalized set's.
451    AssignInRaw {
452        /// The variable.
453        var: u16,
454        /// The set.
455        set: P,
456        /// TLC's `elements()` structure.
457        raw: Raw,
458    },
459    /// `UNCHANGED e`, decomposed by TLC's `processUnchanged` into items in
460    /// order.
461    Unchanged(Box<[Unch]>),
462    /// `[A]_v`: `A`, then `UNCHANGED v`.
463    StepBox {
464        /// `A`
465        action: G,
466        /// `v`, decomposed.
467        vars: Box<[Unch]>,
468    },
469    /// `<<A>>_v`: `A`, then a `CHANGED v` item.
470    StepAngle {
471        /// `A`
472        action: G,
473        /// `v = v'`, evaluated with `v` in `s0` and `v'` in `s1`.
474        same: P,
475    },
476    /// `f[a]` used as an action, where `f` is a function constructor TLC
477    /// keeps lazy (`FcnLambdaValue`, `Tool.getFcnContext`): the body is
478    /// enumerated with the parameters bound to the argument.
479    FcnAction {
480        /// The parameters, one group per bound.
481        binds: Box<[Bind]>,
482        /// The argument.
483        arg: P,
484        /// The body.
485        body: G,
486    },
487    /// Thunk slots reset around a body (inlined operator or `LET`).
488    Scope {
489        /// The thunk slots.
490        reset: Box<[u32]>,
491        /// The body.
492        body: G,
493    },
494    /// Any other formula: a boolean guard.
495    Guard(P),
496}
497
498/// One item of a decomposed `UNCHANGED` (TLC's `processUnchanged`).
499#[derive(Clone, Copy, Debug)]
500pub enum Unch {
501    /// A state variable: bound to its old value, or compared with it. `at`
502    /// is the expression TLC's warning 2143 names.
503    Var {
504        /// The variable.
505        var: u16,
506        /// Where it is written: the `ExprId` index.
507        at: u32,
508    },
509    /// Any other expression: `e = e'`, with `e` in `s0` and `e'` in `s1`
510    /// (`verifyUnchanged`).
511    Verify(P),
512}
513
514/// TLC's `Enumerable.elements()` multiplicity of a set bound by `x' \in S`.
515#[derive(Clone, Debug)]
516pub enum Raw {
517    /// A set whose `elements()` lists every element once.
518    Leaf(P),
519    /// `SetCupValue`: the first set's elements, then the second's.
520    Cup(Box<Raw>, Box<Raw>),
521    /// `UnionValue` of an enumerated set of sets: each distinct member's
522    /// elements in turn.
523    Union(Box<[Raw]>),
524    /// `UnionValue` of another set of sets: each member's elements in turn.
525    UnionOf(P),
526    /// `SetPredValue`: the bound set's elements, filtered.
527    Filter {
528        /// The bound variable (its domain is `inner`).
529        bind: Bind,
530        /// The predicate.
531        pred: P,
532        /// The bound set.
533        inner: Box<Raw>,
534    },
535    /// `SetCapValue`: the enumerable operand's elements, filtered by
536    /// membership in the other.
537    Cap(Box<Raw>, Box<Raw>, P, P),
538    /// `SetDiffValue`: the first operand's elements not in the second.
539    Minus(Box<Raw>, P),
540    /// An odometer over components (`[D -> R]`, records, products): an
541    /// element repeats when a component's does.
542    Odometer(Box<[Raw]>, P),
543}
544
545/// A recursive operator, compiled once with its own frame.
546#[derive(Clone, Debug)]
547pub struct Fun {
548    /// The name.
549    pub name: String,
550    /// Number of parameters (slots `0..params`).
551    pub params: u32,
552    /// The frame size.
553    pub frame: u32,
554    /// The body.
555    pub body: P,
556    /// The slots of the values captured from enclosing definitions (a
557    /// recursive `LET` operator's free locals, lambda-lifted): a call
558    /// passes them after the parameters.
559    pub caps: Box<[u32]>,
560}
561
562/// A memoization site.
563#[derive(Clone, Debug)]
564pub struct MemoSite {
565    /// A description for statistics.
566    pub name: String,
567    /// The unprimed variables the body reads.
568    pub vars: Box<[u16]>,
569    /// The free slots the body reads.
570    pub slots: Box<[u32]>,
571    /// The primed variables the body reads: in a step predicate, whose
572    /// pair is complete (`Compiler::step`), or in an action's primed
573    /// definition, whose site is bypassed while one is unassigned
574    /// (`Opts::primed_memo`).
575    pub primed: Box<[u16]>,
576    /// A step predicate's or primed definition's site (`Opts::step_memo`,
577    /// `Opts::primed_memo`): on whatever `Opts::memo` says, and its results
578    /// are interned to be kept.
579    pub step: bool,
580    /// A primed definition's site (`Opts::primed_memo`), evaluated once per
581    /// enumeration candidate: its primed keys are candidate values, so the
582    /// bytes its persistent keys and results add to the store are bounded
583    /// (`Memo::charge_kept`).
584    pub candidate: bool,
585}
586
587impl MemoSite {
588    /// The length of the site's key, in handles.
589    #[must_use]
590    pub fn key_len(&self) -> usize {
591        self.vars.len() + self.primed.len() + self.slots.len()
592    }
593}
594
595/// The node arrays.
596#[derive(Clone, Debug, Default)]
597pub struct Code {
598    /// Explicit compiled source maps; None allocates no tables.
599    pub source_map: Option<crate::debug::SourceMap>,
600    /// Producer observation capability, installed only in search machines.
601    pub debugger: Option<std::sync::Arc<dyn crate::debug::Observer>>,
602    /// Value nodes.
603    pub nodes: Vec<Node>,
604    /// Generator nodes.
605    pub gnodes: Vec<GNode>,
606    /// Recursive operators.
607    pub funs: Vec<Fun>,
608    /// Memo sites.
609    pub sites: Vec<MemoSite>,
610}
611
612/// An initial predicate or next-state action.
613#[derive(Clone, Debug)]
614pub struct Action {
615    /// TLC's name of the action.
616    pub name: String,
617    /// The generator.
618    pub g: G,
619    /// The frame size.
620    pub frame: u32,
621    /// The frame slots preset by splitting (`\E` and parameter values).
622    pub preset: Vec<(u32, Handle)>,
623}
624
625/// One conjunct of an invariant or constraint.
626#[derive(Clone, Debug)]
627pub struct Conjunct {
628    /// The boolean body.
629    pub p: P,
630    /// The unprimed variables it reads, as a mask.
631    pub reads: u64,
632    /// Whether the parent-delta skip applies (pure, no free slots, read set
633    /// known).
634    pub skippable: bool,
635    /// The memo site, if any.
636    pub site: Option<u32>,
637}
638
639/// An invariant or state constraint.
640#[derive(Clone, Debug)]
641pub struct Check {
642    /// The configured name.
643    pub name: String,
644    /// The conjuncts, in order.
645    pub conjuncts: Vec<Conjunct>,
646    /// The frame size.
647    pub frame: u32,
648}
649
650/// The compiled specification.
651#[derive(Clone, Debug)]
652pub struct Plan {
653    /// The node arrays.
654    pub code: Code,
655    /// State variable names, by index.
656    pub vars: Vec<String>,
657    /// The initial predicates.
658    pub init: Vec<Action>,
659    /// The next-state actions, in TLC's order.
660    pub next: Vec<Action>,
661    /// `INVARIANT`s.
662    pub invariants: Vec<Check>,
663    /// `CONSTRAINT`s.
664    pub constraints: Vec<Check>,
665    /// `ACTION_CONSTRAINT`s.
666    pub action_constraints: Vec<Check>,
667    /// Implied initial predicates (`PROPERTY` parts checked on the initial
668    /// states).
669    pub implied_inits: Vec<Check>,
670    /// Implied actions (`[A]_v` of `[][A]_v` in `PROPERTY`s), step
671    /// predicates.
672    pub implied_actions: Vec<Check>,
673    /// Whether deadlock is checked.
674    pub check_deadlock: bool,
675    /// `SYMMETRY`: states are keyed by their canonical image.
676    pub symmetry: Option<crate::symmetry::Symmetry>,
677    /// The plan's effects: the engine then runs one worker, in TLC's
678    /// order.
679    pub effects: Effects,
680    /// `VIEW`: its value, the one conjunct, keys the state.
681    pub view: Option<Check>,
682    /// Compile statistics.
683    pub stats: CompileStats,
684    /// The frame slots a bound optional atom's role binds
685    /// ([`crate::compile::compile_bound_test`]: `\E` variables and inlined
686    /// parameters of its scope), with their values, which the caller
687    /// installs after entering the check's frame; empty otherwise.
688    pub bound_preset: Vec<(u32, Handle)>,
689    /// The pure `ASSUME`s ([`crate::compile::Handoff::assumptions`]) the
690    /// compiler evaluated to `TRUE`, in order.
691    pub startup_assumptions: Vec<dive_ir::DefId>,
692    /// The pure `ASSUME` after [`Self::startup_assumptions`] that the
693    /// compiler evaluated to `FALSE`, where it stopped; `None` when it found
694    /// them all `TRUE` or stopped at one it did not evaluate to a Boolean.
695    pub startup_assumption_false: Option<dive_ir::DefId>,
696}
697
698/// What effects a plan has (`Info::effect`).
699#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
700#[allow(
701    clippy::struct_excessive_bools,
702    reason = "independent facts about the plan"
703)]
704pub struct Effects {
705    /// Any effect (`Print`, `PrintT`, `RandomElement`, `TLCSet`, `TLCGet`).
706    pub any: bool,
707    /// `Print` or `PrintT`.
708    pub prints: bool,
709    /// `RandomElement`: the engine starts each expansion's random stream
710    /// (`crate::random`).
711    pub draws: bool,
712    /// `TLCSet` or `TLCGet` of a register (not of `"level"`).
713    pub registers: bool,
714    /// `TLCGet("level")`: the engine sets `Machine::level`.
715    pub level: bool,
716}
717
718/// What the compiler did.
719#[derive(Clone, Copy, Debug, Default)]
720pub struct CompileStats {
721    /// Value nodes.
722    pub nodes: usize,
723    /// Generator nodes.
724    pub gnodes: usize,
725    /// Operator applications inlined.
726    pub inlined: usize,
727    /// Arguments substituted directly.
728    pub aliased: usize,
729    /// Arguments bound to thunks.
730    pub thunks: usize,
731    /// Arguments re-evaluated by name.
732    pub by_name: usize,
733    /// Subexpressions folded to constants.
734    pub folded: usize,
735    /// State-level definitions cached once per frame activation.
736    pub cached_defs: usize,
737    /// Folds abandoned because they ran out of fuel.
738    pub fold_abandoned: usize,
739    /// Folds not attempted because the compile-time budget was spent.
740    pub fold_skipped: usize,
741    /// Loop iterations spent folding.
742    pub fold_fuel: u64,
743    /// Wall time spent folding, in nanoseconds.
744    pub fold_nanos: u64,
745    /// Filters, function constructors and set operations the core builds
746    /// eagerly where TLC is lazy (`Node::Spec`).
747    pub speculative: u64,
748    /// `INSTANCE` substitutions bound.
749    pub substituted: usize,
750    /// Applications of lazy function constructors evaluated for their
751    /// argument alone (`Node::Beta`).
752    pub beta: u64,
753    /// Constant definitions the binder left to the core, evaluated here
754    /// ([`crate::compile::Handoff::deferred`]), and closed zero-arity
755    /// definitions too large to fold, evaluated once at their first use
756    /// ([`crate::compile::SETTLE_FUEL`]).
757    pub startup_values: usize,
758    /// Wall time spent evaluating them, in nanoseconds.
759    pub startup_nanos: u64,
760    /// Calls their evaluation answered from its call results.
761    pub startup_call_hits: u64,
762    /// Those the core did not evaluate whose value the binder's evaluation
763    /// supplied ([`crate::compile::Handoff::startup_evaluator`]).
764    pub startup_fallbacks: usize,
765}