Abstract
Counting Modulo Theories (#SMT) is a critical task for probabilistic inference and formal verification involving numerical constraints. While "bottom-up" knowledge compilation has been the standard, it often suffers from memory explosion. This paper explores a "top-down" approach leveraging exhaustive DPLL(T) search traces to generate efficient deterministic Decomposable Negation Normal Form (d-DNNF) representations. By integrating theory solvers directly into the compilation process, we can eliminate redundant "ghost models" and produce more compact circuits for theories like Linear Real Arithmetic (LRA).
Introduction
In computer science, model counting determines the number of satisfying assignments for a logical formula. While well-studied in Boolean logic (#SAT), many real-world applications require Satisfiability Modulo Theories (SMT) to handle mathematical constraints (e.g., $x + y < 5$). #SMT is inherently difficult due to potentially infinite model spaces. Knowledge compilation addresses this by translating formulas into target languages, such as d-DNNF, where counting becomes a polynomial-time operation.
The Case for Top-Down Compilation
Most existing #SMT compilers utilize bottom-up methods, building representations from sub-formulas. This often leads to intermediate memory explosions. In contrast, top-down compilation—highly successful in #SAT—starts with the global formula and recursively branches on variables.
The proposed strategy is theory-aware, top-down, and lazy:
- Top-Down Search: Uses a decision-tree-like decomposition.
- Theory-Awareness: Employs dedicated theory solvers (e.g., for LRA) to prune mathematically impossible branches.
- Lazy DPLL(T): Instead of "bit-blasting" math into logic gates upfront, it uses the DPLL(T) framework to allow the logic solver and theory solver to interact dynamically.
Trace-Based d-DNNF Generation
The core innovation lies in capturing the traces of an exhaustive DPLL(T) search. These traces naturally form a d-DNNF structure. A significant advantage of this theory-aware approach is the elimination of "ghost models"—assignments that are Boolean-consistent but mathematically impossible (e.g., $x < 0 \land x > 1$).
As shown in the figure above, theory-aware compilation allows for the omission of theory-implied atoms, resulting in significantly more compact representations compared to theory-agnostic methods. This reduction is vital for scaling to complex real-world problems.
Key Insights and Future Directions
The shift to top-down #SMT compilation offers two primary benefits:
- Amortized Inference: An expensive "offline" compilation enables extremely fast "online" counting for tasks like parameter learning in probabilistic programming.
- Efficiency in Numeric Theories: Lazy solving is hypothesized to be superior for theories like LRA by avoiding the variable explosion typical of eager "bit-blasting" methods.
However, challenges remain. Standard #SAT techniques like caching and component decomposition are harder to implement in #SMT due to shared continuous variables and implicit mathematical interactions. Future work will focus on developing practical tools that refine d-DNNF properties for specific application domains.
Conclusion
Top-down knowledge compilation via DPLL(T) traces represents a promising frontier for #SMT. By moving beyond theory-agnostic Boolean abstractions, researchers can create more efficient and scalable tools for complex probabilistic and mathematical reasoning.
Summary updated