pub enum Node {
Show 51 variants
Const(Handle),
Slot(u32),
Lazy {
slot: u32,
body: P,
},
Var(u16),
Primed(u16),
Not(P),
And(Box<[P]>),
Or(Box<[P]>),
Implies(P, P),
Equiv(P, P),
Composition {
first: G,
then: G,
free: Box<[u32]>,
reset: Box<[u32]>,
},
If(P, P, P),
Case(Box<[(P, P)]>, Option<P>),
Eq(P, P),
SameVars {
eq: P,
leaves: Box<[(u16, u8)]>,
thunks: Box<[u32]>,
},
Neq(P, P),
In(P, P),
NotIn(P, P),
Subseteq(P, P),
Arith(Arith, P, P),
Cmp(Cmp, P, P),
Neg(P),
Range(P, P),
SetEnum(Box<[P]>),
SetBin(SetOp, P, P),
Powerset(P),
BigUnion(P),
Product(Box<[P]>),
FcnSet(P, P),
RecSet(Box<[(Handle, P)]>),
Filter {
bind: Bind,
pred: P,
subset: Option<P>,
},
Map {
binds: Box<[Bind]>,
body: P,
},
FcnCons {
binds: Box<[Bind]>,
body: P,
},
Quant {
kind: Quant,
binds: Box<[Bind]>,
body: P,
},
Apply(P, P),
Select(P, Handle),
Domain(P),
Except {
base: P,
updates: Box<[Update]>,
},
Tuple(Box<[P]>),
Record(Box<[(Handle, P)]>),
Scope {
reset: Box<[u32]>,
body: P,
},
Call {
fun: u32,
args: Box<[P]>,
},
Std(StdFn, Box<[P]>),
Lib {
op: StdOp,
args: Box<[P]>,
repeatable_args: bool,
},
LibHo(StdOp, Box<[LibArg]>),
Enabled {
g: G,
free: Box<[u32]>,
},
Spec(P),
InLazy {
elem: P,
set: P,
neg: bool,
},
Beta {
chain: P,
fc: P,
arg: P,
},
DomCheck {
slot: u32,
domain: P,
body: P,
},
Memo {
site: u32,
body: P,
},
}Expand description
A value node.
Variants§
Const(Handle)
A constant (persistent or scalar).
Slot(u32)
A frame slot holding a value.
Lazy
A thunk: evaluated on first use and cached in its slot until the enclosing scope is entered again.
Var(u16)
An unprimed state variable.
Primed(u16)
A primed state variable (the successor buffer).
Not(P)
~e
And(Box<[P]>)
Conjunction, short-circuit.
Or(Box<[P]>)
Disjunction, short-circuit.
Implies(P, P)
a => b
Equiv(P, P)
a <=> b
Composition
Pure bounded A \\cdot B, tested against the complete successor.
Fields
If(P, P, P)
IF c THEN a ELSE b
Case(Box<[(P, P)]>, Option<P>)
CASE
Eq(P, P)
a = b
SameVars
e = e' for a subscript e compiled to a tuple, possibly nested and
behind thunks, of state variables (changed_test). eq is that
Eq. Outside TLC comparisons, when no thunk on the way is forced and
every leaf of both states is materialized, the result is each leaf’s
Heap::eq, without building either tuple or forcing a thunk;
otherwise eq is evaluated.
Fields
Neq(P, P)
a /= b
In(P, P)
a \in S
NotIn(P, P)
a \notin S
Subseteq(P, P)
A \subseteq B
Arith(Arith, P, P)
Integer arithmetic.
Cmp(Cmp, P, P)
Integer comparison.
Neg(P)
-a
Range(P, P)
a..b
SetEnum(Box<[P]>)
{a, b, ...}; finite sets use canonical order by default.
SetBin(SetOp, P, P)
A \cup B and friends.
Powerset(P)
SUBSET S
BigUnion(P)
UNION S
Product(Box<[P]>)
S1 \X ... \X Sn
FcnSet(P, P)
[D -> R]
RecSet(Box<[(Handle, P)]>)
[f : S, ...], field names sorted.
Filter
{x \in S : P}
Fields
subset: Option<P>A proven rewrite of {E \in SUBSET T : \A e \in E : Q} as
SUBSET F: the node of F = {e \in T : Q}. The compiler sets it
only when Q is pure, makes no call and does not read E, so
the filter’s elements are exactly the subsets of F. Only
enumeration uses it; membership keeps the filter’s own order of
evaluation, and an evaluation error in F falls back to the
filter itself.
Map
{e : x \in S, ...}
FcnCons
[x \in S |-> e]
Quant
\E, \A, CHOOSE.
Apply(P, P)
f[a]
Select(P, Handle)
r.f
Domain(P)
DOMAIN f
Except
[f EXCEPT ...]
Tuple(Box<[P]>)
<<a, b>>
Record(Box<[(Handle, P)]>)
[a |-> e, ...], field names sorted.
Scope
Resets thunk slots, then evaluates the body (an inlined operator or
a LET).
Call
A call of a recursive operator, in a new frame.
Std(StdFn, Box<[P]>)
A standard operator.
Lib
A standard or CommunityModules operator implemented in
crate::stdlib, on normalized arguments.
Fields
LibHo(StdOp, Box<[LibArg]>)
A crate::stdlib operator with operator arguments.
Enabled
ENABLED A: whether the action A has a successor from the current
state, complete or not (TLC’s Tool.enabled). free holds the
frame slots A reads from outside it.
Spec(P)
An expression the core evaluates eagerly where TLC evaluates it
lazily: an evaluation error inside it
is reported as unsupported, because TLC might never raise it.
InLazy
a \in S (or a \notin S with neg) with S a set TLC keeps
lazy: a filter or a binary set operation, possibly behind thunks.
Membership is decided on the structure, as TLC’s SetPredValue,
SetCupValue, SetCapValue and SetDiffValue do, without building
the set.
Beta
f[arg] with f a function constructor TLC keeps lazy
(FcnLambdaValue.apply): the body is evaluated for arg alone, after
a domain check. chain leads to the constructor fc through thunks;
a thunk already forced is applied as a value.
Fields
DomCheck
The body of a recursive function f[x \in S] == e: checks that the
argument in slot is in domain, then evaluates body.
Memo
A memoized pure body.