Introduction
Model counting, or #SAT, is the problem of determining the number of satisfying assignments for a given propositional formula. It is a fundamental task with applications spanning probabilistic inference, network reliability, and formal verification. However, #SAT is #P-complete, making it significantly more challenging than the standard SAT decision problem.
Historically, the research community has been split between two paradigms: exact counters and approximate counters. Exact counters provide the precise number of solutions but often time out on large, complex instances. Approximate counters, typically based on sampling techniques, offer better scalability but frequently suffer from slow convergence or provide weak statistical guarantees. A common frustration is that existing approximate tools often fail to converge even on problems that an exact solver might handle relatively quickly. This paper introduces PartialKC, an anytime model counter designed to bridge this gap by combining the structural efficiency of knowledge compilation with the scalability of importance sampling.
Methodology: Partial Knowledge Compilation
The core innovation of PartialKC is the Partial CCDD (Constrained Conjunction and Decision Diagram). Traditional knowledge compilation (KC) attempts to transform a formula into a fully tractable representation. In contrast, PartialKC builds this representation incrementally.
The Partial CCDD language introduces two critical node types:
- "Unknown" (?) nodes: These represent leaf nodes for sub-formulas that have not yet been explored or compiled.
- "Known" nodes: These are sub-formulas where the exact model count has already been determined.
The PartialKC algorithm operates as an anytime process, iteratively refining these "unknown" regions through a sampling and compilation routine called MICROKC. This approach ensures that the algorithm provides an unbiased estimate of the model count at any point during its execution. As more "unknown" nodes are resolved, the estimate's variance decreases until it eventually converges to the exact count.
Beyond the partial representation, PartialKC employs several advanced techniques to accelerate convergence:
- Dynamic Decomposition: Unlike previous sampling-based compilers that used static splitting, PartialKC decomposes the formula dynamically based on the current search state.
- Kernelization: The algorithm identifies literal equivalences (e.g., $x \leftrightarrow l$) to prune the search space effectively.
- Component Caching: By storing results of sub-problems in a hash table, PartialKC avoids redundant computations, significantly speeding up the refinement process.
Experimental Evaluation
The authors conducted an extensive evaluation using a suite of 1,214 benchmarks. This collection includes 1,114 instances from diverse domains—such as automated planning, Bayesian networks, circuit analysis, and program synthesis—alongside 100 public instances from the 2022 Model Counting Competition.
Performance and Convergence
PartialKC demonstrated superior performance across nearly all evaluated metrics. It successfully solved 1,103 instances, outperforming both the leading exact counter, ExactMC (966), and the best approximate competitor, STS (971).
Key results include:
- Rapid Convergence: PartialKC reached the exact count for 933 instances, with 835 of these converging in under one minute of CPU time.
- High Accuracy: The average log-relative error for PartialKC was 0.0075, notably lower than
satss(0.0081) andSTS(0.0677). - Anytime Reliability: Even when the algorithm did not reach full convergence, its intermediate estimates were consistently more accurate and closer to the true count than those of its competitors.
Discussion and Future Work
PartialKC represents a significant step forward in anytime model counting. By treating convergence as a first-class citizen and explicitly representing uncertainty within the compilation structure, it provides a tool that is both scalable and statistically sound. The use of a partially compiled structure as a "proposal distribution" for importance sampling is a particularly powerful technique for variance reduction.
However, some challenges remain. Like other knowledge compilation methods, PartialKC is sensitive to memory limits. Currently, it manages memory by restarting compilation when limits are reached, which preserves the anytime property but sacrifices some structural progress. Future research could explore more sophisticated memory management or the application of "partial" concepts to other compilation languages like Sentential Decision Diagrams (SDDs). Additionally, improving the quality of marginal probability estimates could further accelerate the convergence of the sampling process.
Conclusion
PartialKC successfully bridges the gap between exact and approximate model counting. Its ability to provide unbiased, high-quality estimates that rapidly converge to exact results makes it a versatile tool for a wide range of AI applications where counting satisfying assignments is a critical bottleneck.
Summary updated