Papers
Topics
Authors
Recent
Search
2000 character limit reached

SharpASP-SR: Exact Counting for Disjunctive ASP

Updated 6 July 2026
  • 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 ∣AS(P)∣|AS(P)| 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

a1∨â€Ĥak←b1,â€Ĥ,bm,not c1,â€Ĥ,not cna_1 \vee \ldots a_k \leftarrow b_1, \ldots, b_m, \textsf{not } c_1, \ldots, \textsf{not } c_n

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 M⊆at(P)M \subseteq at(P), the semantic difficulty is that modelhood is insufficient: MM must satisfy the program and also be minimal with respect to the Gelfond–Lifschitz reduct

PM={Head(r)←Body(r)+∣r∈P,  Body(r)−âˆİM=∅}.P^M = \{Head(r) \leftarrow Body(r)^+ \mid r \in P,\; Body(r)^- \cap M = \emptyset\}.

Thus MM is an answer set iff

M⊨Pand∄M′⊂M such that M′⊨PM.M \models P \quad\text{and}\quad \not\exists M' \subset M \text{ such that } M' \models P^M.

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 #P\#P and #P\#P-complete, whereas counting answer sets of disjunctive programs lies in #⋅coNP\# \cdot \mathrm{coNP}. 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 a1∨â€Ĥak←b1,â€Ĥ,bm,not c1,â€Ĥ,not cna_1 \vee \ldots a_k \leftarrow b_1, \ldots, b_m, \textsf{not } c_1, \ldots, \textsf{not } c_n0-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 a1∨â€Ĥak←b1,â€Ĥ,bm,not c1,â€Ĥ,not cna_1 \vee \ldots a_k \leftarrow b_1, \ldots, b_m, \textsf{not } c_1, \ldots, \textsf{not } c_n1 is defined as the conjunction of three classes of formulas: unit clauses a1∨â€Ĥak←b1,â€Ĥ,bm,not c1,â€Ĥ,not cna_1 \vee \ldots a_k \leftarrow b_1, \ldots, b_m, \textsf{not } c_1, \ldots, \textsf{not } c_n2 for atoms with no defining head rule; implications from each rule body to the disjunctive head; and, for each atom a1∨â€Ĥak←b1,â€Ĥ,bm,not c1,â€Ĥ,not cna_1 \vee \ldots a_k \leftarrow b_1, \ldots, b_m, \textsf{not } c_1, \ldots, \textsf{not } c_n3 with head occurrences a1∨â€Ĥak←b1,â€Ĥ,bm,not c1,â€Ĥ,not cna_1 \vee \ldots a_k \leftarrow b_1, \ldots, b_m, \textsf{not } c_1, \ldots, \textsf{not } c_n4, implications of the form

a1∨â€Ĥak←b1,â€Ĥ,bm,not c1,â€Ĥ,not cna_1 \vee \ldots a_k \leftarrow b_1, \ldots, b_m, \textsf{not } c_1, \ldots, \textsf{not } c_n5

Every answer set satisfies a1∨â€Ĥak←b1,â€Ĥ,bm,not c1,â€Ĥ,not cna_1 \vee \ldots a_k \leftarrow b_1, \ldots, b_m, \textsf{not } c_1, \ldots, \textsf{not } c_n6, but not every model of a1∨â€Ĥak←b1,â€Ĥ,bm,not c1,â€Ĥ,not cna_1 \vee \ldots a_k \leftarrow b_1, \ldots, b_m, \textsf{not } c_1, \ldots, \textsf{not } c_n7 is an answer set (Kabir et al., 15 Jul 2025).

The positive dependency graph a1∨â€Ĥak←b1,â€Ĥ,bm,not c1,â€Ĥ,not cna_1 \vee \ldots a_k \leftarrow b_1, \ldots, b_m, \textsf{not } c_1, \ldots, \textsf{not } c_n8 has one vertex per atom and an edge from a1∨â€Ĥak←b1,â€Ĥ,bm,not c1,â€Ĥ,not cna_1 \vee \ldots a_k \leftarrow b_1, \ldots, b_m, \textsf{not } c_1, \ldots, \textsf{not } c_n9 to M⊆at(P)M \subseteq at(P)0 if there is a rule M⊆at(P)M \subseteq at(P)1 with M⊆at(P)M \subseteq at(P)2 and M⊆at(P)M \subseteq at(P)3. A set M⊆at(P)M \subseteq at(P)4 is a loop if it is strongly connected in M⊆at(P)M \subseteq at(P)5 using only atoms in M⊆at(P)M \subseteq at(P)6. Atoms belonging to some loop are called loop atoms, and the set of all such atoms is denoted M⊆at(P)M \subseteq at(P)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 M⊆at(P)M \subseteq at(P)8, an atom M⊆at(P)M \subseteq at(P)9 is justified in MM0 if every reduct-model MM1 with MM2 still contains MM3. 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 MM4 are held true, false atoms are held false, and at least one true loop atom is allowed to flip:

MM5

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 MM6, a fresh copy variable is introduced. The resulting MM7 contains two kinds of implications. First, for every loop atom,

MM8

Second, for every rule

MM9

