Introduction
Satisfiability Modulo Theories (SMT) solvers are critical tools in software verification and formal methods. However, they frequently encounter difficulties when dealing with quantifiers (e.g., $\forall x . f(x) > x$) in infinite domains, such as integers. This "Work in Progress" paper by researchers at the Czech Technical University in Prague proposes a novel semantic approach to this problem. By learning piecewise linear functions to represent candidate models, the authors aim to prevent the "divergence" often seen in traditional solvers.
The Challenge of Quantifiers and Infinite Domains
The standard technique for handling quantifiers is Model-Based Quantifier Instantiation (MBQI). MBQI attempts to find a "model"—an interpretation of functions—that satisfies the given formula. If a candidate model fails a check, the solver refines it with new constraints and tries again.
The primary bottleneck is the construction of these candidate models. Most solvers rely on syntactic heuristics, looking at the formula's structure to guess a model. In infinite domains, this often leads to infinite loops where the solver keeps adding specific point constraints without ever identifying the underlying general pattern (e.g., $f(x) = x + 1$).
Semantic Learning Approach
The authors shift from syntactic guessing to semantic learning. They treat model building as a machine learning task: given a set of input-output points $(a, v)$ discovered by the solver, can we synthesize a function that fits them perfectly?
Greedy Function Construction
Algorithm 1 focuses on fitting points into linear hyperplanes. It utilizes linear Diophantine equation solvers to determine if a set of points can be represented by a single linear segment. If a perfect fit isn't possible, the algorithm uses "If-Then-Else" (ITE) constructs to split the domain and start new segments.
Recursive Predicate Splitting
Algorithm 2 is designed for predicates (functions returning True/False). It operates similarly to a decision tree but uses hyperplanes rather than single-variable splits to separate "True" points from "False" points. This process uses "information gain" to optimize the location of the cuts.
Crucially, this approach is purely semantic, ignoring the formula's text and focusing solely on the values discovered during the solving process.
Key Insights
- Perfect Fit Requirement: Unlike traditional ML, SMT models must match ground points exactly, requiring exact solvers like Diophantine equation solvers instead of gradient descent.
- The "No Harm" Principle: The learning approach does not degrade performance on unsatisfiable (UNSAT) problems, making it a safe addition to existing solver toolkits.
- Piecewise Linear Expressivity: Linear functions, when combined with ITE blocks, provide a "sweet spot" of simplicity and expressivity for representing complex infinite models.
Experimental Results
The researchers evaluated their implementation in the cvc5 solver using a massive dataset of nearly 70,000 satisfiable problems. The results were significant:
- Standard MBQI: 18,843 problems solved.
- "Smart" Learning MBQI: 31,977 problems solved.
- Z3 (Industry Standard): 28,380 problems solved.
The semantic learning approach allowed cvc5 to solve nearly 70% more SAT problems than its default version, outperforming the widely-used Z3 solver on this benchmark.
Conclusion and Future Work
While promising, this work is ongoing. Future directions include extending support beyond integers to other types like Reals or Bit-vectors, and exploring "cross-talk" between functions during the learning process to create more cohesive models.
Summary updated