Causal Termination of Multi-threaded Programs

Andrey Kupriyanov, Bernd Finkbeiner

Introduction

Proving program termination—the guarantee that an execution will eventually finish—is a fundamental challenge in formal verification. While safety properties (e.g., "the program never crashes") are well-studied, termination is a liveness property that is notoriously difficult to verify, especially in multi-threaded environments. This paper introduces Arctor, a termination checker that achieves unprecedented scalability by shifting from traditional interleaving-based analysis to a novel "causal trace tableau" approach.

The Challenge of Concurrent Termination

Existing verification tools often struggle with the "state-space explosion" problem. In multi-threaded programs, the number of possible interleavings between threads grows exponentially with the number of threads. Most state-of-the-art tools rely on Ramsey-based approaches, which require analyzing the transitive closure of program transitions. This process becomes computationally prohibitive for more than 2 or 3 concurrent threads, leading to timeouts or memory exhaustion.

Methodology: Arctor and Causal Reasoning

Arctor addresses these limitations through Abstraction Refinement of Concurrent Temporal Orderings. Instead of global transition analysis, it leverages causal dependencies.

1. Modeling with Concurrent Traces

Arctor represents program executions using Mazurkiewicz-style traces. These capture partial orderings of events, focusing on essential causal dependencies rather than every possible sequence of events.

Producer-Consumer benchmark modeling: code and corresponding transition systems.

2. Causal Trace Tableaux

The tool employs a proof-by-contradiction strategy. It constructs a "causal trace tableau"—a tree structure starting from a root trace that assumes a non-terminating execution exists. Transformation rules are then applied to refine this hypothetical error path until a contradiction is found.

3. Modular Refinement

Arctor uses "Action Splits" and "Invariance Splits" to decompose the proof. It asks modular questions: Which thread might run forever? and What causal actions are necessary to sustain that execution? By using Craig interpolation, the tool discovers intermediate "necessary actions" that help close proof branches more efficiently.

Evaluation and Results

The authors evaluated Arctor against leading competitors like Terminator, T2, and AProVE across several benchmarks, including Producer-Consumer patterns and semaphore-guarded resources.

  • Scalability: While competitors failed at 3 threads on the Producer-Consumer benchmark, Arctor successfully verified programs with up to 100 threads in 172 seconds.
  • Efficiency: Arctor maintained a minimal memory footprint (e.g., ~6MB for 100 threads in the Phase benchmark) where other tools hit memory limits.
  • Robustness: It consistently outperformed existing tools in both speed and the ability to handle complex synchronization primitives.

Key Insights

  • Causality over Interleaving: Bypassing the exponential growth of state space by focusing on why events happen.
  • Conjunctive Reasoning: Breaking down massive disjunctive progress measures into smaller, manageable causal explanations.
  • Modular Proof Reuse: Termination arguments for individual threads can often be reused to simplify the broader verification task.

Conclusion and Future Work

Arctor represents a significant leap in the verification of concurrent programs. While currently optimized for linear arithmetic theories, future work aims to extend its causal refinement techniques to more complex data structures like heaps and linked lists, and to further explore the interplay between fairness constraints and causal proofs.

Summary updated

BibTeX
@inproceedings{kupriyanov2014causal,
  author = {Andrey Kupriyanov and Bernd Finkbeiner},
  title = {{Causal Termination of Multi-threaded Programs}},
  booktitle = {CAV},
  year = {2014},
  doi = {10.1007/978-3-319-08867-9\_54},
}
Figure