Abstract
Constraint solving creates a serious performance bottleneck in symbolic execution. Examining a plethora of SMT solvers with diverse capabilities, we address the following research questions: How can the performance of symbolic execution improve if it can pick a priori the best solver for a given path constraint? How can such a prediction oracle be practically implemented? In this work, we first define the solver selection problem in symbolic execution and its evaluation metrics, and perform a preliminary study to gauge potential performance improvement through solver selection. We then present the design and implementation of Path Constraint Classifier (PCC), a machine learning based meta-solver that aims to reduce overall constraint solving latency by dynamically selecting a solver per query. Using machine learning seems straightforward, yet surprisingly underexplored; one main technical challenge is how to avoid excessive overhead introduced by feature extraction. We address this challenge by taking advantage of the structural characteristics of symbolic execution. Our experiments confirm that the overall solver time can be reduced by 10.3% in the KLEE dataset and 46% in the benchmark dataset, while the solver prediction procedure only accounts for 2% to 10% of overall solving time.
Introduction
Symbolic execution (SE) is a powerful technique for software verification, yet it is frequently hampered by the computational cost of constraint solving. SMT solvers often consume the vast majority of execution time—up to 99% in some cases. While many solvers exist, their performance varies significantly depending on the specific logic and structure of the path constraints. Portfolio approaches, which run multiple solvers in parallel, are resource-intensive. This research proposes a more efficient alternative: using machine learning to predict the optimal solver for a given constraint before execution.
The Path Constraint Classifier (PCC)
The Path Constraint Classifier (PCC) is a meta-solver designed to dynamically select the best SMT solver per query. The system architecture consists of three core components: a Feature Extractor, a Classification Module, and a Solver Interaction Interface.
Feature Extraction and Caching
A primary obstacle to ML-based solver selection is the overhead of feature extraction. PCC overcomes this by exploiting the incremental nature of symbolic execution. Since new constraints often share significant structural overlap with previous ones, PCC utilizes a Constraint Feature Cache Table (CFCT). By employing hash-consing to cache features of syntax sub-trees, PCC can retrieve features for recurring structures instantly. For instance, feature extraction for the pathchk binary was accelerated by 788x using this caching mechanism. Consequently, the total overhead for prediction remains low, typically between 2% and 10% of solving time.
Classification Module
PCC employs a Deep Neural Network (DNN) with nine dense layers to process 119 features, such as variable counts and operator frequencies. The study evaluated two models: DNN-Alpha, optimized for raw speed, and DNN-Beta, which incorporates "solvability" to penalize solvers likely to timeout or error.
Evaluation and Results
PCC was evaluated against five popular solvers (Z3, CVC4, MathSAT, Yices, and Boolector) using two datasets: an SE dataset generated from GNU Coreutils via KLEE and angr, and a diverse benchmark dataset from SMT-COMP.
The results indicate substantial improvements over individual solvers:
- Speedup: PCC achieved a 1.12x speedup on the KLEE dataset and a 1.85x speedup on the benchmark dataset.
- Efficiency: Total solver time was reduced by 10.3% in KLEE and 46% in the benchmark dataset.
- Reliability: The DNN-Beta model achieved the highest solve rates, demonstrating its ability to successfully avoid solvers prone to timeouts.
Conclusion
PCC demonstrates that machine learning-based solver selection can significantly alleviate the constraint-solving bottleneck in symbolic execution. By utilizing structural caching to minimize overhead, PCC provides a practical and scalable solution for improving the performance of software verification tools. Future research will investigate dynamic timeouts and advanced feature engineering to further refine solver prediction.
Summary updated