Skip to content

tpp 0.6.1

Choose a tag to compare

@github-actions github-actions released this 08 Nov 08:09
· 242 commits to main since this release

Edge cases found running tlaplus/Examples' models against TLC 1.8.0:

  • A property or specification is split through any number of instances
    (TestGraphs' Refinement == MCR!Spec through INSTANCE TLCMC).
  • TLC builds its tableaux before the assumptions; a constant in a
    property that fails there is TLC's unexpected exception.
  • Fingerprint stack traces have the INSTANCE an evaluation enters, and
    the set of UNION {S}.
  • TLCGet("-Dk") and TLCSet("-Dk", v) are Java's system properties.
  • A module in no file of its own is read from the root module's file, as
    SANY reads a monolithic spec (braf's Common).
  • An action \E x \in S : A whose S is empty is one action, as TLC
    splits it, so a random behavior draws the same actions (EWD687a_anim,
    whose leaves have no out-edges); one whose S fails is one action
    too, failing in the search rather than before it.
  • A call Op(a) in the next-state action whose argument is not
    constant, or fails, or of a built-in Op, is one action named Op
    and located at the call, as TLC splits it; a call of a LET definition
    is split.

Edge cases found running TLC's own test models (test-model):

  • A tab moves to the column after the next multiple of 8, as SANY counts
    it, for junction alignment and locations.

  • A constant operator, and an instance's definition (I!Op), are
    operator arguments by their bare names.

  • An operator passed as an argument takes its arguments lazily, as a
    definition does.

  • A property is split as TLC's processConfigProps splits it: through
    LET, calls of definitions with arguments, and \A x \in S over a
    constant set; a parameter has its argument's level, so
    Prop(a) == [](a < 2) checks Prop(s) as an invariant Prop
    instead of failing to evaluate s without a state.

  • A safety-like temporal property, such as [](x = 2 => [](x >= 2)),
    checked without fairness, fails as TLC finds it: on a path back to a
    state already expanded, the search stops there with a finite behavior,
    that moment's counts and exit status 12, instead of a lasso at the end
    (Github1161Violated).

  • Bags' operators but SubBag are TLC's Java methods, with their
    results and errors: IsABag(<<"a">>) is FALSE instead of failing to
    compare "a" with Nat, and CopiesIn(2, 2 :> -1) is -1 (BagsTest).

  • The configuration's CONSTANT F(0) = 1 F(1) = 2 defines the operator
    F by its values, as TLC does; tpp skipped the arguments and took the
    last value (ConstantOperatorConfiguration). A constant whose value is
    no operator, applied to arguments, is that value, as in TLC.

  • S \subseteq T is TLC's: SUBSET A \subseteq SUBSET B is
    A \subseteq B, an interval in an interval is decided by its bounds,
    and an error inside S is one TLC cannot fingerprint (EmptySubsetEq).

  • SUBSET S of 31 elements or more fails as TLC counts it, with each
    SUBSET inside in the fingerprint stack; a successor TLC finds again,
    comparing SUBSETs by their bases, fails again rather than with its
    NullPointerException (FingerprintExceptionInit, FingerprintExceptionNext).

  • A temporal IF whose guard evaluates with no state is its chosen
    branch, as TLC 1.8 translates it, so a RECURSIVE property ends
    instead of overflowing the stack (Github1389).

  • A configuration string that a line end or the file's end interrupts is
    JavaCC's lexical error, as TLC reports it (Github1455).

  • TLCGet is no constant to TLC, as its Java method's level is 1: a
    definition using it is not evaluated at startup, and a substitution
    A <- d of one that fails there is the error of a non-constant
    substitution. At startup TLCGet("level") is 0 and the search's
    counters are undefined (TLCGetNamedUndefined). TLCGet("level")' is
    the next state's level (TLCGetLevel).

  • An error in a temporal property on an initial state exits with the
    error's status, such as 151 for an undefined identifier
    (InitialLivenessEvaluationError).

  • After a deadlock, a safety-like temporal property violated on the path
    to the deadlocked state is reported too, as TLC adds that state to its
    temporal checks after reporting the deadlock (Github710d).

  • An alias's field _format is the Java format each other field is
    printed with; a conversion Java cannot apply to a string is its
    exception, ending the trace (PrintTraceException).

  • A conjunct []S of the specification, S a state predicate, is the
    temporal formula TLC cannot handle; the specification is taken before
    the properties, as TLC takes it (Github525).

  • A substitution that makes the subscript of [][Next]_v refer to itself
    is TLC's stack overflow, as it collects the subscript's variables even
    with -nowarning (CyclicRedefineVars).

  • Fairness and properties whose disjunctive normal form TLC cannot count
    in an int, such as 36 SFs, are its error before the check (Github742).

  • I!F \in S with F == x', (LET y == x' IN y) = 0 and I!G' = 0
    assign x', in the next-state action and in ENABLED, as TLC 1.8's
    getPrimedVar finds the variable (Github725c, d, e).

  • Inside ENABLED, a primed variable of an instance that the action
    assigned by name is read back by name (Github725f, g).

  • TLCExt: AssertError, TLCCache, TLCModelValue, TLCGetOrDefault,
    AssertEq, TLCNoOp and TLCGetAndSet (ConstantContextTLCCache,
    ModuleSemanticsAssume); its operators of traces, fingerprints and
    successors stop tpp, saying so.

  • RandomSubset(k, a..b) takes its elements without making the interval,
    so it draws from up to 2^31 - 1 numbers; a negative k is Java's
    NegativeArraySizeException.

  • Init draws on from where the assumptions' draws stopped, as TLC's main
    thread keeps one generator (RandomSubset's trace); RandomElement and
    RandomSubset index an interval among a product's parts without making
    it, so Init stays small.

  • RealTime and Toolbox are built-in standard modules, as TLC ships them.

  • A postcondition reads TLCGet("generated"), the states the search
    generated.

  • TLC's messages for EXCEPT on a value that is no function (without a
    location), DOMAIN of a non-function, and SortSeq of a non-sequence.

  • TLC's message for each place a boolean is expected: a quantifier's or
    CHOOSE's body, a CASE condition, a filter's predicate, ~. A record
    applied to a non-string, an interval joined with a string, and a tuple
    pattern matched with a non-tuple fail as TLC does.

  • A function applied outside its domain fails with TLC's message to its
    final newline, which AssertError compares (Github696).

  • Enumerating [D -> R] names only a domain such as Nat or Seq(S);
    another, such as Nat \ {0}, fails as TLC enumerates it (Toolbox's
    _TEPosition).

  • The initial predicate, the next-state action and ENABLED fail with
    TLC's message for each: an IF or CASE guard that is no boolean, a
    CASE with no true guard, x' \in a non-set, a non-function applied,
    a conjunct that is no boolean, and a number or string where an action
    is expected, which in a disjunct of Next fails before the initial
    states. ENABLED evaluates no conjunct as a whole formula, as TLC.

  • A temporal property's constant that is no boolean fails as TLC builds
    its tableau, naming the constant (x ~> 1); []1, checked as an
    invariant, names 1. A temporal \A or \E whose bound TLC cannot
    enumerate is a formula it cannot handle, \A saying why. A property
    split over \A whose part is the bound value fails as TLC's
    configuration does: not a boolean, or trivially false.

  • A state predicate of a property without a tableau is evaluated on the
    state TLC expands, not on an initial state as it is found nor on the
    successors, so an error in it names that state (UserModuleOverrideAnnotation).

Performance:

  • A state-level substitution of an instance, such as a refinement
    mapping q <- Map(x), is computed once per state, as TLC keeps its
    LazyValue (a refinement check: 2.09 s to 1.55 s).
  • <<x, y>> \in S probes S with x and y, without making the tuple
    (closure 0.48 s to 0.46 s).
  • A stored state takes a byte for a small number instead of four: about
    half the memory for states of records (PaxosCommit 2.1 GB to 1.1 GB),
    for 3% more time on counters.
  • Two sets or tuples of numbers or strings compare without the general
    checks (partition with N = 10: 1.25 s to 1.15 s; TLCSailfish1 3%).
  • An operator of an instance of a standard module, such as + through
    LOCAL INSTANCE Integers, takes its arguments' values as a call in
    the module itself does, and a call from the root module through
    instances without parameters keeps its chain of instances (Huang,
    whose DyadicRationals instances Integers: 66 s to 43 s).
  • r.f looks first where it found f in the last record (MCPaxosSmall
    20.3 s to 18.6 s).
  • Computing the initial states drops what each candidate's guards and
    each state's invariants made (MCBakery, all of whose 655200 states are
    initial: 1.2 GB to 0.4 GB, 10% faster).