Towards Projected and Incremental Pseudo-Boolean Model Counting

Suwei Yang, Kuldeep S. Meel

TL;DR

PBCount2 is the first exact Pseudo-Boolean (PB) model counter to support both projected model counting (counting unique assignments over a subset of variables) and incremental model counting (updating counts as constraints are added or removed). By combining an algebraic decision diagram (ADD) framework with a new ordering heuristic and an intermediate-diagram cache, PBCount2 solves up to $1.49\times$ more projected instances and $1.83\times$ more incremental instances than state-of-the-art CNF and PB counters.

What Problem Does This Paper Address?

Model counting is the task of determining how many assignments satisfy a given logical formula. While traditionally performed on formulas in Conjunctive Normal Form (CNF), Pseudo-Boolean (PB) constraints—linear inequalities over Boolean variables (e.g., $\sum a_i x_i \ge k$)—offer much greater expressiveness and compactness.

However, PB model counting tools have lagged behind mature CNF solvers in feature support, particularly in two key areas:

  1. Projected Counting: Counting partial assignments over a designated subset of variables (the projection set), where non-projected variables are existentially quantified. This is critical for planning, verification, and reliability analysis.
  2. Incremental Counting: Rapidly updating counts when a formula undergoes repeated modifications (e.g., adding/removing constraints), common in combinatorial testing and design exploration.

Existing PB counters support neither feature, forcing users to either convert PB formulas into CNF (which introduces auxiliary variables and inflates formula size) or restart model counting from scratch after every modification.

Methods

PBCount2 builds upon bottom-up Algebraic Decision Diagram (ADD) compilation: each PB constraint is compiled into an individual ADD, which are then iteratively merged and projected down to the final count. The authors introduce two key innovations:

  • Least Occurrence Weighted Min Degree (LOW-MD) Heuristic: In projected counting, existential ($\exists$) projection over non-projected variables $Y$ and summation ($\Sigma$) projection over projected variables $X$ do not commute; all $Y$ variables must be projected away before any $X$ variable. LOW-MD orders variable elimination by picking the variable with the lowest degree in a constraint-variable bipartite graph. Because merging two ADDs takes $O(mn)$ time, eliminating the least frequent variables first minimizes the number of merges required before an ADD can be shrunk via projection.
  • Intermediate ADD Caching for Incrementality: Intermediate ADDs resulting from projection steps are cached alongside their provenance metadata (the set of represented constraints and variables projected out). When constraints are added or removed, Algorithm 2 queries the cache, retrieves compatible ADDs, and only compiles/merges the newly introduced or modified constraints.

Datasets

The authors evaluated PBCount2 on synthetic benchmarks derived from prior PB counting literature across three application domains:

  • Combinatorial Auctions: Modeling preference updates by modifying constraint utility values.
  • Multi-Dimensional Knapsack: Modeling resource capacity updates across specific dimensions.
  • Sensor Placement: Modeling changes in redundancy requirements at critical graph locations.

For projected counting, projection sets were randomly selected from the original variable set. For incremental counting, benchmarks were structured into 3-step and 5-step sequential modification workflows. For CNF baselines (D4 and GPMC), PB constraints were translated to CNF using PBLib.

Key Insights and Ideas

  • Implicit Graded Project-Join Trees: The authors prove that running bottom-up ADD compilation while eliminating all non-projection variables $Y$ before projection variables $X$ implicitly forms an $X,Y$-graded project-join tree, guaranteeing exactness without needing explicit tree-decomposition compilers.
  • The High Cost of CNF Flattening: Converting PB formulas to CNF introduces a large number of auxiliary variables. Because these extra variables must be projected out, standard CNF projected counters (D4, GPMC) suffer dramatic slowdowns compared to natively reasoning over PB constraints.
  • Graceful Degradation Across Modification Steps: Caching intermediate ADD representations allows incremental steps to bypass recomputing shared sub-problems, keeping runtimes remarkably flat even as modification steps increase.

Key Results

Within a 3,600-second per-benchmark timeout on an AMD EPYC processor:

  • Projected Model Counting: PBCount2 solved 1,957 instances, substantially outperforming state-of-the-art CNF-based projected counters D4 (1,398 instances, a $1.40\times$ improvement) and GPMC (1,315 instances, a $1.49\times$ improvement).
  • Incremental Model Counting (5-step configuration):
  • PBCount2 solved 1,618 benchmarks, outperforming the previous state-of-the-art PB counter PBCount (1,371 instances; $1.18\times$), as well as CNF counters GPMC (886 instances; $1.83\times$) and D4 (676 instances; $2.39\times$).
  • Moving from 3 modification steps to 5 steps caused PBCount2's solved instances to drop by only 40, compared to drops of 56 for PBCount, 46 for GPMC, and 124 for D4.

Limitations and Future Work

  • Disabled Preprocessing in Incremental Mode: To ensure valid cache retrieval, PBCount2 must preserve unique constraint IDs and fixed variable-to-constraint mappings. Because standard preprocessing techniques simplify, merge, or delete constraints, preprocessing is currently disabled during incremental counting.
  • Future Directions: The authors suggest integrating formula simplification as inprocessing steps or maintaining supplementary transformation metadata so preprocessing can be used alongside cache retrieval.

Summary updated

BibTeX
@inproceedings{yang2025towards,
  author = {Suwei Yang and Kuldeep S. Meel},
  title = {{Towards Projected and Incremental Pseudo-Boolean Model Counting}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2025},
  url = {https://openreview.net/forum?id=vQZogAcan2},
}
Figure