Abstract
Model counting is a fundamental #P-complete problem with significant applications in automated reasoning. While Knowledge Compilation (KC) provides a path to efficiency by translating formulas into tractable circuits like d-DNNFs, most existing results are restricted to Conjunctive Normal Form (CNF). This paper expands the boundaries of KC by proving that complex Boolean constraints, such as XORs and cardinality constraints, can be efficiently compiled and counted. By leveraging the concept of "slim functions" and incidence treewidth, the authors provide a framework that maintains fixed-parameter tractability (FPT) for a broad class of non-CNF systems.
The Challenge of Non-CNF Constraints
Model counting—determining the number of truth assignments that satisfy a Boolean formula—is computationally difficult. A common strategy is to compile a formula into a tractable representation where counting becomes linear-time. Historically, these techniques have relied on the structural parameter of treewidth applied to CNF formulas.
However, real-world problems often involve higher-level constraints that are not naturally expressed in CNF. For example, parity (XOR) or cardinality constraints (e.g., "at least $k$ variables must be true") are frequently used in hardware verification and probabilistic reasoning. Translating these directly into CNF often obscures the underlying structure, leading to an explosion in complexity. This research addresses whether we can compile these systems directly while preserving efficiency guarantees.
Methodology: Slimness and Structural Decomposition
The authors introduce a theoretical bridge between complex constraints and efficient compilation through three primary innovations:
- Slim Functions: The paper defines "$h$-slim" functions—Boolean functions representable by small Ordered Binary Decision Diagrams (OBDDs) or SDNNFs regardless of variable ordering. This property ensures that constraints do not grow exponentially during compilation.
- Tseitin-style Encoding for SDNNFs: Instead of a full re-compilation, the authors represent individual constraints as small SDNNFs and use a modified Tseitin transformation to create a CNF-like structure. They prove this only increases the incidence treewidth by a constant factor related to the constraint's "slimness."
- Direct Model Counting: For specific sub-families of constraints, the authors provide a dynamic programming algorithm that operates over a tree decomposition of the constraint system. This approach skips the compilation step entirely, achieving a running time of $O(w^{2k})$, where $w$ is the state-size of the constraint and $k$ is the treewidth.
Key Results and Insights
The research establishes that the tractability previously associated with CNF is a property of a much broader class of functions. Key findings include:
- FPT Compilation: Systems of $O(1)$-slim constraints (like XOR and cardinality) can be compiled in $2^{O(k)} \text{poly}(|F|)$ time.
- Complexity Bounds: The direct counting algorithm offers a significantly faster alternative to compilation when only a single count is required, avoiding the large constants often found in compilation exponents.
- Lower Bounds: The authors demonstrate that the dependency on the constraint's width ($w$) in the exponent is likely unavoidable, as removing it would violate established lower bounds for d-DNNF size.
Conclusion and Future Work
This work generalizes Knowledge Compilation to a wide array of non-CNF constraints, identifying "slimness" as the key property for tractability. While the results are currently theoretical, they pave the way for more robust model counters. Future research will focus on the automatic discovery of "slim" constraints within arbitrary Boolean functions and the practical implementation of these algorithms in state-of-the-art solvers like D4 or c2d.
Summary updated