Introduction
Satisfiability Modulo Theories (SMT) solvers are fundamental tools in formal verification, software analysis, and automated theorem proving. While these solvers excel at reasoning over ground (quantifier-free) logic, such as linear arithmetic or bit-vectors, they face significant challenges when encountering universal ($\forall$) and existential ($\exists$) quantifiers.
To reason about quantified formulas, solvers typically rely on instantiation: a process where general rules are replaced by specific, concrete instances relevant to the current proof. However, this process is plagued by a combinatorial explosion. Generating too many instances—many of which may be irrelevant—overwhelms the solver's internal engines, while generating too few may prevent the solver from ever finding a proof. Traditionally, solvers have relied on hand-crafted heuristics to navigate this trade-off. This paper presents a novel approach by integrating machine learning (ML) directly into the cvc5 solver to automate and optimize quantifier selection.
Methodology: The ML-Guided Solver
The researchers integrated a machine learning "quantifier selector" into the core loop of cvc5. The primary goal was to predict which quantified formulas are most likely to lead to a successful proof, thereby filtering out the "noise" of irrelevant instantiations.
Model Selection and Efficiency
Because the quantifier selector is invoked frequently during the solver's execution, low latency is critical. The authors chose LightGBM, an implementation of Gradient Boosted Decision Trees (GBDTs). Unlike deep neural networks, GBDTs offer high inference speed and a small memory footprint, making them suitable for the tight feedback loops of an SMT solver.
Feature Engineering for Logic
To translate complex logical formulas into a format suitable for machine learning, the authors employed several structural encoding techniques:
- Bag-of-Words: Simple frequency counts of logical symbols and operators.
- Path Features: A sophisticated method that captures the "geometry" of a formula by encoding vertical paths and horizontal slices of its syntax tree. This allows the model to recognize how symbols are nested and related.
- Hashing: Using the
sdbmhash function, these structural features were mapped into fixed-length vectors, ensuring the model remains efficient regardless of formula complexity.
Probabilistic Filtering
To avoid the risk of "irrecoverable mistakes"—where the model might discard a formula essential to the proof—the system uses probabilistic filtering. Instead of a binary yes/no decision, the model’s output score is treated as a probability. This ensures that even formulas with low predicted utility have a non-zero chance of being instantiated, maintaining the solver's robustness.
Experimental Setup and Datasets
The models were trained and evaluated on two large-scale formal verification corpora:
- Mizar Mathematical Library (MPTP): A collection of over 50,000 problems translated from the Mizar project.
- HOL4 Standard Library (GRUNGE): A dataset containing over 12,000 theorem-proving problems.
These datasets provide a rich environment for ML because they contain many "similar" problems, allowing the model to learn domain-specific patterns of successful quantifier usage.
Key Insights
Quantifier-Level vs. Term-Level Selection
Previous attempts at using ML in SMT solvers often focused on selecting specific terms for instantiation. The authors found this to be a noisy and difficult task. By shifting the focus to selecting the quantified formula itself, they simplified the learning objective, leading to more stable and effective performance gains.
Structural Geometry
The inclusion of "path features" provided a consistent 2% performance increase over simple symbol counts. This suggests that the structural arrangement of a formula—its internal nesting and shape—is a powerful signal for its relevance in a proof.
Cross-Strategy Transfer
Interestingly, models trained on one solver strategy (such as e-matching) often improved the performance of other, different strategies. This indicates that the ML model is learning fundamental logical properties of the mathematical problems rather than merely overfitting to the quirks of a specific solver configuration.
Results and Performance
The ML-enhanced version of cvc5 demonstrated substantial improvements over the state-of-the-art baseline:
- Mizar Performance: A 22.46% increase in the number of problems solved.
- GRUNGE Performance: A 12.86% improvement on the HOL4 dataset.
- New Proofs: The system successfully solved 692 "hard" problems in the Mizar library that had never been solved by cvc5 before.
Crucially, these gains were achieved within standard time limits (60 seconds per problem). Despite the computational overhead of running the ML model, the increased efficiency of the guided proof search more than compensated for the inference time.
Limitations and Future Work
The current approach relies on the availability of a large corpus of similar problems for training. While highly effective for large mathematical libraries, it may be less effective for diverse, isolated benchmarks like those found in the SMT-LIB competition.
Future research directions include exploring "multi-armed bandit" frameworks to enable on-the-fly learning during a single problem run, reducing the reliance on offline training. Additionally, the authors suggest that stricter formula normalization could further enhance the model's ability to identify equivalent logical structures across different problems.
Summary updated