Skip to main content

Node

Enum Node 

Source
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.

Fields

§slot: u32

The cache slot.

§body: P

The argument.

§

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

§first: G

Enumerable first-stage action.

§then: G

Deterministic action assigning every final variable.

§free: Box<[u32]>

Captured lexical slots.

§reset: Box<[u32]>

State-dependent thunk slots of this frame, reset whenever the stages change the rows they read.

§

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

§eq: P

The original Eq of the two tuples.

§leaves: Box<[(u16, u8)]>

Each leaf variable and its depth (1 for an outer element).

§thunks: Box<[u32]>

The slots of the thunks (Node::Lazy) between eq and the leaves.

§

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

§bind: Bind

The bound.

§pred: P

The predicate.

§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, ...}

Fields

§binds: Box<[Bind]>

The bounds.

§body: P

The element.

§

FcnCons

[x \in S |-> e]

Fields

§binds: Box<[Bind]>

The bounds.

§body: P

The body.

§

Quant

\E, \A, CHOOSE.

Fields

§kind: Quant

Which.

§binds: Box<[Bind]>

The bounds.

§body: P

The body.

§

Apply(P, P)

f[a]

§

Select(P, Handle)

r.f

§

Domain(P)

DOMAIN f

§

Except

[f EXCEPT ...]

Fields

§base: P

The function.

§updates: Box<[Update]>

The clauses.

§

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).

Fields

§reset: Box<[u32]>

Thunk slots to reset.

§body: P

The body.

§

Call

A call of a recursive operator, in a new frame.

Fields

§fun: u32

The function.

§args: Box<[P]>

The arguments, evaluated eagerly.

§

Std(StdFn, Box<[P]>)

A standard operator.

§

Lib

A standard or CommunityModules operator implemented in crate::stdlib, on normalized arguments.

Fields

§op: StdOp

The library operator.

§args: Box<[P]>

Its arguments, evaluated in source order.

§repeatable_args: bool

Whether reevaluation is proven effect-free without calls or free slots.

§

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.

Fields

§g: G

The action.

§free: Box<[u32]>

The slots read from outside the action.

§

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.

Fields

§elem: P

The element.

§set: P

The set’s node.

§neg: bool

\notin.

§

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

§chain: P

The function expression.

§fc: P

The FcnCons node, whose bound variables have no tuple pattern.

§arg: P

The argument.

§

DomCheck

The body of a recursive function f[x \in S] == e: checks that the argument in slot is in domain, then evaluates body.

Fields

§slot: u32

The argument’s slot.

§domain: P

The domain.

§body: P

The body.

§

Memo

A memoized pure body.

Fields

§site: u32

The site.

§body: P

The body.

Trait Implementations§

Source§

impl Clone for Node

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Node

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Forget for Node

§

impl Freeze for Node

§

impl Move for Node

§

impl RefUnwindSafe for Node

§

impl Send for Node

§

impl Sync for Node

§

impl Unpin for Node

§

impl UnsafeUnpin for Node

§

impl UnwindSafe for Node

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.