#[non_exhaustive]pub struct ModelConfig {Show 17 fields
pub init: Option<Name>,
pub next: Option<Name>,
pub specification: Option<Name>,
pub view: Option<Name>,
pub symmetry: Option<Name>,
pub alias: Option<Name>,
pub periodic: Option<Name>,
pub rl_reward: Option<Name>,
pub check_deadlock: Option<Spanned<bool>>,
pub invariants: Vec<Name>,
pub properties: Vec<Name>,
pub constraints: Vec<Name>,
pub action_constraints: Vec<Name>,
pub postconditions: Vec<Name>,
pub possible: Vec<Name>,
pub constants: Vec<ConstantEntry>,
pub model_values: Vec<String>,
}Expand description
A parsed TLC model configuration.
Fields mirror TLC’s ModelConfig tables. Section keywords that TLC
treats as synonyms share one field (INVARIANT/INVARIANTS), and
repeated list sections append. Single-valued keywords may appear once.
Whether the names exist in the specification, have the right arity and
level, and whether SPECIFICATION conflicts with INIT/NEXT, is
checked later by TLC’s SpecProcessor, not by the cfg reader. Those
checks belong to semantic analysis and the checker.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.init: Option<Name>INIT.
next: Option<Name>NEXT.
specification: Option<Name>SPECIFICATION.
view: Option<Name>VIEW.
symmetry: Option<Name>SYMMETRY.
alias: Option<Name>ALIAS.
periodic: Option<Name>_PERIODIC: TLC’s undocumented periodic-evaluation hook.
rl_reward: Option<Name>_RL_REWARD: TLC’s undocumented reinforcement-learning reward hook.
check_deadlock: Option<Spanned<bool>>CHECK_DEADLOCK TRUE|FALSE. Absent means TLC’s default (check).
invariants: Vec<Name>INVARIANT and INVARIANTS.
properties: Vec<Name>PROPERTY and PROPERTIES.
constraints: Vec<Name>CONSTRAINT and CONSTRAINTS.
action_constraints: Vec<Name>ACTION_CONSTRAINT and ACTION_CONSTRAINTS.
postconditions: Vec<Name>POSTCONDITION and POSTCONDITIONS.
possible: Vec<Name>_POSSIBLE: TLC’s provisional reachability assertions.
constants: Vec<ConstantEntry>Every CONSTANT/CONSTANTS entry, in source order.
model_values: Vec<String>Model value names in the order TLC creates them (first occurrence while parsing values, including operator arguments and set elements). TLC numbers model values in this order.
Implementations§
Source§impl ModelConfig
impl ModelConfig
Sourcepub fn checks_deadlock(&self) -> bool
pub fn checks_deadlock(&self) -> bool
Whether TLC checks for deadlock under this configuration, before
command-line flags: CHECK_DEADLOCK FALSE turns it off, and TLC’s
-deadlock flag also turns it off.
Sourcepub fn assignments(&self) -> impl Iterator<Item = Assignment<'_>>
pub fn assignments(&self) -> impl Iterator<Item = Assignment<'_>>
Assignments to the root module’s constants, in source order,
duplicates included (TLC’s getConstants()).
Sourcepub fn module_assignments(&self) -> BTreeMap<&str, Vec<Assignment<'_>>>
pub fn module_assignments(&self) -> BTreeMap<&str, Vec<Assignment<'_>>>
Module-scoped assignments C = [M] v, grouped by module, each group
in source order (TLC’s getModConstants()).
Sourcepub fn substitutions(&self) -> BTreeMap<&str, &Name>
pub fn substitutions(&self) -> BTreeMap<&str, &Name>
Root-module substitutions C <- D, keyed by C. A later entry for
the same name replaces an earlier one, as in TLC’s getOverrides().