Abstract
Satisfiability Modulo Theories (SMT) solvers are foundational components in the formal verification of safety-critical systems. However, their internal complexity poses a risk of implementation errors. This paper presents a novel, modular proof-production architecture for cvc5, an industrial-strength SMT solver. By integrating a flexible system that supports both eager and lazy proof generation, cvc5 can now produce detailed, machine-checkable justifications for its results—including complex preprocessing and string solving—while maintaining competitive performance.
Introduction
SMT solvers serve as the underlying engines for verifying the correctness of software and hardware. Given their role in safety-critical domains, the reliability of these solvers is paramount. A single bug could lead a solver to incorrectly declare a formula "unsatisfiable," potentially masking a critical vulnerability. To establish trust, solvers must provide a proof: a step-by-step justification that can be independently verified. Historically, generating such proofs has been difficult, often requiring solvers to sacrifice performance or produce "coarse-grained" proofs that are nearly as hard to verify as the original problem.
Methods: A Modular Architecture
The authors introduce a flexible architecture in cvc5 that mirrors the standard CDCL(T) solving process while adding a dedicated modular proof layer. This design allows different components of the solver to contribute proof fragments independently.
Key Components
- Modular Proof Production: Each solver component—the pre-processor, the SAT engine, and individual theory solvers (e.g., Arithmetic, Strings)—is responsible for generating its own proof fragments.
- The
sr(Substitution/Rewriting) Rule: A novel, coarse-grained rule tracks complex formula transformations. This allows the solver to maintain speed during the search phase while recording sufficient metadata for later reconstruction. - Lazy Reconstruction: To minimize overhead, cvc5 employs "term-conversion generators." These expand high-level justifications (like the
srrule) into fine-grained, low-level steps only when a full proof is explicitly requested. - Internal Proof Calculus: The system utilizes an internal language consisting of 155 rules, supported by a built-in checker to ensure mathematical soundness during development.
Key Insights
A central innovation is the decoupling of search from justification. By allowing "lazy" reconstruction, the solver can utilize its most efficient algorithms without the constant burden of recording every micro-step. Furthermore, the architecture pragmatically handles "trusted steps"—marked "holes" in a proof—allowing for incremental support of new theories. cvc5 also achieves a milestone by providing first-class proofs for the theory of strings, a notoriously difficult area due to operations like regular expression matching.
Evaluation and Results
The implementation was evaluated using 162,060 unsatisfiable problems from the SMT-LIB library, categorized into Bit-Vector (BV) and non-BV sets.
- Performance Overhead: The slowdown for producing proofs was approximately 1.7x to 1.8x for non-BV logics. For Bit-Vectors, which require intensive "bit-blasting," the overhead ranged from 2.6x to 3.9x.
- Proof Coverage: 92% of Bit-Vector proofs and 80% of non-Bit-Vector proofs were "fully fine-grained," meaning they contained no trusted steps. Notably, 100% of string problems without length constraints resulted in fully fine-grained proofs.
Limitations and Future Work
While cvc5 has made significant strides, some theories—such as floating-point arithmetic, sequences, and sets—do not yet support proof production. Additionally, the use of external SAT solvers currently results in proof "holes" as their outputs are not yet integrated into cvc5's internal calculus. Future work includes developing a Domain Specific Language (DSL) for rewrite rules and expanding "back-ends" to export proofs to formats compatible with Lean 4, Coq, and Isabelle/HOL.
Summary updated