pub struct TraceDoc {
pub variables: Vec<String>,
pub states: Vec<Map<String, Value>>,
pub labels: Vec<Option<Label>>,
pub ending: Option<Ending>,
pub length: Option<usize>,
pub source: Source,
pub properties: Vec<String>,
}Expand description
A counterexample as data, before its values are read against a model.
Fields§
§variables: Vec<String>The variables, as listed by the document.
states: Vec<Map<String, Value>>Each state’s values by variable name, in the document’s JSON form.
labels: Vec<Option<Label>>The label of the step into each state (labels[0] is None).
ending: Option<Ending>What the trace claims, if the document says.
length: Option<usize>The claimed number of states, if the document says.
source: SourceThe format.
properties: Vec<String>All temporal properties claimed to be false on this periodic word. Empty for other endings, or for an older unnamed liveness document.
Implementations§
Source§impl TraceDoc
impl TraceDoc
Sourcepub fn logical_length(&self) -> usize
pub fn logical_length(&self) -> usize
Logical word length, including a separate terminal partial candidate.
Sourcepub fn behavior(states: Vec<J>) -> Result<Self, String>
pub fn behavior(states: Vec<J>) -> Result<Self, String>
A behavior in dive’s format, from states given as JSON objects
(variable name to value, in dive’s JSON form), with no labels. The
ending is Ending::Behavior: use it to check an implementation’s
trace.
§Errors
If a state is not a JSON object.
Sourcepub fn with_ending(self, ending: Ending) -> Self
pub fn with_ending(self, ending: Ending) -> Self
This document with its ending replaced.
Sourcepub fn with_properties(self, properties: Vec<String>) -> Self
pub fn with_properties(self, properties: Vec<String>) -> Self
Names every temporal property this periodic word claims to violate. Validation checks the names, their truth values and completeness.
Sourcepub fn from_json(j: &J) -> Result<Self, String>
pub fn from_json(j: &J) -> Result<Self, String>
Reads a document in dive’s format (or one that carries it as
counterexample), or in TLC’s -dumpTrace json format.
§Errors
A message naming what is malformed.