Abstract
Satisfiability Modulo Theories (SMT) solvers are critical for hardware and software verification, yet they often struggle with quantified bit-vector formulas. This paper presents a novel technique for solving such formulas by computing symbolic inverses of bit-vector operators. By leveraging Syntax-Guided Synthesis (SyGuS), the authors automatically discover "invertibility conditions"—the necessary and sufficient conditions for a bit-vector equation to have a solution. Integrated into the CVC4 solver, this approach significantly improves the efficiency of quantifier instantiation, outperforming state-of-the-art solvers on standard benchmarks.
Introduction
Modern verification tasks frequently involve reasoning about bit-vectors, the fundamental data type in low-level software and hardware. While SMT solvers excel at quantifier-free bit-vector logic, quantified formulas (e.g., $\forall x. \exists y. P(x, y)$) remain a significant challenge. Traditional methods rely on heuristic instantiation, which often fails to find the specific values needed to prove unsatisfiability in the vast search space of bit-vector values. This paper aims to replace heuristic "guessing" with symbolic "calculation" by deriving terms guaranteed to be useful for instantiation.
Methodology: Symbolic Inversion and SyGuS
The core innovation of this work is the use of invertibility conditions. For a bit-vector constraint $x \diamond s \bowtie t$, where $x$ is a variable and $s, t$ are terms, an invertibility condition is a quantifier-free formula $C(s, t)$ such that $\exists x. (x \diamond s \bowtie t) \iff C(s, t)$. For example, while $x + s \approx t$ is always solvable ($x = t - s$), a constraint like $x \cdot s \approx t$ is only solvable if specific bit-level conditions on $s$ and $t$ are met.
Syntax-Guided Synthesis (SyGuS)
Rather than manually deriving these conditions for every operator (like bitwise AND, shifts, or division), the authors employed SyGuS. They defined a grammar of bit-vector operators and tasked a synthesis engine with finding Boolean functions that satisfy the equivalence. This automated approach discovered conditions that are often more compact and efficient than those manually derived by experts. As part of this effort, the authors created and made public 162 new challenge problems for SyGuS solvers.
Quantifier Instantiation with Hilbert Choice
To apply these conditions, the solver uses Hilbert’s choice operator ($\epsilon$). When a solver encounters a quantified formula, it can represent a satisfying value for $x$ as a symbolic term $\epsilon x. (x \diamond s \bowtie t)$. If the invertibility condition $C(s, t)$ holds, this term is a valid witness. This allows for symbolic instantiation, where the solver plugs in a formula instead of a concrete number, drastically reducing the number of iterations required to find a contradiction.
Evaluation and Results
The technique was implemented in the CVC4 SMT solver and evaluated against the SMT-LIB benchmark suite, comprising 5,151 problems in the quantified bit-vector category.
- Performance Boost: The new solver configuration (
cegqi_b) solved 335 more benchmarks than the base version of CVC4. - State-of-the-Art Comparison: CVC4 with this technique outperformed leading solvers like Z3 and Boolector on unsatisfiable benchmarks, solving 4,399 "unsat" problems compared to Z3's 4,362 and Boolector's 4,332.
- Verification: The synthesized conditions were verified for correctness across bit-widths from 1 to 65 using multiple solvers, with 12,277 (94.6%) of the conditions successfully verified.
Limitations and Future Work
While highly effective for "unit linear" constraints where the variable appears once, the method faces challenges with non-linear occurrences (e.g., $x \cdot x \approx t$). Additionally, the current approach solves for one literal at a time; future work will explore solving for variables constrained by multiple simultaneous literals (e.g., $x > a \land x < b$). The authors also suggest using interactive theorem provers like Coq to formally prove these conditions for all possible bit-widths.
Summary updated