Abstract
Traditional automated theorem provers often struggle with the complexities of real-world C programming, such as bitwise operations, pointer arithmetic, and unions. This paper introduces COGENT, a theorem prover designed to bridge the gap between abstract mathematical logic and machine-level execution. By eagerly translating C expressions into propositional logic (SAT) and modeling variables as finite bit-vectors, COGENT achieves high accuracy in software verification. Experimental results within the SLAM framework demonstrate that COGENT significantly reduces timeouts and identifies bugs that traditional provers miss.
Introduction
Most automated theorem provers, such as Simplify or Zapato, are optimized for "clean" mathematical theories like linear arithmetic over unbounded integers. However, real-world C programs are rarely that clean. They rely on fixed-width bit-vectors, pointers, structures, and unions—features that do not map cleanly to traditional logic.
When verification tools force C code into these traditional provers, they often rely on imprecise axioms. This leads to three major issues: false positives (reporting non-existent bugs), false negatives (missing real bugs due to poor modeling of overflows or pointers), and a lack of concrete counterexamples that explain why a property failed.
The COGENT Approach
COGENT abandons traditional combination frameworks in favor of a "bit-blasting" approach. Key features include:
- Eager Translation: COGENT immediately translates ANSI-C expressions into propositional logic (SAT) rather than abstracting them into higher-level theories.
- Machine-Level Accuracy: By modeling variables as finite bit-vectors, it accurately reasons about arithmetic overflow and bitwise operations.
- Full C Support: It provides native support for complex C constructs, including pointer arithmetic and unions.
- SAT-Based Counterexamples: Because the engine is based on SAT, any disproof of a property automatically generates a model that can be converted back into concrete C variable values, aiding debugging.
Experimental Evaluation
The authors integrated COGENT into existing verification frameworks, most notably the SLAM engine, and tested it against 308 device driver correctness benchmarks. They also compared COGENT against the Zapato prover using 2,000 individual theorem-proving queries and verification conditions from the BOOGIE static checker for C#.
Results and Impact
The evaluation revealed that accuracy acts as a performance multiplier. While COGENT is approximately 2.5x slower than Zapato on a per-query basis, its superior accuracy allows the overall verification tool (SLAM) to perform significantly less work.
As shown in the results above, the integration of COGENT into SLAM led to a dramatic reduction in timeouts—from 39 down to 17. Furthermore, the number of properties successfully verified (Property Passes) increased from 243 to 264. Most importantly, COGENT identified two additional real-world device driver bugs that were previously missed by tools using traditional provers.
Conclusion
COGENT demonstrates that modern SAT solvers are now powerful enough to handle the massive propositional formulas generated by eager bit-accurate encoding. By prioritizing machine-level accuracy over mathematical abstraction, COGENT provides a more robust foundation for verifying low-level software. Future work will focus on optimizing the raw translation speed and further refining the handling of quantifiers in complex verification conditions.
Summary updated