High-level Counterexamples for Probabilistic Automata

Ralf Wimmer, Nils Jansen, Erika Ábrahám, Joost-Pieter Katoen

Here is a blog-style summary of the research paper.

TL;DR

When a probabilistic model checker finds a bug, it typically spits out a massive, unreadable list of states or execution paths as a counterexample. This paper changes the game by generating high-level, human-readable counterexamples directly within the system's modeling language. By framing the challenge as a optimization problem solved via Mixed Integer Linear Programming (MILP), the authors isolate the absolute smallest subset of code commands responsible for a system failure.

What Problem Does This Paper Address?

Model checking is a powerful technique for automatically verifying that a system satisfies certain properties (e.g., "the probability of a network collision is less than 1%"). When a system violates a property, the model checker generates a counterexample to help engineers debug the issue.

For probabilistic systems, however, traditional counterexamples are notoriously difficult to interpret. Because failures often happen probabilistically across many different paths, standard tools return either a massive set of system runs or a huge chunk of the low-level state space. Humans cannot easily digest this.

Most probabilistic systems are written in high-level modeling formalisms, such as the guarded command language used by the popular model checker PRISM. The authors address this gap by shifting the focus from low-level state spaces back to the high-level source code, identifying exactly which lines of code are causing the violation.

Methods

The authors formalize this problem as finding the Smallest Critical Label Set (SCL). By assigning abstract "labels" to different elements of the system—such as specific commands, modules, or variable branches—they can minimize different aspects of the model description.

To find this minimal set, the authors map the system's behavior to a Mixed Integer Linear Programming (MILP) formulation. The objective function minimizes the total weight of the selected labels (representing code commands) while ensuring that the remaining system still violates the safety property.

To make this computationally feasible, they introduce several optimization constraints, or "cuts":

  • Scheduler cuts: Exclude invalid or deadlocking paths that don't contribute to the violation.
  • Label cuts: Force the solver to only consider labels that are actively triggered by the system's operational choices.
  • Synchronization cuts: Ensure that if a command requires multi-module synchronization, all participating commands are selected together.

Once the minimal set of commands is identified, the method further simplifies the counterexample by stripping away unnecessary command branches and shrinking variable domains.

An example of PRISM's guarded command language for a randomized shared coin protocol.

Datasets

The authors evaluated their approach using several classic benchmarks from the PRISM benchmark suite:

  • coin-N-K: A randomized consensus protocol (shared coin protocol) where processes perform a random walk based on coin flips.
  • wlan-B-C: The two-way handshake mechanism of the IEEE 802.11 Wireless LAN protocol.
  • csma-N-C: The IEEE 802.3 CSMA/CD network protocol for carrier-sense multiple access with collision detection.
  • fw-N: The Tree Identify Protocol of the IEEE 1394 High Performance Serial Bus (FireWire).

Key Insights and Ideas

  • Code as Labels: The core "aha!" moment is realizing that minimizing a counterexample doesn't require analyzing paths directly. By labeling transitions with the source code commands that generated them, the problem transforms from a graph-search nightmare into a code-minimization problem.
  • The Power of Redundant Constraints: In MILP solving, adding mathematically redundant constraints (like scheduler forward cuts) can drastically speed up computation. These cuts help the solver quickly establish tight lower bounds, allowing it to prune massive sections of the search tree early on.
  • Debugging via Elimination: By isolating a minimal critical command set, the tool guarantees that at least one of the returned commands must be altered to fix the bug. If a command is excluded from the counterexample, it means the bug manifests even if that line of code never runs.

Key Results

The authors implemented their tool in C++ using the commercial MILP solver Gurobi.

  • Significant Code Reduction: Across all benchmarks, the tool successfully isolated small, highly compact subsets of commands. For instance, in a broken version of the coin protocol, the tool correctly identified that the counter-incrementing commands were irrelevant to the bug, pointing the engineer directly to a faulty coin-flipping command.
  • Heuristic Efficiency: While proving absolute minimality is NP-complete and occasionally timed out the 10-minute limit on massive state spaces, the MILP solver was exceptionally fast at finding near-optimal or optimal command sets within the first few seconds.
  • Simplification Pipeline: The subsequent steps (branch minimization and variable domain reduction) ran significantly faster once the initial command selection narrowed down the system's complexity.

Limitations and Future Work

The primary limitation is scalability. Because the MILP formulation relies on variables mapped to the system's underlying state space, it remains susceptible to the "state space explosion" problem. For exceptionally large systems, the solver can time out before proving that a command set is the absolute smallest possible.

As a promising alternative to mitigate this, the authors briefly highlight recent work coupling a MAXSAT solver with a model checker. This alternative bypasses the need for explicit scheduler decision variables in the optimization loop, yielding massive speedups on several difficult benchmark instances.

Summary updated

Abstract

Providing compact and understandable counterexamples for violated system properties is an essential task in model checking. Existing works on counterexamples for probabilistic systems so far computed either a large set of system runs or a subset of the system's states, both of which are of limited use in manual debugging. Many probabilistic systems are described in a guarded command language like the one used by the popular model checker PRISM. In this paper we describe how a smallest possible subset of the commands can be identified which together make the system erroneous. We additionally show how the selected commands can be further simplified to obtain a well-understandable counterexample.
BibTeX
@inproceedings{wimmer2013high,
  author = {Ralf Wimmer and Nils Jansen and Erika Ábrahám and Joost-Pieter Katoen},
  title = {{High-level Counterexamples for Probabilistic Automata}},
  booktitle = {QEST},
  year = {2013},
  doi = {10.1007/978-3-642-40196-1\_4},
}
Figure