Repository navigation
tpp 0.6.1
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!SpecthroughINSTANCE 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
INSTANCEan evaluation enters, and
the set ofUNION {S}. TLCGet("-Dk")andTLCSet("-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'sCommon). - An action
\E x \in S : AwhoseSis 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 whoseSfails 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-inOp, is one action namedOp
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
processConfigPropssplits it: through
LET, calls of definitions with arguments, and\A x \in Sover a
constant set; a parameter has its argument's level, so
Prop(a) == [](a < 2)checksProp(s)as an invariantProp
instead of failing to evaluateswithout 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
SubBagare TLC's Java methods, with their
results and errors:IsABag(<<"a">>)isFALSEinstead of failing to
compare"a"withNat, andCopiesIn(2, 2 :> -1)is-1(BagsTest). -
The configuration's
CONSTANT F(0) = 1 F(1) = 2defines the operator
Fby 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 Tis TLC's:SUBSET A \subseteq SUBSET Bis
A \subseteq B, an interval in an interval is decided by its bounds,
and an error insideSis one TLC cannot fingerprint (EmptySubsetEq). -
SUBSET Sof 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
IFwhose guard evaluates with no state is its chosen
branch, as TLC 1.8 translates it, so aRECURSIVEproperty 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). -
TLCGetis 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 <- dof one that fails there is the error of a non-constant
substitution. At startupTLCGet("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
_formatis 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
[]Sof the specification,Sa 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]_vrefer 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 36SFs, are its error before the check (Github742). -
I!F \in SwithF == x',(LET y == x' IN y) = 0andI!G' = 0
assignx', in the next-state action and inENABLED, 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,TLCNoOpandTLCGetAndSet(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 negativekis 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
EXCEPTon a value that is no function (without a
location),DOMAINof a non-function, andSortSeqof a non-sequence. -
TLC's message for each place a boolean is expected: a quantifier's or
CHOOSE's body, aCASEcondition, 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, whichAssertErrorcompares (Github696). -
Enumerating
[D -> R]names only a domain such asNatorSeq(S);
another, such asNat \ {0}, fails as TLC enumerates it (Toolbox's
_TEPosition). -
The initial predicate, the next-state action and
ENABLEDfail with
TLC's message for each: anIForCASEguard that is no boolean, a
CASEwith no true guard,x' \ina 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.ENABLEDevaluates 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, names1. A temporal\Aor\Ewhose bound TLC cannot
enumerate is a formula it cannot handle,\Asaying why. A property
split over\Awhose 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
mappingq <- 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 SprobesSwithxandy, 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.flooks first where it foundfin 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).