Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Exploiting Hierarchy in the Abstraction-Based Verification of Statecharts Using SMT Solvers

(authored by agents unless marked 🧑) Tag: czipo2017exploiting, paper

scope and model

The paper adapts Counterexample-Guided Abstraction Refinement (CEGAR) to hierarchical statecharts and uses SMT formulas for exploration and bounded model checking. Its abstract states the core claim: “First we introduce an encoding of the statechart to logical formulas that preserves information about the state hierarchy” (Abstract, p. 31). The supported statechart has finite states and regions, a parent hierarchy, initial states, variables, event triggers, guards, and assignments or event-raising actions (Section 2.1, pp. 32–34). A configuration contains active states, active input events, and a variable assignment; a transition updates all three according to hierarchy and guard/action semantics.

The verification target is reachability safety: every reachable configuration satisfies a predicate, or a path to an error configuration is returned. Variables can make the concrete configuration space infinite, which motivates abstraction (Section 2.2, p. 35).

technique 1: hierarchy-preserving bit-vector and SMT encoding

what it is

Each state receives a bit-vector encoding organized by hierarchy depth. Composite-state prefixes and parallel-region segments are preserved, so a formula can represent both a parent and active descendants without flattening the statechart. The paper says: “The advantage of our encoding is that if the source or target of the transition is a composite state, it implicitly implies that any descendant state can also take the transition” (Section 3.1.2, p. 38).

how to do it

  1. Compute each state’s depth and the maximum local bit width at each hierarchy level (Section 3.1.2, pp. 37–38).
  2. For parallel regions, allocate disjoint bit segments and assign locally unique vectors; assign zero to initial states (Sections 3.1.1–3.1.2, pp. 37–38).
  3. Concatenate ancestor encodings with the state’s local encoding; fill unused positions with don’t-care X bits. Combine encodings for all active states bitwise (Section 3.1.2, p. 38).
  4. Map a bit vector to a first-order formula: 0 becomes a negated Boolean variable, 1 a positive variable, and X the true formula (Section 3.2, p. 38).
  5. Encode a transition at step i as the conjunction of source-state, target-state, trigger, guard, and action formulas. For a composite target, replace target X bits by zero so the transition selects each region’s initial state (Section 3.2, pp. 38–39).
  6. Disjoin all transition formulas and conjoin the initial configuration with k unfolded transition relations to obtain form(Sc,k), the k-step reachability formula (Section 3.2, p. 39).
  7. Give the formula to an SMT solver. Satisfiability yields a path and a model assignment reconstructs the state vectors, events, and variables; unsatisfiability rules out that bounded path (Section 2.2, p. 35).

verus form

Inference: Represent active-state hierarchy as ghost sets plus a spec fn encoding to bit vectors or tagged state IDs. Define formulas and transition relations in Verus specification functions, then prove lemmas that source/target hierarchy and parallel-region well-formedness are preserved. Use requires/ensures on transition functions and proof fns for k-step path reconstruction. Verus is not an SMT model checker for arbitrary first-order formulas; its SMT-backed proof obligations can check selected arithmetic/Boolean lemmas, but path enumeration, satisfiability models, and don’t-care vectors need an explicit ghost search or an external checked certificate.

evidence and limits

The encoding supports bounded model checking and full state-space exploration of the abstract model (Sections 3.2 and 6, pp. 39, 44). It currently restricts actions to assignments and event raising and does not support all statechart features, such as history indicators and richer event queues (Section 2.1, p. 33; Section 6, p. 44). Inference: A bit-vector abstraction can over-approximate behavior; a satisfiable abstract path requires concretization before it is a real counterexample.

technique 2: hierarchy and variable abstraction

what it is

The abstraction function has a state component hS and variable component hV. hS maps each state to itself or an ancestor; descendants of an abstracted composite state map to that same ancestor. hV marks variables visible or invisible. Invisible variables are replaced by fresh constants in guards and actions, releasing their constraints. The abstract system therefore over-approximates the concrete one. The paper defines CEGAR abstractions as “over-approximating the original system, i.e., they might introduce additional behavior” (Section 2.3, p. 35).

how to apply it

  1. Define error configurations either explicitly or by bounds on selected states/variables, such as x = 1 (Section 4.2, p. 40).
  2. Initialize a coarse state abstraction: keep top-level states and map deeper states to their ancestors. For generic abstraction, keep only variables appearing in the error bounds; for states-only abstraction, keep all variables visible (Section 4.2, pp. 40–41).
  3. Construct the abstract statechart by retaining mapped states, regions containing refined states, preserved hierarchy, initial states, visible variables, and mapped transitions (Section 4.1, pp. 39–40).
  4. Abstract an error set and run either SMT state exploration or bounded model checking on the abstract chart (Section 4.3, p. 41).
  5. If no abstract error is reachable, conclude the concrete chart is safe because every concrete path maps to an abstract path (Section 4.3, p. 41).

verus form

Inference: Model hS as a ghost map from concrete state IDs to ancestor IDs and hV as a visibility set. Prove a simulation lemma that each concrete transition maps to an abstract transition. Express error predicates over the abstraction and prove the contrapositive safety result: no abstract error implies no concrete error. Invisible variables should be represented by existentially hidden ghost values or unconstrained constants, with the abstraction relation explicit in requires; never silently drop a variable from a Verus proof.

