Causality-based Model Checking

Bernd Finkbeiner, Andrey Kupriyanov

Abstract

Traditional model checking for concurrent programs is hindered by the state space explosion problem, where the number of possible system states grows exponentially with the number of threads. This paper introduces a causality-based model checking framework that replaces exhaustive state-space traversal with the analysis of cause-and-effect relationships between events. By utilizing concurrent traces and formal trace transformers, the approach reduces verification complexity from exponential to polynomial for significant classes of multi-threaded programs. The implementation in the ARCTOR tool demonstrates scalability up to 100 threads, significantly outperforming state-of-the-art provers.

Introduction

The verification of concurrent software is a critical challenge in formal methods. While model checking provides an automated path to correctness, the interleaving of independent events in parallel threads leads to a combinatorial explosion of the state space. Humans, however, often verify such systems using localized causal arguments—reasoning that certain events must precede others due to data or control dependencies. This paper formalizes this human-like causal reasoning into an automated framework that tracks causal dependencies rather than global snapshots.

Methodology: Concurrent Traces and Transformers

The core of the proposed framework is the concurrent trace, a data structure that captures a history of relevant system events linked by causal ordering and conflict relations. Unlike a traditional "state," which represents a single point in time across all threads, a concurrent trace represents a partially ordered set of events.

A concurrent trace representing causal dependencies and conflicts between events.

Trace Transformers

Verification proceeds by assuming a property violation exists and representing it as an initial, hypothetical concurrent trace. The algorithm then applies trace transformers—formal proof rules that deduce necessary consequences. For instance, if a conflict exists between two events, a transformer may deduce that a specific bridging event must have occurred, or it may split the analysis into different chronological orderings.

Tableau Construction

These transformers are used to build an Abstract Trace Tableau. This graph structure branches out different causal explanations for the hypothesized error. If every branch eventually leads to a logical contradiction (e.g., an event causing itself), the program is proven safe. For liveness properties and infinite loops, the framework uses trace unwinding to identify recurring patterns.

Trace unwinding rules for handling infinite loops and liveness properties.

Key Insights

  1. Independence Exploitation: Most events in concurrent systems are independent. By focusing on causal links, the framework ignores redundant interleavings, drastically reducing the search space.
  2. Complexity Reduction: For multi-threaded programs employing standard locking mechanisms, this approach can reduce verification complexity from exponential to polynomial.
  3. Constant-Size Proofs: In specific benchmarks like the Esparza/Heljanko system, the framework can verify safety with a fixed-size trace unwinding regardless of the number of processes, whereas traditional tools face exponential state growth.

Experimental Results

The authors evaluated the ARCTOR tool against leading termination provers (Terminator, T2, AProVE) using a Producer-Consumer benchmark modeled after Map-Reduce architectures.

While standard tools failed at 3 to 5 threads due to memory exhaustion or timeouts, ARCTOR successfully verified the 100-thread instance in 172 seconds, generating approximately 10,350 vertices and using only 231 MB of memory. For smaller instances (e.g., 4 threads), ARCTOR took 0.003 seconds, whereas competitors took over a minute or failed entirely.

Conclusion

Causality-based model checking offers a scalable alternative to state-based verification for concurrent systems. By leveraging the inherent sparsity of causal dependencies, the ARCTOR tool demonstrates that even highly parallel programs can be verified efficiently. Future work includes expanding the library of trace transformers to support more complex synchronization primitives and domain-specific properties.

Summary updated

BibTeX
@inproceedings{finkbeiner2017causality,
  author = {Bernd Finkbeiner and Andrey Kupriyanov},
  title = {{Causality-based Model Checking}},
  booktitle = {CREST},
  year = {2017},
  url = {https://openreview.net/forum?id=g5hQyIsyK8},
}
Figure