Introduction
Verifying concurrent software is a monumental challenge due to the astronomical number of possible thread interleavings. Traditional Bounded Model Checking (BMC) translates programs into logic formulas for SAT/SMT solvers. However, modeling every possible memory access order to ensure a "read" operation obtains the correct value from a "write" operation leads to a "cubic explosion" in formula size. This complexity often causes solvers to time out or exhaust memory on real-world programs.
The Yogar-CBMC Approach
To address this, the authors of the paper introduced Yogar-CBMC, a tool that employs a "lazy" scheduling constraint refinement strategy. Instead of constructing a complete, complex formula upfront, the tool starts with a simplified abstraction and adds only the essential constraints as needed.
The Refinement Workflow
The core of the method is an iterative loop that balances speed and precision. As shown in Figure 1, the process begins with an initial abstraction that ignores scheduling constraints.
- Initial Abstraction: A simplified model is checked. If it is "safe," the original program is also safe.
- Validation: If a potential bug (counterexample) is found, the tool must determine if it is a real bug or a "ghost" of the abstraction.
- Graph-Based Validation: The tool maps execution events into an Event Order Graph (EOG). If the graph contains a cycle, the counterexample is infeasible.
- Refinement: If infeasible, the tool identifies the "Kernel Reason"—the minimal set of constraints causing the contradiction—and adds its negation back into the model.
Event Order Graph (EOG)
The EOG is a critical component for fast validation. By representing memory accesses and their dependencies as nodes and edges, the tool can use graph theory to detect impossible execution paths much faster than a general-purpose solver.
While graph-based checking is highly efficient, it is not always complete. Yogar-CBMC includes a hybrid validation mechanism that falls back to a traditional constraint solver if the graph method is inconclusive, ensuring mathematical soundness.
Key Results and Impact
The effectiveness of Yogar-CBMC was demonstrated in the SV-COMP 2017 competition, where it won the gold medal in the concurrency track. Evaluating the tool on 1,047 multi-threaded C programs revealed significant performance gains:
- Efficiency: Logic formulas were reduced to an average of 1/8th of their original size.
- Speed: Yogar-CBMC completed the benchmark suite in 1,550 seconds, nearly 6.3x faster than the runner-up tool, Lazy-CSeq-Abs (9,820 seconds).
- Resource Usage: It required significantly less memory (43 GB vs. 104 GB for the runner-up).
- Scalability: In complex cases, Yogar-CBMC outperformed standard CBMC by up to 35.8x.
Conclusion
Yogar-CBMC proves that most scheduling constraints in concurrent programs are irrelevant to the presence of specific bugs. By identifying and adding only "essential" constraints through graph-based refinement, the tool achieves state-of-the-art performance. Future work aims to extend this methodology to handle weak memory models (like TSO and PSO) found in modern hardware architectures.
Summary updated