Skip to main content

Module format

Module format 

Source
Expand description

Counterexample transports: dive’s format (versions 1 through 6) and TLC’s JSON.

§dive’s format

{
  "format": "dive-trace",
  "version": 1,
  "variables": ["big", "small"],
  "states": [
    {"action": null, "values": {"big": 0, "small": 0}},
    {"action": {"name": "FillBigJug", "location": "line 68, col 18 to line 69, col 34 of module DieHard"},
     "values": {"big": 5, "small": 0}}
  ],
  "ending": {"kind": "invariant", "name": "NotSolved"}
}
  • variables lists the specification’s variables. Every state assigns exactly these, in dive’s value JSON (crate::value_json).

  • states[k].action labels the step into state k: null for the initial state, and optional elsewhere. name is the action’s name as TLC prints it, without parameters; location is informative.

  • ending says what the trace claims (Ending):

    kindFieldsClaim
    invariantnamethe invariant is false in the last state
    propertynamethe action property is false on the last step (or, for a one-state trace, the implied initial predicate is false in it)
    deadlockthe last state has no successor
    behaviornothing beyond being a behavior of the specification (implementation traces)
    lassoback_tothe last state’s successor is state back_to (0-based); a liveness counterexample
    stutteringthe behavior stutters forever after the last state
    assertion, errorec (error, optional)expanding the last state fails
    invariant-errorname, ecevaluating the named invariant on the last state raises the given underlying error

The format version is the lowest one that can express the document:

VersionAdds
1every ending kind above except invariant-error
2the invariant-error ending
3a terminal partial candidate, separate from the complete state rows
4ordered errors on the candidate side of a step
5errors in temporal-source rows after Next
6errors in a source-final VIEW evaluation

Readers accept all six versions and reject a version-1 document that uses the invariant-error ending. Unknown versions and ending kinds are rejected, never guessed.

invariant-error.ec is the underlying evaluation cause. The enclosing check report retains TLC’s deciding class, normally TLC_INVARIANT_EVALUATION_FAILED (2111), or a separately qualified diagnostic replay’s class; replacing the cause with a wrapper is invalid. Validation requires the named invariant to raise exactly that cause, with all earlier states and earlier configured invariants passing.

  • length (optional) is the claimed number of states; it must match.
  • properties lists all temporal properties violated by a lasso or stuttering word. Older documents without names remain unsupported for liveness validation. An enclosing report’s names must agree with these.

dive check --output json embeds this object as counterexample.trace; TraceDoc::from_json accepts the object itself, a document that carries it as counterexample, or dive check’s report or its counterexample object.

§TLC’s format

TLC’s -dumpTrace json document ({"vars": [...], "counterexample": {"state": [[1, {...}], ...], "action": [[[1, {...}], {"name": ...}, [2, {...}]], ...]}}) is read too. It carries no ending, so one must be given (TraceDoc::with_ending), and its values are in TLC’s lossy form, which crate::tlc interprets against the model.

Structs§

Label
The label of a step.
TraceDoc
A counterexample as data, before its values are read against a model.

Enums§

Ending
What a trace claims about its end.
Source
Which format a document was read from.

Constants§

CANDIDATE_ERROR_VERSION
Version for an ordered candidate-side error with independent wrapper replay.
FORMAT
The format name in TraceDoc::to_json.
INVARIANT_ERROR_VERSION
The format version required by named invariant-error endings.
PARTIAL_STATE_VERSION
Version for a terminal partial candidate separate from complete prefix rows.
TEMPORAL_SOURCE_ERROR_VERSION
Version for an independently replayed post-Next temporal-source-row error.
VERSION
The base format version, still written for every ending kind that needs nothing newer.
VIEW_SOURCE_ERROR_VERSION
Version for a source-final VIEW demand with independently reconstructed keys.