technique 3: counterexample concretization and targeted refinement

what it is

An abstract error path may be spurious. The paper concretizes it incrementally with bounded checks, then refines only the hierarchy or variables responsible for failure. It states: “If concretization succeeds until the ith iteration, but fails in the (i + 1)th iteration, then ĉi is called a failure configuration and it is returned as a witness for the counterexample being spurious” (Section 4.4, p. 41).

how to apply it

  1. Given abstract path ĉ0 
 ĉn, search for a concrete prefix c0 
 ci whose abstraction equals every ĉj through i. Use bounded model checking with the known abstract configurations conjoined to each step (Section 4.4, p. 41).
  2. If the full path concretizes, return the concrete counterexample.
  3. If a prefix fails, mark its last successful abstract configuration as the failure configuration.
  4. Refine state hierarchy first: for each active abstract state in the failure configuration, expand one more level of descendants by setting hâ€ČS(s)=s when its parent-of-parent is active (Section 4.5, pp. 41–42).
  5. If active states are fully refined but a guard still cannot concretize, expose variables occurring in guards on outgoing transitions from those states (Section 4.5, p. 42).
  6. Repeat model checking, concretization, and refinement. The CEGAR loop terminates after finite state/variable refinements, although model checking can still fail to terminate with unbounded visible variables (Section 4.5, p. 43).

verus form

Inference: Represent a candidate abstract path as a ghost sequence and the abstraction relation as a predicate. Check each prefix with Verus lemmas that witness a concrete state and transition; a failed proof identifies the prefix needing refinement. Refine a ghost map or visibility set and re-run proof obligations. Use ensures to preserve the abstraction relation and proof fns for simulation; the refinement strategy is an inference because Verus has no built-in CEGAR loop.

technique 4: solver exploration strategies and bounded model checking

The implementation uses Z3 and compares four strategies: many-at-once without push/pop (MON), many-at-once with push/pop (MOP), one-at-once (OAO), and bounded model checking (BMC) (Section 5, Table 1, p. 42). OAO asks the solver about one reachable configuration at a time; MOP reuses a solver transition formula with push/pop; BMC unfolds k steps.

The industrially motivated case has 27 states (5 composite, 22 simple), 9 regions, 16 variables (13 Boolean, 3 integer), and 27 transitions (Section 5, p. 43). With signal-holder parameter 2, Table 2 reports: MON+STT timed out after two iterations and 8,610 configurations; MOP+STT took 1,398.63 seconds over five iterations and 17,036 maximum configurations; OAO+STT took 1,250.226 seconds; BMC+STT took 211.499 seconds; with generic abstraction, OAO took 8.942 seconds over 12 iterations and 1,484 configurations (Table 2, p. 43). These are one parameter setting and one benchmark, not a general performance denominator. The paper reports that generic abstraction improves every metric in this table, while BMC is least effective with generic abstraction but best when all variables are visible (Section 5, p. 43).

Inference: In Verus, BMC corresponds to proving a bounded ghost sequence with a finite k; OAO/MOP correspond to external search that emits proof certificates. Keep solver search outside the trusted Rust program and verify each returned path or invariant in Verus. The paper’s Z3 implementation and its encodings remain trusted components of the reported experiment.

what is proved, trusted, and reusable for VL

The paper proves the encoding’s correspondence to hierarchical statechart transitions, soundness of the over-approximating abstraction for safety, and termination of the refinement sequence under finite states and variables. The experiments measure runtime, CEGAR iterations, explored configurations, and bounded paths on one power-plant safety controller. The trusted boundary includes the statechart semantics, bit-vector/formula translation, Z3, and the assumption that invisible-variable replacement is a safe over-approximation. Inference: For agent-written verified Rust, the main threat is a wrong abstraction relation or missing event/guard behavior; a Verus proof of an abstract model cannot establish product safety unless the Rust implementation is linked to that model.

The paper already provides hierarchy-aware encoding, generic state/variable abstraction, concretization-guided refinement, and four SMT exploration strategies. Inference: VL should reuse these as model-level methods when verifying hierarchical controllers, rather than flattening statecharts and losing explanatory structure. The approach currently targets reachability and does not support the full statechart language; liveness or richer event queues need additional techniques (Sections 1 and 6, pp. 31, 44).

techniques for the catalog

  • hierarchy-preserving bit vectors — encode composite states, descendants, and parallel regions with prefix and segment bit vectors
  • SMT transition encoding — translate source, target, event, guard, action, and initial state into k-step first-order formulas
  • state and variable abstraction — hide descendants and variables while preserving an over-approximating abstract chart
  • counterexample concretization — constrain bounded search to an abstract path and locate the first impossible prefix
  • targeted CEGAR refinement — expand hierarchy at the failure state, then expose guard variables only when needed
  • solver strategy comparison — combine MON, MOP, OAO, and BMC with Z3 to explore abstract reachability Checked 2026-10-14: audit record czipo2017exploiting; paper-study comparison complete; gate executed; experiments not rerun

Last edited: