pub struct Model {Show 29 fields
pub ir: Arc<Ir>,
pub evaluator: Evaluator,
pub names: Arc<Interner>,
pub output: Vec<Message>,
pub init: Vec<Init>,
pub next: Option<Pred>,
pub init_actions: Vec<Action>,
pub actions: Vec<Action>,
pub invariants: Vec<Named>,
pub implied_inits: Vec<Named>,
pub implied_actions: Vec<Named>,
pub temporals: Vec<Named>,
pub implied_temporals: Vec<Named>,
pub configured_properties: Vec<Named>,
pub constraints: Vec<Named>,
pub action_constraints: Vec<Named>,
pub view: Option<Named>,
pub alias: Option<Result<Named, BindError>>,
pub postconditions: Result<Vec<Named>, BindError>,
pub symmetry: Option<String>,
pub symmetry_reduction: Option<Arc<Reduction>>,
pub settings: Settings,
pub assumptions: Vec<DefId>,
pub unsupported: Vec<Unsupported>,
pub sequential: Vec<String>,
pub sequential_names_only: bool,
pub runtime_name_order: bool,
pub deferred_constants: BTreeSet<DefId>,
pub deferred_assumptions: Vec<DefId>,
/* private fields */
}Expand description
A specification bound to its configuration.
Fields§
§ir: Arc<Ir>The lowered specification.
evaluator: EvaluatorThe evaluator, with the constants bound and the start-up values computed. Clones share them.
names: Arc<Interner>The run’s names, in TLC’s encounter order.
output: Vec<Message>What TLC prints while it processes the model, before it checks the
assumptions: Print output of constant definitions and warnings.
init: Vec<Init>Initial predicates, in TLC’s order.
next: Option<Pred>The next-state relation as TLC holds it before splitting
(getNextStateSpec), if any.
init_actions: Vec<Action>The initial predicates as the successor generator’s actions
(Evaluator::init_states), numbered from 0.
actions: Vec<Action>The next-state relation split into TLC’s actions, with TLC’s labels,
numbered after the initial predicates (Evaluator::successors).
invariants: Vec<Named>Invariants: INVARIANTs, then the state predicates []P of
PROPERTYs.
implied_inits: Vec<Named>Implied initial predicates: state-level parts of PROPERTYs.
implied_actions: Vec<Named>Implied actions: the [A]_v of [][A]_v in PROPERTYs.
temporals: Vec<Named>Temporal formulas of the behavior specification (fairness), named as TLC names them. Inert for safety checking.
implied_temporals: Vec<Named>Temporal properties to check (liveness).
configured_properties: Vec<Named>Original configured PROPERTY formulas, before TLC’s role splitting. These retain configuration names for complete counterexample claims; the role vectors above keep TLC’s evaluation/checking order unchanged.
constraints: Vec<Named>CONSTRAINTs.
action_constraints: Vec<Named>ACTION_CONSTRAINTs.
view: Option<Named>VIEW.
alias: Option<Result<Named, BindError>>ALIAS. TLC looks it up only when it prints a trace
(Spec.getAliasSpec), so a lookup error is reported then, not at
start-up.
postconditions: Result<Vec<Named>, BindError>POSTCONDITIONs. TLC looks them up after checking
(Spec.getPostConditionSpecs), stopping at the first error, which it
reports then.
symmetry: Option<String>SYMMETRY, by name.
symmetry_reduction: Option<Arc<Reduction>>Prepared safety reduction. Concrete states remain unmodified.
settings: SettingsRun settings.
assumptions: Vec<DefId>The root module’s assumptions TLC checks (not AXIOMs), in order.
unsupported: Vec<Unsupported>Features this model uses that dive does not check yet.
sequential: Vec<String>Why the model must be checked in sequential mode, with one logical worker evaluating in TLC’s order; empty when a parallel search gives the same results. Each entry names the feature.
sequential_names_only: boolThe only sequential restriction is preserving runtime name encounter order. This is not an I/O, random-stream or live-checker-state effect. This conservative source inventory remains available to checkpoint admission after a proof discharges the corresponding worker restriction.
runtime_name_order: boolChecking may create runtime names whose encounter order is observable under the selected value or exploration order. Remains true when other sequential effects are also reachable. This is a conservative source feature flag; a worker-selection proof can remove a scheduling reason without changing replay’s inventory.
deferred_constants: BTreeSet<DefId>Pure constant-level definitions whose start-up evaluation was left to
Core (crate::bind_deferring_constants); empty
otherwise. The evaluator evaluates them lazily.
deferred_assumptions: Vec<DefId>The root module’s pure ASSUMEs, in order, that Core
evaluates when it compiles its plan
(crate::bind_deferring_constants); empty otherwise. Their value
is a function of the start-up values alone, so one the core finds
TRUE need not be checked again
(Model::check_assumptions_except).
Implementations§
Source§impl Model
impl Model
Sourcepub fn stateful_checking(&self) -> Option<&str>
pub fn stateful_checking(&self) -> Option<&str>
A reachable stateful checking restriction, if any, from model binding.
Runtime-name encounter order and TLC composition accounting are separate sequential requirements. Their presence alone does not return a reason here. This classification does not establish support: each backend must still apply its remaining checks and evaluate the actual model.
if let Some(reason) = model.stateful_checking() {
eprintln!("stateful checking: {reason}");
}Sourcepub fn seal_startup_names(&self)
pub fn seal_startup_names(&self)
Records every name interned so far as a start-up name
(dive_eval::Evaluator::seal_startup_names). Call it only after
interning names TLC interns before it evaluates any ASSUME or state.
Sourcepub fn has_runtime_names(&self) -> bool
pub fn has_runtime_names(&self) -> bool
Whether a name was interned after start-up
(dive_eval::Evaluator::startup_names)
and string order follows encounter order (TLC’s value or exploration
order), so that the name’s position relative to the others depends
on evaluations outside a given trace.
Sourcepub const fn symmetry_liveness(&self) -> &SymmetryLivenessResolution
pub const fn symmetry_liveness(&self) -> &SymmetryLivenessResolution
The immutable original declaration and policy after actual role binding. This is not exploration or witness evidence.
let requested = model.symmetry_liveness().requested();
assert!(["unreduced", "refuse", "tlc"].contains(&requested.as_str()));Sourcepub fn unreduced_symmetry_liveness(&self) -> bool
pub fn unreduced_symmetry_liveness(&self) -> bool
Whether this model uses full concrete identities for temporal checking. Public role/declaration changes or an installed reduction invalidate it.
if model.unreduced_symmetry_liveness() {
assert!(model.symmetry_reduction.is_none());
assert!(!model.implied_temporals.is_empty());
}Sourcepub fn validate_context(&self) -> Result<()>
pub fn validate_context(&self) -> Result<()>
Admits public bound-model metadata before backend startup or host effects. Checks evaluator ownership and every predicate/action scope without evaluating expressions or forcing captured values.
§Errors
A named malformed/foreign context or bounded admission refusal.
Sourcepub fn implied_temporal_action_names(&self) -> &[String]
pub fn implied_temporal_action_names(&self) -> &[String]
Original configuration names on TLC’s expanded implied-temporal Actions,
recorded in role order by the binder. A conjunctive P can yield
P;P; these are distinct from configured claims and derived labels.
Rebind caller-edited role vectors before using this binding snapshot.
Sourcepub fn property_claims(&self) -> &[Named]
pub fn property_claims(&self) -> &[Named]
Original configured property claims, or the temporal roles for a model without retained originals. A quantified conjunction must be attributed as one configured property, not as ambiguous identically named roles.
Sourcepub fn eval_boolean(&self, pred: &Pred, st: &St) -> Result<bool>
pub fn eval_boolean(&self, pred: &Pred, st: &St) -> Result<bool>
Evaluates a configured Boolean role with TLC’s Tool.isValid boundary.
A returned non-Boolean value raises the tool’s source-qualified 2215;
an error inside the expression retains its original constructor/source.
let holds = model.eval_boolean(pred, state)?;§Errors
The original evaluation failure, or the actual non-Boolean role failure.
Sourcepub fn check_assumptions(&self) -> AssumptionOutcome
pub fn check_assumptions(&self) -> AssumptionOutcome
TLC’s Tool.checkAssumptions: the assumptions in order, AXIOMs
skipped, stopping at the first that is not TRUE.
Sourcepub fn check_assumptions_except(&self, proved: &[DefId]) -> AssumptionOutcome
pub fn check_assumptions_except(&self, proved: &[DefId]) -> AssumptionOutcome
Self::check_assumptions, skipping proved: pure assumptions
(among Self::deferred_assumptions) another evaluator found
TRUE. Skipping one is unobservable: TLC’s evaluation of it has no
effect and does not stop the check.
Sourcepub fn take_output(&self) -> Vec<String>
pub fn take_output(&self) -> Vec<String>
The Print output collected since the last call (the evaluator’s
default sink).
Source§impl Model
impl Model
Sourcepub fn prepare_symmetry(
&self,
cfg: &ModelConfig,
mode: Mode,
limits: Limits,
) -> Result<Option<Prepared>, BindError>
pub fn prepare_symmetry( &self, cfg: &ModelConfig, mode: Mode, limits: Limits, ) -> Result<Option<Prepared>, BindError>
Prepares a pure declaration using Tool.getSymmetryPerms’s ordering:
representations, too-small warnings, domain/range checks, closure,
then unused argument warnings. cfg must be the bound configuration.
This API does not itself activate reduction or remove checker refusals.
§Example
let source = "---- MODULE M ----\nEXTENDS TLC\nCONSTANT S\nVARIABLE x\n\
Init == x = TRUE\nNext == UNCHANGED x\n\
Sym == Permutations(S)\n====\n";
let analysis = dive_sema::analyze_source("M.tla", source, &dive_sema::Options::default());
let ir = Arc::new(dive_ir::lower(&analysis).unwrap());
let cfg = dive_config::parse("CONSTANT S={a,b}\nINIT Init\nNEXT Next\nSYMMETRY Sym\n")
.into_config().unwrap();
let model = bind(ir, &cfg, &BindOptions::tlc()).unwrap();
let prepared = model.prepare_symmetry(&cfg, Mode::Tlc, Limits::default()).unwrap().unwrap();
assert!(prepared.reduction.is_some());
assert!(prepared.warnings.is_empty());§Errors
Invalid declarations, unavailable warning source evidence, unverified startup exceptions, or a bounded-closure refusal.
Source§impl Model
impl Model
Sourcepub fn symmetry_declaration(&self) -> Result<Option<Declaration>, BindError>
pub fn symmetry_declaration(&self) -> Result<Option<Declaration>, BindError>
Reads the configured pure symmetry definition from TLC’s pre-constant name-table snapshot and validates its set/function representations. Call once during startup, before checking. This does not build the group, issue too-small warnings or lift any checking refusal.
§Example
let source = "---- MODULE M ----\nEXTENDS TLC\nCONSTANT S\nVARIABLE x\n\
Init == x = TRUE\nNext == UNCHANGED x\n\
Sym == Permutations(S)\n====\n";
let analysis = dive_sema::analyze_source("M.tla", source, &dive_sema::Options::default());
let ir = Arc::new(dive_ir::lower(&analysis).unwrap());
let cfg = dive_config::parse("CONSTANT S={a,b}\nINIT Init\nNEXT Next\nSYMMETRY Sym\n")
.into_config().unwrap();
let model = bind(ir, &cfg, &BindOptions::tlc()).unwrap();
let declaration = model.symmetry_declaration().unwrap().unwrap();
assert_eq!(declaration.functions.len(), 2);
assert!(!model.unsupported.is_empty()); // reduction remains unsupported§Errors
TLC’s proved name/type, division-by-zero and set-comparison diagnostics; explicit refusals for unverified evaluation/normalization startup errors, or effectful, nonconstant and parameterized declarations. Domain/range validation, warning construction and kernel exceptions are later stages.