Skip to main content

ModelConfig

Struct ModelConfig 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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

Source

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.

Source

pub fn assignments(&self) -> impl Iterator<Item = Assignment<'_>>

Assignments to the root module’s constants, in source order, duplicates included (TLC’s getConstants()).

Source

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()).

Source

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().

Source

pub fn module_substitutions(&self) -> BTreeMap<&str, BTreeMap<&str, &Name>>

Module-scoped substitutions C <- [M] D, by module and then by C, later entries replacing earlier ones (TLC’s getModOverrides()).

Trait Implementations§

Source§

impl Clone for ModelConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ModelConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ModelConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for ModelConfig

Source§

impl PartialEq for ModelConfig

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ModelConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.