Skip to main content

Module ops

Module ops 

Source
Expand description

Set algebra on finite sets, as TLC evaluates it.

These port TLC’s eager forms (SetEnumValue.cup, cap, diff; tlaplus 94d0c50), including which results stay unnormalized: a union is built unnormalized, and an intersection or difference keeps its left operand’s state. That matters for TLC’s errors, because membership in an unnormalized set is a linear scan with equals (fixture ErrMemNormalized). Membership uses the checked crate::tlc::member. Lazy unions of infinite sets are dive-eval’s concern (DeferredSet).

Functions§

choose
The first element of s in normalized order that satisfies pred: TLC’s CHOOSE x \in s : pred(x) (Tool, OPCODE_bc, which enumerates with Ordering.NORMALIZED). None when no element satisfies it.
difference
a \ b (SetEnumValue.diff).
intersect
a \cap b (SetEnumValue.cap).
union
a \cup b (SetEnumValue.cup): a’s elements, then b’s elements not in a, unnormalized.