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"}
}-
variableslists the specification’s variables. Every state assigns exactly these, in dive’s value JSON (crate::value_json). -
states[k].actionlabels the step into statek:nullfor the initial state, and optional elsewhere.nameis the action’s name as TLC prints it, without parameters;locationis informative. -
endingsays what the trace claims (Ending):kindFields Claim 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 counterexamplestutteringthe 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:
| Version | Adds |
|---|---|
| 1 | every ending kind above except invariant-error |
| 2 | the invariant-error ending |
| 3 | a terminal partial candidate, separate from the complete state rows |
| 4 | ordered errors on the candidate side of a step |
| 5 | errors in temporal-source rows after Next |
| 6 | errors 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.propertieslists 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.
- Trace
Doc - A counterexample as data, before its values are read against a model.
Enums§
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.