NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Counterexample-Guided Prophecy for Model Checking Modulo the Theory of Arrays

Makai Mann, Ahmed Irfan, Alberto Griggio, Oded Padon, Clark W. Barrett

Abstract

We develop a framework for model checking infinite-state systems by automatically augmenting them with auxiliary variables, enabling quantifier-free induction proofs for systems that would otherwise require quantified invariants. We combine this mechanism with a counterexample-guided abstraction refinement scheme for the theory of arrays. Our framework can thus, in many cases, reduce inductive reasoning with quantifiers and arrays to quantifier-free and array-free reasoning. We evaluate the approach on a wide set of benchmarks from the literature. The results show that our implementation often outperforms state-of-the-art tools, demonstrating its practical potential.

Introduction

Model checking infinite-state systems, particularly those involving unbounded integers or arrays, remains a significant challenge in formal verification. To prove properties across all possible executions, automated tools must often discover universally quantified invariants—for example, asserting that every element in an array satisfies a specific condition. While automated reasoning tools like Satisfiability Modulo Theories (SMT) solvers have improved, reasoning with quantifiers remains computationally expensive and fragile.

This paper introduces counterexample-guided prophecy, a novel technique that automatically augments systems with auxiliary variables to simplify verification. By strategically introducing "prophecy variables" during an abstraction-refinement loop, the authors transform complex problems requiring quantified invariants into simpler, quantifier-free problems that modern model checkers can solve more efficiently.

Methodology: STS-CEGAR and Prophecize

The proposed framework, STS-CEGAR (Symbolic Transition System - Counterexample-Guided Abstraction Refinement), enhances traditional verification loops with a new algorithm called Prophecize.

  1. Initial Abstraction: The process begins by "breaking" arrays, replacing them with uninterpreted functions and sorts. This creates a "memoryless" version of the system that is easier to check but may produce "spurious" counterexamples—error traces that are impossible in the concrete system.
  2. Refinement Loop: When a counterexample is found, the Refine-Arrays algorithm checks for violations of standard array axioms (e.g., the read-over-write axiom).
  3. Prophecy Introduction: If a violation involves indices from non-consecutive time steps, the tool invokes Prophecize. This algorithm introduces history variables to track values from previous states and prophecy variables to "predict" values that will become relevant in future states.

These variables "lift" non-consecutive array axioms into consecutive ones, allowing the model checker to reason about them using standard, quantifier-free induction. Effectively, a prophecy variable acts as a "frozen" value representing a universal quantifier; if a property holds for a prophecy variable that could have represented any index, it holds for all indices.

Experimental Evaluation

The authors implemented their approach in a tool called prophic3 and evaluated it against four benchmark sets known for requiring quantified reasoning over arrays:

  • freqhorn: Benchmarks from the FreqHorn synthesis tool.
  • quic3: Modified C programs from the SV-COMP competition.
  • vizel: A collection of challenging array benchmarks.
  • chc-comp-2020: The array category from the 2020 Constrained Horn Clause competition.

Key Results and Insights

The evaluation demonstrated that prophic3 is highly effective compared to state-of-the-art solvers like gspacer and quic3:

  • Superior Performance: prophic3 solved more benchmarks in the freqhorn, quic3, and vizel sets than any other tool.
  • Targeted Refinement: On benchmarks requiring quantifiers, the tool introduced a median of only one prophecy variable. This suggests that the counterexample-guided selection is highly precise, avoiding the state explosion often associated with auxiliary variables.
  • Abstraction Strategy: The paper finds that "Weak Abstraction" (using uninterpreted predicates instead of full equality) often yields better results by providing more opportunities for the refinement loop to identify useful prophecy variables.

Conclusion

Counterexample-guided prophecy successfully reduces problems traditionally requiring complex quantified invariants to problems solvable with quantifier-free logic. While the authors acknowledge limitations—such as potential non-termination in systems requiring an infinite number of prophecy variables and sensitivity to initial code encoding—the results demonstrate significant practical potential. Future work includes tighter integration with underlying model checkers and extending the technique to other theories like bit-vectors or strings.

Summary updated

BibTeX
@inproceedings{mann2021counterexample,
  author = {Makai Mann and Ahmed Irfan and Alberto Griggio and Oded Padon and Clark W. Barrett},
  title = {{Counterexample-Guided Prophecy for Model Checking Modulo the Theory of Arrays}},
  booktitle = {TACAS},
  year = {2021},
  url = {https://openreview.net/forum?id=gZLo54py5tP2},
}
Figure