← Ongoing work

In progress

Circus Model Checking & Refinement

Model checking and refinement verification for Circus, the state-rich process algebra combining Z and CSP.

State of the art & contributions

Circus unifies the state-based specification language Z with the process algebra CSP, so a single model captures both data and concurrency. Model checking such state-rich specifications is harder than checking either formalism alone: the state part must be reasoned about symbolically while the process part explores behaviour.

This work contributes a route from Circus specification to verified refinement that links the two worlds:

The combination of state-based modelling with process-algebraic refinement — and replaying proofs alongside the checks — is the focus of the research.

Architecture

The tool is a three-part pipeline:

  1. Haskell frontend — reads LaTeX Circus specifications, converts the markup to Unicode, lexes and parses into a concrete syntax tree, runs the syntactic transformations, then type-checks the specification and applies the semantic transformation.
  2. Serialized AST — the type-checked tree is emitted as text. This textual contract is the only interface between the two halves, so each side can be developed and tested independently.
  3. C++/Z3 checker — re-parses the serialized tree, translates state and actions into Z3 terms (sets as Boolean arrays, relations as store chains, free types as enumeration sorts), and provides explicit-state model checking, animation, and trace / failures-divergences refinement.

Architecture of the Circus toolchain: Haskell frontend, serialized AST, then C++/Z3 checker.

What it can do

The current case study verifies the stepwise Fire Control System refinement chain from Oliveira’s PhD thesis.

How to use it

The frontend and checker are driven from the command line:

ParseCircus spec.tex -s 0x20   # parse, type-check and print the type-checked tree
circusmc --modelcheck …        # model checking (deadlock, invariant, divergence)
circusmc --refine spec impl …  # trace / failures-divergences refinement
circusmc --animate …           # step through executions

The refinement mode is the central verification question: does an implementation refine a specification in the traces and failures-divergences models?