SharpASP-SR: Exact Counting for Disjunctive ASP
- The paper introduces SharpASP-SR, an exact counter for disjunctive ASP that uses subtractive reduction to projected propositional model counting.
- It employs a novel copy construction for loop atoms, enabling polynomial-size intermediate formulas and bypassing the exponential overhead of loop-formula approaches.
- Experimental evaluations show that SharpASP-SR significantly outperforms other systems on benchmarks, particularly in handling instances with extremely large numbers of answer sets.
SharpASP-SR is an exact counter for disjunctive answer set programs that computes the number of answer sets by a subtractive reduction to projected propositional model counting. It was introduced as a framework for making counting in disjunctive ASP practically feasible without relying on loop-formula-style encodings that can become exponentially large. Its central technical idea is an alternative characterization of answer sets in which non-stability can be witnessed by unjustified loop atoms only; this makes it possible to construct polynomial-size intermediate formulas and to exploit recent projected model counting technology effectively (Kabir et al., 15 Jul 2025).
1. Problem domain and formal setting
SharpASP-SR operates on finite propositional disjunctive logic programs. In this setting, a rule has the form
and a program is disjunctive if some rule has at least two head atoms. The task is exact counting of answer sets, not satisfiability checking and not bounded enumeration. For an interpretation , the semantic difficulty is that modelhood is insufficient: must satisfy the program and also be minimal with respect to the GelfondâLifschitz reduct
Thus is an answer set iff
This minimality condition is the source of the main counting difficulty (Kabir et al., 15 Jul 2025).
The framework is explicitly situated beyond the normal-program case. Counting answer sets of normal programs is stated to be in and -complete, whereas counting answer sets of disjunctive programs lies in . The decision analogue exhibits the same increase in difficulty: answer-set existence for normal programs is NP-complete, while answer-set existence for disjunctive programs is 0-complete. SharpASP-SR is designed for this harder regime and is motivated by applications in probabilistic reasoning, network reliability, answer set navigation, and trap-space counting (Kabir et al., 15 Jul 2025).
The framework also positions itself against three unsatisfactory baseline routes. Translating disjunctive ASP to normal ASP incurs exponential overhead unless the polynomial hierarchy collapses. Clark completion plus loop formulas is valid in principle but can become practically huge on cyclic programs. Reduction to QBF counting is theoretically possible, but current QBF counting scales much worse in practice than propositional projected counting. SharpASP-SR therefore targets projected model counting as a better computational match for the complexity of the problem (Kabir et al., 15 Jul 2025).
2. Semantic basis: completion, loops, and unjustified atoms
The semantic core of SharpASP-SR combines Clark completion with a loop-sensitive characterization of stability. The completion 1 is defined as the conjunction of three classes of formulas: unit clauses 2 for atoms with no defining head rule; implications from each rule body to the disjunctive head; and, for each atom 3 with head occurrences 4, implications of the form
5
Every answer set satisfies 6, but not every model of 7 is an answer set (Kabir et al., 15 Jul 2025).
The positive dependency graph 8 has one vertex per atom and an edge from 9 to 0 if there is a rule 1 with 2 and 3. A set 4 is a loop if it is strongly connected in 5 using only atoms in 6. Atoms belonging to some loop are called loop atoms, and the set of all such atoms is denoted 7. These loop atoms are the only atoms that need to be copied in the SharpASP-SR reduction (Kabir et al., 15 Jul 2025).
The crucial semantic step is the restriction of non-stability witnesses to cyclic structure. For a model 8, an atom 9 is justified in 0 if every reduct-model 1 with 2 still contains 3. The framework proves that under Clark completion, if a completion-model is not stable, then some loop atom in it is not justified. This is formalized through a satisfiability test in which non-loop atoms fixed true in 4 are held true, false atoms are held false, and at least one true loop atom is allowed to flip:
5
The significance of this restriction is structural rather than merely semantic: it makes it possible to encode the minimality test without duplicating the whole program (Kabir et al., 15 Jul 2025).
3. Copy construction and subtractive reduction
To avoid constructing the reduct explicitly inside the counting reduction, SharpASP-SR introduces a copy construction over loop atoms. For each loop atom 6, a fresh copy variable is introduced. The resulting 7 contains two kinds of implications. First, for every loop atom,
8
Second, for every rule
9
with 0, the construction includes
1
where 2 if 3 and 4 otherwise. The framework proves that this copy-based check is equivalent to the reduct-based justification test on completion-models (Kabir et al., 15 Jul 2025).
This yields the alternative characterization used by the counter. For every interpretation 5 such that 6,
7
Answer sets are therefore exactly the completion-models that admit no witness showing that a true loop atom can be made unjustified while preserving the copy constraints (Kabir et al., 15 Jul 2025).
The counting method is then expressed as a subtractive reduction. The overcounting formula is
8
and the surplus formula is
9
The projected variables are
0
The quantity 1 counts all completion-models, while 2 counts exactly those completion-models that have a witness of non-stability. The main theorem is
3
Both 4 and 5 are stated to be computable in polynomial time in 6. This polynomial-size guarantee is one of the defining properties of SharpASP-SR (Kabir et al., 15 Jul 2025).
4. Computational workflow and implementation
Operationally, the framework proceeds in a fixed sequence. It first constructs Clark completion as the overcount. It then computes the set of loop atoms 7 from the positive dependency graph. For each loop atom it introduces two fresh copy layers, forming 8 and 9, and builds two corresponding copy programs 0 and 1. These are assembled into the projected-counting formula 2, whose purpose is to witness that a completion-model is not an answer set. Two counting calls are then required: an exact propositional model count of 3 and a projected model count of 4 under projection over the copy variables (Kabir et al., 15 Jul 2025).
The implementation leverages existing projected model counters, most notably GANAK. Appendix experiments also tested D4 and GPMC, and GANAK was reported as the best backend among those tried in this framework. The method is explicitly backend-oriented: its practical success depends on the ability to offload both exact propositional counting and projected counting to mature propositional technology (Kabir et al., 15 Jul 2025).
The reduction has a tight structural dependence on cyclicity. Only loop atoms are duplicated, not all atoms, and only rules relevant to loop heads contribute to the copy program. This is the mechanism by which the framework avoids the exponential blow-up associated with loop formulas and whole-program duplication. A plausible implication is that the framework is especially well aligned with instances where cyclic structure is selective rather than pervasive (Kabir et al., 15 Jul 2025).
5. Empirical behavior and hybrid counting
The reported experimental study uses 1125 non-tight disjunctive ASP instances drawn from 2QBF, strategic companies, preferred extensions of abstract argumentation, pc configuration, minimal diagnosis, minimal trap spaces, and additional hard random disjunctive programs generated using ART2017. The runs used AMD EPYC 7713 processors, one core per benchmark, a timeout of 5000 seconds, and an 8 GB memory limit. The main baselines were clingo v5.7.1, DynASP v2.0, and Wasp v2 (Kabir et al., 15 Jul 2025).
The overall results reported in Table 1 are as follows.
| System | Solved | PAR2 |
|---|---|---|
| clingo | 708 | 4118 |
| DynASP | 89 | 9212 |
| Wasp | 432 | 6204 |
| SharpASP-SR | 825 | 2939 |
These numbers make SharpASP-SR the best-performing standalone system in the reported comparison by both solved instances and PAR2. The paper also emphasizes that the method is particularly strong when the number of answer sets is very large: clingo times out on nearly all instances with about 5 or more answer sets, Wasp on nearly all instances with about 6 or more, whereas SharpASP-SR can handle instances with up to about 7 answer sets (Kabir et al., 15 Jul 2025).
The paper also develops a hybrid counter based on the observed complementarity between enumeration and symbolic counting. The strategy is to run clingo enumeration first up to a threshold of 8 answer sets and then switch to SharpASP-SR if that threshold is exceeded. The hybrid outperforms all compared combinations.
| Hybrid system | Solved | PAR2 |
|---|---|---|
| clingo | 708 | 4118 |
| clingo(9) + DynASP | 377 | 4790 |
| clingo(0) + Wasp | 442 | 4404 |
| clingo(1) + SharpASP-SR | 918 | 1600 |
A key caveat is that performance degrades with the number of loop atoms. When instances are partitioned by 2, SharpASP-SR solves 386 of 399 instances in the range 3, 398 of 519 in 4, and only 41 of 207 when 5. The reported bottleneck is therefore not simply âmany answer sets,â but rather highly cyclic structure as measured by loop atoms (Kabir et al., 15 Jul 2025).
6. Relation to sharpASP and main limitations
A closely related predecessor is sharpASP, an exact ASP counting framework for normal logic programs. That earlier framework introduced an alternative definition of answer sets based on satisfying Clark completion and a separate copy formula, introduced copy variables only for loop atoms, and adapted deterministic splitting, component decomposition, and component caching from propositional model counting. It did not, however, explicitly define a variant named SharpASP-SR (Kabir et al., 2023). A plausible implication is that SharpASP-SR inherits the compact-encoding orientation of sharpASP while extending the counting architecture to disjunctive programs through subtractive reduction and projected counting rather than the earlier direct normal-program formulation (Kabir et al., 2023).
SharpASP-SRâs limitations are stated explicitly. Its performance deteriorates when 6 is large, since the copy machinery and projected counting instance become harder on very cyclic programs. The method also depends strongly on the quality of the projected model counting backend. Its completion-based design counts models of 7 and then subtracts the surplus, so practical efficiency depends on both parts of the reduction being manageable for the backend. Finally, some theoretically related approaches could not be compared empirically because they either target normal programs only or have no implementation (Kabir et al., 15 Jul 2025).
The frameworkâs place in the ASP-counting landscape is therefore specific. It is not an enumeration method, not a QBF-based method, and not a loop-formula compiler in the usual sense. Its defining identity is the formula
8
together with the semantic observation that non-stability in completion-models can be witnessed through unjustified loop atoms only. Within the reported evaluation, that combination yields the best standalone performance on disjunctive benchmarks and the best overall performance when integrated into a hybrid with bounded enumeration (Kabir et al., 15 Jul 2025).