IASCAR: Incremental Answer Set Counting by Anytime Refinement

Johannes K. Fichte, Sarah Alice Gaggl, Markus Hecher, Dominik RusovacarXiv 2023

TL;DR

IASCAR introduces a novel "anytime" approach for counting answer sets in Answer Set Programming (ASP) by combining knowledge compilation with the inclusion-exclusion principle. By compiling a program's supported models into a compressed counting graph and iteratively refining the results, it enables lightning-fast re-counting under varying assumptions, making it ideal for navigating massive solution spaces.

What Problem Does This Paper Address?

Answer Set Programming (ASP) is a powerful tool for modeling complex search problems, but it faces a significant hurdle: counting solutions. While finding a single "answer set" (solution) is hard, counting them all is even harder—specifically, it is #P-complete.

Researchers often want to "navigate" the solution space by asking questions like, "How many solutions remain if I assume property X is true?" This requires repeated counting under different assumptions. Existing methods either try to enumerate every solution (which fails if there are millions) or translate the ASP program into a Boolean formula (CNF). However, translating ASP to CNF while preserving exact counts often causes an "exponential blowup," creating formulas too large for standard tools to handle.

Methods

The authors propose a two-phase approach called IASCAR (Incremental Answer Set Counting by Anytime Refinement):

  1. Offline Phase (Compilation & Compression):
    • Instead of compiling the full, complex answer set semantics, they compile the Clark’s completion of the program. This represents "supported models," which are a superset of answer sets but much easier to compile into a format called sd-DNNF (Smooth Deterministic Decomposable Negation Normal Form).
  2. They introduce a Counting Graph Compression algorithm (Algorithm 1) to strip away auxiliary variables introduced during the translation process. This results in a Compressed Counting Graph (CCG) that is much smaller and faster to evaluate.
  3. Online Phase (Anytime Refinement):
    • Counting on an sd-DNNF is linear in the size of the graph. However, because they compiled supported models, the initial count is an upper bound (it overcounts).
  4. To fix this, they use the Inclusion-Exclusion principle. The difference between supported models and true answer sets is caused by positive cycles in the program's dependency graph. IASCAR systematically subtracts models that contain unsupported cycles.
  5. This is an anytime technique: the more iterations (alternation depth) you run, the tighter the bounds become, eventually reaching the exact count.
Fig. 1: Counting graph G(ϕ ∧¬c) labeled with literals and their respective value.

Datasets

The authors evaluated IASCAR against state-of-the-art model counters (like d4 and sharpsat-td) and ASP solvers (clingo, wasp) using three distinct sets:

  • (S1) Argumentation Frameworks: 242 instances from the ICCMA 2017 competition. These are generally cycle-free, meaning supported models and answer sets coincide.
  • (S2) Public Transport Reachability: 936 instances based on real-world transit networks. These contain many cycles, providing a rigorous test for the refinement algorithm.
  • (S3) Combinatorial Puzzles: A small set of classic problems including N-Queens, Sudoku, and Graph Coloring.

Key Insights and Ideas

  • Supported Models as a Shortcut: The core "aha!" moment is that compiling supported models is significantly more efficient than compiling stable models. By accepting an initial overcount, the authors gain a representation that is actually usable in practice.
  • Cycle-Targeted Refinement: The authors identified that the "gap" between supported and stable models is entirely defined by cycles. By applying inclusion-exclusion specifically to these cycles, they can bridge that gap incrementally.
  • The Power of Compression: The compression algorithm is vital. For some instances, like the 12-queens problem, it reduced the counting graph size by nearly 20x, drastically speeding up the online phase.

Key Results

  • Speed in Re-counting: Once the offline compilation is finished, IASCAR is incredibly fast. For the argumentation instances (S1), the average time to (re)count under new assumptions was just 0.1 seconds, compared to 33.6s for the next best dedicated counter.
  • Anytime Utility: In complex cases with many cycles (S2), IASCAR could provide useful bounds even when the exact count was unreachable within the time limit.
  • Scalability: While the initial compilation is expensive, IASCAR pays off when the user needs to perform multiple queries on the same problem instance, outperforming traditional solvers that must start from scratch for every new assumption.

Limitations and Future Work

  • The Cycle Bottleneck: The inclusion-exclusion approach is exponential relative to the number of simple cycles. If a program has a massive number of overlapping cycles, the refinement process can become very slow.
  • Compilation Cost: The "offline" phase of building the sd-DNNF remains a significant computational hurdle for very large or dense programs.
  • Future Directions: The authors suggest exploring GPU acceleration for counting, using incremental SAT solving to quickly identify unsatisfiable branches, and developing more advanced preprocessing techniques to reduce the number of cycles before refinement begins.

Summary updated

BibTeX
@misc{fichte2023iascar,
  author = {Johannes K. Fichte and Sarah Alice Gaggl and Markus Hecher and Dominik Rusovac},
  title = {{IASCAR: Incremental Answer Set Counting by Anytime Refinement}},
  year = {2023},
  eprint = {2311.07233},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.07233},
}
Figure