TLDR: Researchers Arijit Shaw and Kuldeep S. Meel introduce ‘pact’, a novel tool for approximate model counting in Satisfiability Modulo Theory (SMT) formulas that combine discrete and continuous variables. pact uses hashing-based techniques to efficiently estimate the number of solutions projected onto discrete variables, significantly outperforming existing methods. It successfully handles instances with vastly larger solution counts and demonstrates high accuracy, opening new possibilities for applications in cyber-physical systems, software verification, and information flow analysis.
Satisfiability Modulo Theory (SMT) solvers are powerful tools in automated reasoning, capable of tackling complex logical formulas that involve both discrete (like integers or bitvectors) and continuous (like real numbers or floating points) variables. While SMT solvers have seen significant advancements, the related problem of ‘model counting’—determining the number of solutions a formula has—has remained largely unexplored, especially for formulas that mix discrete and continuous elements.
Traditional approaches to SMT counting often struggle with these ‘hybrid’ formulas, particularly when the goal is to count solutions projected onto the discrete parts of the problem. This limitation has hindered the application of SMT counting in various real-world scenarios that inherently involve both types of variables, such as analyzing cyber-physical systems or verifying complex software.
Introducing pact: A New Approach to SMT Counting
To address this gap, researchers Arijit Shaw and Kuldeep S. Meel have introduced pact, a novel SMT model counter designed specifically for hybrid SMT formulas. The tool focuses on estimating the number of solutions projected onto the discrete variables within these complex formulas. pact employs a sophisticated hashing-based approximate model counting technique, which comes with theoretical guarantees on its accuracy.
The core idea behind pact is to efficiently divide the vast solution space of an SMT formula into smaller, manageable ‘cells’ using specially designed hash functions. By making a logarithmic number of calls to an SMT solver relative to the projection variables, pact can estimate the total count. This method significantly improves performance compared to existing enumeration-based approaches.
Real-World Applications
The development of pact is motivated by its potential to solve critical problems across various domains:
- Robustness Analysis of Automotive Cyber-Physical Systems: In autonomous vehicles, assessing robustness involves identifying potential attack vectors. pact can quantify these by counting potential attack points, where the system’s input parameters define the projection set.
- Reachability Analysis of Critical Software: For software, pact can count the number of different execution paths that lead to specific, potentially violating conditions, providing a quantitative measure of software safety.
- Quantitative Software Verification: Beyond just finding bugs, understanding their impact is crucial. pact can count inputs that lead to assertion failures, offering a quantitative approach to software reliability.
- Quantification of Information Flow: In software security, measuring information leakage is vital. pact can be used to quantify information flow in programs, helping to identify and mitigate privacy risks.
How pact Works: A Glimpse into the Algorithm
pact’s algorithm involves iteratively generating hash functions to partition the solution space. It then uses a ‘SaturatingCounter’ to determine if the number of solutions within a given cell is below a certain threshold. If a cell is too large, pact refines the hash functions to create smaller partitions. The final approximate count is derived by combining the counts from these smaller cells.
The choice of hash function is critical for pact’s efficiency. The researchers experimented with three types: Multiply mod prime (Hprime), Multiply-shift (Hshift), and Bitwise XOR (Hxor). While all showed improvements over the baseline, Hxor emerged as the most effective. This is largely because Hxor operates at the bit level and can leverage the native XOR reasoning capabilities of underlying SAT solvers, leading to faster computations.
Empirical Validation and Performance
An extensive evaluation was conducted on a suite of 14,202 benchmark instances. The results were striking: pact successfully completed 603 instances, whereas the ‘Baseline’ enumeration-based counter could only finish 13. This demonstrates a substantial leap in capability.
Furthermore, pact proved capable of handling instances with an enormous number of solutions, counting up to 1.7 × 1019, while the Baseline method failed on counts above 3,570. The accuracy of pact is also noteworthy; for instances where an exact count was known, pactxor achieved an average approximation error of just 3.3%, significantly outperforming its theoretical bounds.
Also Read:
- Boosting Constraint Solving: How GPUs Accelerate Table Propagation
- Optimizing AI Safety: A Framework for Combining Cost-Aware Runtime Monitors
Conclusion and Future Directions
pact represents a significant advancement in SMT model counting, particularly for hybrid formulas. Its hashing-based approach and the effective use of bit-level XOR operations enable it to tackle problems previously intractable. The success of pact, especially with Hxor, suggests that further development of specialized reasoning engines for different types of hash functions could lead to even greater performance gains. Future work also includes extending pact’s theoretical framework to support integer projection variables with specified bounds.