with PM={Head(r)←Body(r)+∣r∈P,  Body(r)−âˆİM=∅}.P^M = \{Head(r) \leftarrow Body(r)^+ \mid r \in P,\; Body(r)^- \cap M = \emptyset\}.0, the construction includes

PM={Head(r)←Body(r)+∣r∈P,  Body(r)−âˆİM=∅}.P^M = \{Head(r) \leftarrow Body(r)^+ \mid r \in P,\; Body(r)^- \cap M = \emptyset\}.1

where PM={Head(r)←Body(r)+∣r∈P,  Body(r)−âˆİM=∅}.P^M = \{Head(r) \leftarrow Body(r)^+ \mid r \in P,\; Body(r)^- \cap M = \emptyset\}.2 if PM={Head(r)←Body(r)+∣r∈P,  Body(r)−âˆİM=∅}.P^M = \{Head(r) \leftarrow Body(r)^+ \mid r \in P,\; Body(r)^- \cap M = \emptyset\}.3 and PM={Head(r)←Body(r)+∣r∈P,  Body(r)−âˆİM=∅}.P^M = \{Head(r) \leftarrow Body(r)^+ \mid r \in P,\; Body(r)^- \cap M = \emptyset\}.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 PM={Head(r)←Body(r)+∣r∈P,  Body(r)−âˆİM=∅}.P^M = \{Head(r) \leftarrow Body(r)^+ \mid r \in P,\; Body(r)^- \cap M = \emptyset\}.5 such that PM={Head(r)←Body(r)+∣r∈P,  Body(r)−âˆİM=∅}.P^M = \{Head(r) \leftarrow Body(r)^+ \mid r \in P,\; Body(r)^- \cap M = \emptyset\}.6,

PM={Head(r)←Body(r)+∣r∈P,  Body(r)−âˆİM=∅}.P^M = \{Head(r) \leftarrow Body(r)^+ \mid r \in P,\; Body(r)^- \cap M = \emptyset\}.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

PM={Head(r)←Body(r)+∣r∈P,  Body(r)−âˆİM=∅}.P^M = \{Head(r) \leftarrow Body(r)^+ \mid r \in P,\; Body(r)^- \cap M = \emptyset\}.8

and the surplus formula is

PM={Head(r)←Body(r)+∣r∈P,  Body(r)−âˆİM=∅}.P^M = \{Head(r) \leftarrow Body(r)^+ \mid r \in P,\; Body(r)^- \cap M = \emptyset\}.9

The projected variables are

MM0

The quantity MM1 counts all completion-models, while MM2 counts exactly those completion-models that have a witness of non-stability. The main theorem is

MM3

Both MM4 and MM5 are stated to be computable in polynomial time in MM6. 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 MM7 from the positive dependency graph. For each loop atom it introduces two fresh copy layers, forming MM8 and MM9, and builds two corresponding copy programs M⊨Pand∄M′⊂M such that M′⊨PM.M \models P \quad\text{and}\quad \not\exists M' \subset M \text{ such that } M' \models P^M.0 and M⊨Pand∄M′⊂M such that M′⊨PM.M \models P \quad\text{and}\quad \not\exists M' \subset M \text{ such that } M' \models P^M.1. These are assembled into the projected-counting formula M⊨Pand∄M′⊂M such that M′⊨PM.M \models P \quad\text{and}\quad \not\exists M' \subset M \text{ such that } M' \models P^M.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 M⊨Pand∄M′⊂M such that M′⊨PM.M \models P \quad\text{and}\quad \not\exists M' \subset M \text{ such that } M' \models P^M.3 and a projected model count of M⊨Pand∄M′⊂M such that M′⊨PM.M \models P \quad\text{and}\quad \not\exists M' \subset M \text{ such that } M' \models P^M.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 M⊨Pand∄M′⊂M such that M′⊨PM.M \models P \quad\text{and}\quad \not\exists M' \subset M \text{ such that } M' \models P^M.5 or more answer sets, Wasp on nearly all instances with about M⊨Pand∄M′⊂M such that M′⊨PM.M \models P \quad\text{and}\quad \not\exists M' \subset M \text{ such that } M' \models P^M.6 or more, whereas SharpASP-SR can handle instances with up to about M⊨Pand∄M′⊂M such that M′⊨PM.M \models P \quad\text{and}\quad \not\exists M' \subset M \text{ such that } M' \models P^M.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 M⊨Pand∄M′⊂M such that M′⊨PM.M \models P \quad\text{and}\quad \not\exists M' \subset M \text{ such that } M' \models P^M.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(M⊨Pand∄M′⊂M such that M′⊨PM.M \models P \quad\text{and}\quad \not\exists M' \subset M \text{ such that } M' \models P^M.9) + DynASP 377 4790
clingo(#P\#P0) + Wasp 442 4404
clingo(#P\#P1) + SharpASP-SR 918 1600

A key caveat is that performance degrades with the number of loop atoms. When instances are partitioned by #P\#P2, SharpASP-SR solves 386 of 399 instances in the range #P\#P3, 398 of 519 in #P\#P4, and only 41 of 207 when #P\#P5. 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 #P\#P6 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 #P\#P7 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

#P\#P8

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).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (2)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to SharpASP-SR.