Abstract
Bit-vector formulas arising from hardware verification problems often contain word-level arithmetic operations. Empirical evidence shows that state-of-the-art SMT solvers are not very efficient at reasoning about bit-vector formulas with multiplication. This is particularly true when multiplication operators are decomposed and represented in alternative ways in the formula. We present a pre-processing heuristic that identifies certain types of decomposed multipliers, and adds special assertions to the input formula encoding the equivalence of sub-terms to word-level multiplication. The pre-processed formulas are then solved using an SMT solver. Our experiments with three SMT solvers show that our heuristic allows several formulas to be solved quickly, while the same formulas time out without the pre-processing step.
Introduction
In hardware verification, engineers rely on Satisfiability Modulo Theories (SMT) solvers to validate designs. While solvers like Z3, CVC4, and Boolector excel at many tasks, multiplication remains a significant bottleneck. This is especially true when a high-level multiplication operation (e.g., a * b) is implemented as a complex web of partial products and adders—a process known as decomposed multiplication.
When solvers encounter these decomposed structures, they often fail to recognize the underlying arithmetic. Instead, they resort to "bit-blasting," converting the problem into a massive sea of Boolean gates. This leads to a dramatic blowup in runtime, causing even simple 32-bit checks to hang indefinitely. The core challenge lies in the ambiguity of bit-level representations; the same set of partial products can sometimes represent different multiplications, making direct rewriting risky.
Methods
The proposed solution is a non-intrusive pre-processing heuristic that identifies "hidden" multipliers through pattern detection. Rather than risky rewriting, the tool adds "tautological hints" to the formula. This allows the solver to perform word-level reasoning while keeping the original structure intact for other potential simplifications.
Pattern Matching Algorithms
The authors developed two primary algorithms to detect common hardware multiplication implementations:
- MatchLong: This algorithm identifies structures resembling "long multiplication," the shift-and-add method. It looks for the systematic generation and summation of partial products.
- MatchWallaceTree: This algorithm identifies Wallace-tree structures, which use a cascade of full and half adders to sum partial products rapidly.
Tautological Assertions
Once a pattern is matched, the tool adds an assertion to the solver: Assertion: (decomposed_structure == original_multiplication_term). These assertions act as a bridge, allowing the solver to use high-level multiplication properties for reasoning. Even if the solver eventually bit-blasts the formula, these tautologies help the underlying SAT solver prune its search space significantly, leading to fewer conflicts and faster decisions.
Results and Evaluation
The approach was evaluated on 20 benchmarks from real-world hardware verification, including Word-level Symbolic Trajectory Evaluation (WSTE) and Bounded Model Checking (WBMC). The test set included a pipelined serial multiplier that originally caused all major solvers to time out after 24 hours.
The performance gains were substantial:
- Overcoming Timeouts: Benchmarks that previously timed out after 24 hours on Z3, CVC4, and Boolector were solved in as little as 0.017s (CVC4) and 0.073s (Z3) after pre-processing.
- Consistency: For long multiplication benchmarks, the pre-processed configuration (using CVC4 as a backend) consistently solved instances in ~0.01s, whereas standard solvers frequently hit the 3600s timeout.
- Wallace-Tree Success: Z3 showed the most improvement for Wallace-tree multipliers, solving 16-bit instances in under 3 seconds that previously caused timeouts.
Conclusion and Future Work
While highly effective for long multiplication and Wallace-trees, the current heuristic has limitations. It is syntactically sensitive and does not yet support Booth multipliers or complex constant-based optimizations (which often use bit-shifting). Future work aims to extend support to Booth multipliers and integrate formal proof generation to verify the added tautologies within the solver's internal logic.
Summary updated