Treewidth and Counting Projected Answer Sets
Johannes K. Fichte, Markus Hecher

TL;DR
This paper presents new algorithms for counting projected answer sets in logic programming, exploiting small treewidth and establishing complexity bounds, advancing the efficiency and theoretical understanding of #PAs.
Contribution
The paper introduces novel dynamic programming algorithms for projected answer set counting that leverage small treewidth and extends existing methods to various classes of logic programs.
Findings
Algorithms run in polynomial time with double exponential dependence on treewidth for certain programs.
Extended algorithms for tight, normal, and disjunctive programs improve counting efficiency.
Lower bounds under ETH show no significant runtime improvements are possible.
Abstract
In this paper, we introduce novel algorithms to solve projected answer set counting (#PAs). #PAs asks to count the number of answer sets with respect to a given set of projected atoms, where multiple answer sets that are identical when restricted to the projected atoms count as only one projected answer set. Our algorithms exploit small treewidth of the primal graph of the input instance by dynamic programming (DP). We establish a new algorithm for head-cycle-free (HCF) programs and lift very recent results from projected model counting to #PAs when the input is restricted to HCF programs. Further, we show how established DP algorithms for tight, normal, and disjunctive answer set programs can be extended to solve #PAs. Our algorithms run in polynomial time while requiring double exponential time in the treewidth for tight, normal, and HCF programs, and triple exponential time for…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, Reasoning, and Knowledge · Machine Learning and Algorithms · Bayesian Modeling and Causal Inference
Treewidth and Counting Projected Answer Sets††thanks: This work extends an abstract [18] explaining only concepts, and a preliminary workshop paper [17], and has been supported by FWF Grant Y698 and DFG Grant HO 1294/11-1.
The second author is also affiliated with University of Potsdam, Germany. The final publication will be available at Springer proceedings of LPNMR 2019.
Johannes K. Fichte1
Markus Hecher2
1: TU Dresden, Germany, [email protected]
2: TU Wien, Austria, [email protected]
Abstract
In this paper, we introduce novel algorithms to solve projected answer set counting (PAs). PAs asks to count the number of answer sets with respect to a given set of projected atoms, where multiple answer sets that are identical when restricted to the projected atoms count as only one projected answer set. Our algorithms exploit small treewidth of the primal graph of the input instance by dynamic programming (DP).
We establish a new algorithm for head-cycle-free (HCF) programs and lift very recent results from projected model counting to PAs when the input is restricted to HCF programs. Further, we show how established DP algorithms for tight, normal, and disjunctive answer set programs can be extended to solve PAs. Our algorithms run in polynomial time while requiring double exponential time in the treewidth for tight, normal, and HCF programs, and triple exponential time for disjunctive programs.
Finally, we take the exponential time hypothesis (ETH) into account and establish lower bounds of bounded treewidth algorithms for PAs. Under ETH, one cannot significantly improve our obtained worst-case runtimes.
Introduction
Answer Set Programming (ASP) [10] is an active research area of artificial intelligence. It provides a logic-based declarative modelling language and problem solving framework [24] for hard computational problems, which has been widely applied [2, 40, 41, 27]. In ASP, questions are encoded into rules and constraints that form a disjunctive (logic) program over atoms. Solutions to the program are so-called answer sets. Lately, two computational problems of ASP have received increasing attention, namely, As [19] and PAs [1]. The problem As asks to output the number of answer sets of a given disjunctive program. When considering computational complexity As can be classified as #coNP-complete [19], which is even harder than counting the models of a Boolean formula. A natural abstraction of As is to consider projected counting where we ask to count the answer sets of a disjunctive program with respect to a given set of projected atoms (PAs). Particularly, multiple answer sets that are identical when reduced to the projected atoms are considered as only one solution. Intuitively, PAs is needed to count answer sets without counting functionally independent auxiliary atoms. Under standard assumptions the problem PAs is complete for the class #. However, if we take all atoms as projected, then PAs is again #coNP-complete and if there are no projected atoms then it is simply -complete. But some fragments of ASP have lower complexity. A prominent example is the class of head-cycle-free (HCF) programs [4], which requires the absence of cycles in a certain graph representation of the program. Deciding whether a HCF program has an answer set is NP-complete.
A way to solve computationally hard problems is to employ parameterized algorithmics [12], which exploits certain structural restrictions in a given input instance. Because structural properties of an input instance often allow for algorithms that solve problems in polynomial time in the size of the input and exponential time in a measure of the structure, whereas under standard assumptions an efficient algorithm is not possible if we consider only the size of the input. In this paper, we consider the treewidth of a graph representation associated with the given input program as structural restriction, namely the treewidth of the primal graph [30]. Generally speaking, treewidth111Google Scholar outputs 18,800 results employing treewidth (queried: March. 27, 2019). measures the closeness of a graph to a tree, based on the observation that problems on trees are often easier to solve than on arbitrary graphs.
Our results are as follows: We establish the classical complexity of PAs and a novel algorithm that solves ASP problems by exploiting treewidth when the input program is restricted to HCF programs in runtime single exponential in the treewidth. We introduce a framework for counting projected answer sets by exploiting treewidth. Therefore, we lift recent results from projected model counting in the domain of Boolean formulas to counting projected answer sets. We establish algorithms that are (i) double exponential in the treewidth if the input is restricted to tight, normal or HCF programs and (ii) triple exponential in the treewidth if we allow disjunctive programs. Using the exponential time hypothesis (ETH), we establish that PAs cannot be solved in time better than double exponential in the treewidth for tight, normal, and HCF programs, and not better than triple exponential for disjunctive programs, respectively.
Related Work. Gebser, Kaufmann and Schaub [23] considered projected enumeration for ASP. Aziz [1] introduced techniques to modify modern ASP-solvers in order to count projected answer sets. Jakl, Pichler and Woltran [30] presented DP algorithms that solve ASP counting in time double exponential in the treewidth. Pichler et al. [43] investigated the complexity of extended programs and also presented DP algorithms for it. We employ ideas from their algorithms to solve head-cycle-free programs. Fichte et al. [19, 20] presented algorithms to solve As for the full standard syntax of modern ASP solvers. Recently, Fichte et al. [21] gave DP algorithms for projected SAT including lower bounds, c.f., Table 1.
Preliminaries
Basics and Combinatorics. For a set , let be the power set of consisting of all subsets with . For given sequence and integer , refers to the -th element of and denotes its induced ordering. Given some integer and a family of finite sets , , , , the generalized inclusion-exclusion principle [26] states that the number of elements in the union over all subsets is .
Computational Complexity. We assume familiarity with standard notions in computational complexity [42] and parameterized complexity [12], and use counting complexity classes as defined by Durand, Hermann and Kolaitis [14].
Let and be finite alphabets, be an instance and denote the size of . A witness function maps an instance to its witnesses. A parameterized counting problem is a function that maps a given instance and an integer to the cardinality of its witnesses . Let be a decision complexity class, e.g., P. Then, denotes the class of all counting problems whose witness function satisfies (i) there is a function such that for every instance and every we have and is computable in time for some constant and (ii) for every instance decision problem is inthe complexity class . Then, is the complexity class consisting of all counting problems associated with decision problems in NP.
Answer Set Programming (ASP). We follow standard definitions of propositional disjunctive ASP. For comprehensive foundations, we refer to introductory literature [10, 31]. Let , , be non-negative integers such that , , , be distinct atoms. Moreover, we refer by literal to an atom or the negation thereof. A program is a finite set of rules of the form For a rule , we let , , and . We denote the sets of atoms occurring in a rule or in a program by and . Let be a program. A program is a sub-program of if . Program is normal if for every . The positive dependency digraph of is the directed graph defined on the set of atoms from , where for every rule two atoms and are joined by an edge . A head-cycle of is an -cycle222Let be a digraph and . Then, a cycle in is a -cycle if it contains all vertices from . for two distinct atoms , for some rule . Program is tight (head-cycle-free [4]) if contains no cycle (head-cycle).
An interpretation is a set of atoms. satisfies a rule if or . is a model of if it satisfies all rules of , in symbols . The Gelfond-Lifschitz (GL) reduct of under is the program obtained from by first removing all rules with and then removing all where from the remaining rules [25]. is an answer set of a program if is a minimal model of . Deciding whether a disjunctive program has an answer set is -complete [15]. The problem is called consistency (As) of an ASP program. If the input is restricted to normal programs, the complexity drops to NP-complete [5, 38]. A head-cycle-free program can be translated into a normal program in polynomial time [4]. The following well-known characterization of answer sets is often invoked when considering normal programs [36]. Given a model of a normal program and an ordering of atoms over . An atom is proven if there is a rule with where (i) , (ii) for every , and (iii) and . Then, is an answer set of if (i) is a model of , and (ii) every atom is proven. This characterization vacuously extends to head-cycle-free programs by applying the results of Ben-Eliyahu and Dechter [4]. Given a program , we assume in the following that every atom occurs in some head of a rule of [3].
Example 1**.**
Consider It is easy to see that is a head-cycle-free program. The set is an answer set of . Consider the ordering , from which we can prove atom by rule , atom by rule , and atom by rule . Further answer sets are , , and .
Counting Projected Answer Sets. An instance is a pair , where is a program and is a set of projection atoms. The projected answer sets count of with respect to is the number of subsets such that is an answer set of for some set . The counting projected answer sets problem (PAs) asks to output the projected answer sets count of , i.e., where is the set of all answer sets of . Note that As is PAs, where , and that deciding As equals PAs, where .
Example 2**.**
Consider program from Example 1 and its four answer sets , , , and , as well as the set of projection atoms. When we project the answer sets to , we only have the three answer sets , , and , i.e., the projected answer sets count of is 3.
Theorem 1** (333Proofs marked with “” are in the appendix.).**
The problem is #-complete for disjunctive programs and #NP-complete for head-cycle-free, normal or tight programs.
Tree Decompositions (TDs). We follow standard terminology on graphs and digraphs [13, 9]. For a tree with root and a node , we let be the sequence of all nodes in arbitrarily but fixed order, which have an edge . Let be a graph. A tree decomposition (TD) of graph is a pair , where is a rooted tree, the root, and a mapping that assigns to each node a set , called a bag, such that the following conditions hold: (i) and ; and (ii) for each , such that lies on the path from to , we have . Then, . The treewidth of is the minimum over all TDs of . For arbitrary but fixed , it is feasible in linear time to decide if a graph has treewidth at most and, if so, to compute a TD of width [7]. For simplifications we always use so-called nice TDs, which can be computed in linear time without increasing the width [33] and are defined as follows. For a node , we say that is leaf if ; join if where ; int (“introduce”) if , and ; rem (“removal”) if , and . If for every node , , and for root and leaf , the TD is nice.
Example 3**.**
Figure 1 illustrates a graph and a tree decomposition of of width . By a property444The vertices ,, that are all neighbors to each other in . of tree decompositions [33], the treewidth of is .
Dynamic Programming on TDs
In order to use TDs for ASP solving, we need a dedicated graph representation of ASP programs [19].The primal graph of program has the atoms of as vertices and an edge if there exists a rule and .
Example 4**.**
Recall program from Example 1 and observe that graph in Figure 1 is the primal graph of .
Let be a TD of primal graph of a program . Further, let and . The bag-program is defined as , the program below as , and the program strictly below as . It holds that [19]. Analogously, we define the atoms below by , and the atoms strictly below by . For an example we refer to Example 10⋆.
Algorithms that decide consistency or solve As [19, 30] proceed by dynamic programming (DP) along the TD (in post-order) where at each node of the tree information is gathered [8] in a table by a (local) table algorithm . More generally, a table is a set of rows, where a row is a sequence of fixed length. Similar as for sequences when addressing the -th element, for a set of rows (table) we let . The actual length, content, and meaning of the rows depend on the algorithm . Since we later traverse the TD repeatedly running different algorithms, we explicitly state -row if rows of this type are syntactically used for algorithm and similar -table for tables. In order to access tables computed at certain nodes after a traversal as well as to provide better readability, we attribute TDs with an additional mapping to store tables. Formally, a tabled tree decomposition (TTD) of graph is a triple , where is a TD of and maps nodes of to tables. If not specified otherwise, we assume that for every node of . When a TTD has been computed using algorithm after traversing the TD, we call the decomposition the -TTD of the given instance. DP for ASP performs the following steps:
-
Given program , compute a tree decomposition of the primal graph .
-
Run algorithm (see Listing 1). It takes a TTD with and traverses in post-order555 provides the sequence of nodes for tree rooted at .. At each node it computes a new -table by executing the algorithm . Algorithm has a “local view” on the computation and can access only , the atoms in the bag , the bag-program , and -table for any child of .666Note that in Listing 1, takes in addition as input set and table , used later. Later, represents the projected atoms and is a table at from an earlier traversal. Finally, returns an -TTD .
-
Print the result by interpreting table for root of .
Then, the actual computation of algorithm is a somewhat technical case distinction of the types we see when considering node . Algorithms for counting answer sets of disjunctive programs [30] and its extensions [19] have already been established. Implementations of these algorithms can be useful also for solving [19, 20], but the running time is clearly double exponential time in the treewidth in the worst case. We, however, establish an algorithm () that is restricted to head-cycle-free programs. The runtime of our algorithm is factorial in the treewidth and therefore faster than previous algorithms. Our constructions are inspired by ideas used in previous DP algorithms [43]. In the following, we first present the table algorithm for deciding whether a head-cycle-free program has an answer set (As). In the end, this algorithm outputs a new TTD, which we later reuse to solve the actual counting problem. Note that the TD itself remains the same, but for readability, we keep computed tables and nodes aligned.
Consistency of Head-Cycle-Free Programs. We can use algorithm to decide the consistency problem As for head-cycle-free programs and simply specify our new table algorithm () that “transforms” tables from one node to another. As graph representation we use the primal graph. The idea is to implicitly apply along the TD the characterization of answer sets by Lin and Zhao [36] extended to head-cycle-free programs [4]. To this end, we store in table at each node rows of the form . The first position consists of an interpretation restricted to the bag . For a sequence , we write to address the interpretation part. The second position consists of a set that represents atoms in for which we know that they have already been proven. The third position is a sequence of the atoms in such that there is a super-sequence of , which induces an ordering . Our table algorithm stores interpretation parts always restricted to bag and ensures that an interpretation can be extended to a model of sub-program . More precisely, it guarantees that interpretation can be extended to a model of and that the atoms in (and the atoms in ) have already been proven, using some induced ordering where is a sub-sequence of . In the end, an interpretation of a row of the table at the root proves that there is a superset that is an answer set of .
Listing 2 presents the algorithm . Intuitively, whenever an atom is introduced (int), we decide whether we include in the interpretation, determine bag atoms that can be proven in consequence of this decision, and update the sequence accordingly. To this end, we define for a given interpretation and a sequence the set where holds if is true for every . Moreover, given a sequence and a set of atoms, we compute the potential sequences involving . Therefore, we let . When removing (rem) an atom , we only keep those rows where has been proven (contained in ) and then restrict remaining rows to the bag (not containing ). In case the node is of type join, we combine two rows in two different child tables, intuitively, we are enforced to agree on interpretations and sequences . However, concerning individual proofs , it suffices that an atom is proven in one of the rows.
Example 5**.**
Recall program from Example 1. Figure 2 depicts a TD of the primal graph of . Further, the figure illustrates a snippet of tables of the TTD , which we obtain when running on program and TD according to Listing 2. In the following, we briefly discuss some selected rows of those tables. Note that for simplicity and space reasons, we write instead of and identify rows by their node and identifier in the figure. For example, the row refers to the third row of table for node . Node is of type leaf. Table has only one row, which consists of the empty interpretation, empty set of proven atoms, and the empty sequence (Line 2). Node is of type int and introduces atom . Executing Line 2 results in . Node is of type int and introduces . Then, bag-program at node is . By construction (Line 2) we ensure that interpretation is a model of for every row in . Node is of type rem. Here, we restrict the rows such that they contain only atoms occurring in bag . To this end, Line 2 takes only rows of table where atoms in are also proven, i.e., contained in . In particular, every row in table originates from at least one row in that either proves or where . Basic conditions of a TD ensure that once an atom is removed, it will not occur in any bag at an ancestor node. Hence, we also encountered all rules where atom occurs. Nodes , and are symmetric to nodes , and . Nodes and again introduce atoms. Observe that since does not allow to prove using atom . However, as the sequence allows to prove . In particular, in row atom is used to derive . As a result, atom can be proven, whereas ordering does not serve in proving . We proceed similar for nodes and . At node we join tables and according to Line 2. Finally, , i.e., has an answer set; joining interpretations of yellow marked rows of Figure 2 leads to .
Next, we provide a notion to reconstruct answer sets from a computed TTD, which allows for computing for a given row its predecessor rows in the corresponding child tables, c.f., [21]. Let be a program, be an -TTD of , and be a node of where . Given a sequence , we let . For a given -row , we define the originating -rows of in node by We extend this to an -table by .
Example 6**.**
Consider program and -TTD from Example 5. We focus on of table of leaf . The row has no preceding row, since . Hence, we have . The origins of row of table are given by , which correspond to the preceding rows in table that lead to row of table when running algorithm , i.e., . Origins of row are given by . Note that and are not among those origins, since is not proven. Observe that for any row . For node of type join and row , .
Next, we provide statements on correctness and a runtime analysis.
Theorem 2** ().**
The algorithm is correct. In other words, given a head-cycle-free program and a TTD of where with root . Then, returns the -TTD such that has an answer set if and only if . Further, we can construct all the answer sets of from transitively following the origins of .
Proof (Idea).
For soundness, we state and establish an invariant for every node . For each row , we have , and is a sequence over atoms in . Intuitively, we ensure existence of s.t. and that exactly the atoms in and can be proven using a super-sequence of . By construction, we guarantee that we can decide consistency if row . Further, we can even reconstruct answer sets, by following of this single row back to the leaves. For completeness, we show that we indeed obtain all required rows to output all the answer sets of . ∎
Theorem 3**.**
Given a head-cycle-free program and a TD of of width with nodes. Algorithm runs in time .
Proof (Sketch).
Let be maximum bag size of the tree decomposition . The table has at most rows, since for a row we have many sequences , and by construction of algorithm , an atom can be either in , both in and , or neither in nor in . In total, with the help of efficient data structures, e.g., for nodes with , one can establish a runtime bound of . Then, we apply this to every node of the tree decomposition, which resulting in running time . ∎
In order to obtain an upper bound on width factorial , we can simply take for any fixed width . While in general is obviously not bounded by for any fixed , asymptotically is bounded by for any fixed positive integer as stated in Lemma 1.
Lemma 1** ().**
Given any fixed positive integer and functions , where is a non-negative integer. Then, .
In particular, for , for , and for .
A natural question is whether we can significantly improve this algorithm for fixed . To this end, we take the exponential time hypothesis (ETH) into account [29], which states that there is some real such that we cannot decide satisfiability of a given 3-CNF formula in time .
Proposition 1**.**
Unless ETH fails, consistency of head-cycle-free, normal or tight program cannot be decided in time where .
Proof.
Reduction from SAT to As similar to the proof of Theorem 1. ∎
In the construction above, we store an arbitrary but fixed ordering on the involved atoms. We believe that we cannot avoid these orderings in general, since we have to compensate arbitrarily “bad” orderings induced by the decomposition. Hence, we claim that As for head-cycle-free programs is slightly superexponential, rendering our algorithm asymptotically worst-case optimal. Lokshtanov, Marx and Saurabh confirm such an expectation [37] whenever orderings are required.
Conjecture 1**.**
Unless ETH fails, consistency of a head-cycle-free program cannot be decided in time where .
Dynamic Programming for
In this section, we present our DP algorithm777Later we use (among others) where . , which allows for solving the projected answer set counting problem (PAs). is based on an approach of projected counting for Boolean formulas [21] where TDs are traversed multiple times. We show that ideas from that approach can be fruitfully extended to answer set programming. Figure 3 illustrates the steps of . First, we construct the primal graph of the input program and compute a TD of . Then, we traverse the TD a first time by running (Step 2a), which outputs a TTD , where . Afterwards, we traverse in pre-order and remove all rows from the tables that cannot be extended to an answer set (“Purge non-solutions”). In other words, we keep only rows of table at node , if is involved in those rows that are used to construct an answer set of , and let the resulting TTD888Table contains rows obtained by recursively following origins of for root . Formal details are in Definition 1⋆. be . We refer to as purged table mapping. In Step 2b (), we traverse to count interpretations with respect to the projection atoms and obtain . From the table at the root of , we can then read the projected answer sets count of the input instance. In the following, we only describe the table algorithm , since the traversal in is the same as before. For , a row at a node is a pair , where is an -table and is a non-negative integer. In fact, integer stores the number of intersecting solutions (). However, we aim for the projected answer sets count (), whose computation requires
a few additional definitions. Therefore, we can simply widen definitions from very recent work [21].
In the remainder, we assume to be an instance of PAs, to be an -TTD of and the mappings , , and as used above. Further, let be a node of with and let . The relation considers equivalent rows with respect to the projection of its interpretations by Let be equivalence classes induced by on , i.e., , where [45]. Further, .
Example 7**.**
Consider program , set , TTD , and table from Example 2 and Figure 2. Rows and are removed (highlighted gray) during purging, since they are not involved in any answer set, resulting in . Then, and . The set of equivalence classes of is .
Later, we require to construct already computed projected counts for tables of children of a given node . Therefore, we define the stored of a table in table by We extend this to a sequence of tables of length and a set of sequences of tables by So we select the -th position of the sequence together with sets of the -th positions.
Intuitively, when we are at a node in algorithm we have already computed of for every node below . Then, we compute the projected answer sets count of . Therefore, we apply the inclusion-exclusion principle to the stored projected answer sets count of origins. We define . Intuitively, determines the -origins of table , goes over all subsets of these origins and looks up stored counts () in -tables of children of .
Example 8**.**
Consider again program and TD from Example 1 and Figure 2. First, we compute the projected count for row of table , where \pi(t_{3}){\,\mathrel{\mathop{:}}=}\allowdisplaybreaks[4]\big{\{}\langle\{\vec{u_{3.1}}\},1\rangle, \langle\{\vec{u_{3.2}}\},1\rangle,\langle\{\vec{u_{3.1}},\vec{u_{3.2}}\},1\rangle\big{\}} with and . Note that has only the child and therefore the product in consists of only one factor. Since , only the value of for set is non-zero. Hence, we obtain . Next, we compute . Observe that . We sum up the values of for sets and and subtract the one for set . Hence, we obtain .
Next, we provide a definition to compute at a node for given table by computing for children of using stored values from tables , and subtracting and adding values for subsets accordingly. Formally, if and otherwise \operatorname{ipasc}(t,\rho,s){\,\mathrel{\mathop{:}}=}\big{|}\operatorname{pasc}(t,\rho,s) +\Sigma_{\emptyset\subsetneq\varphi\subsetneq\rho}(-1)^{\left|\varphi\right|}\cdot\operatorname{ipasc}(t,\varphi,s)\big{|} where . In other words, if a node is of type leaf the is one, since bags of leaf nodes are empty. Otherwise, we compute the “non-overlapping” count of given table with respect to , by exploiting inclusion-exclusion principle on -origins of such that we count every projected answer set only once. Then we have to subtract and add values (“all-overlapping” counts) for strict subsets of , accordingly. Finally, Listing 3 presents table algorithm , which stores consisting of every sub-bucket of given table together with its .
Example 9**.**
Recall instance , TD , and tables , , from Examples 2, 5, and Figure 2. Figure 4 depicts selected tables of obtained after running for counting projected answer sets. We assume that row in table corresponds to where . Recall that there are rows among different -tables that are removed (highlighted gray in Figure 2) during purging. By purging we avoid to correct stored counters (backtracking) whenever a row has no “succeeding” row in the parent table. Next, we discuss selected rows obtained by . Tables , , are shown in Figure 4. Since , we have . Intuitively, at the row belongs to bucket. Node introduces atom , which results in table \pi_{2}{\,\mathrel{\mathop{:}}=}\big{\{}\langle\{\vec{u_{2.1}}\},1\rangle,\langle\{\vec{u_{2.2}}\},1\rangle,\langle\{\vec{u_{2.1}},\vec{u_{2.2}}\},1\rangle\big{\}}, where and (derived similarly to table as in Example 8). Node introduces projected atom , and node removes . For row we compute the count by means of . Therefore, take for the singleton set . We simply have . To compute , we take for the sets , , , and into account, since all other non-empty subsets of origins of in do not occur in . Then, we take the sum over the values , , and subtract . This results in . We proceed similarly for row , resulting in . Then for row , . Hence, represents the number of projected answer sets, both rows and have in common. We then use it for table . Node removes projection atom . For node where one multiplies stored values for -rows in the two children of accordingly. In the end, the projected answer sets count of is .
Next, we present upper bounds on the runtime of . Therefore, let [34, 28] be the runtime for multiplying two -bit integers.
Theorem 4**.**
* runs in time for instance and TTD of of width with nodes, where .*
Proof.
Let be maximum bag size of the TD . For each node of , we consider the table of . Let TDD be the output of . In worst case, we store in each subset together with exactly one counter. Hence, we have at most many rows in . In order to compute for , we consider every subset and compute . Since , we have at most many subsets of . Finally, for computing , we consider in the worst case each subset of the origins of for each child table, which are at most because of nodes with . In total, we obtain a runtime bound of due to multiplication of two -bit integers for nodes with at costs . Then, we apply this to every node of resulting in runtime . ∎
Corollary 1**.**
Given an instance of PAs where is head-cycle-free and . Then, runs in time .
Proof.
We can compute in time a TD with nodes of width at most [7]. Then, we can simply run , which runs in time by Theorem 3 and since the number of nodes of a tree decomposition is linear in the size of the input instance [7]. Then, we again traverse the TD for purging and output , which runs in time single exponential in the treewidth and linear in the instance size. Finally, we run and obtain by Theorem 4 that the runtime bound . Hence, the corollary holds. ∎
Then, we present lower bounds, and show that is indeed correct.
Theorem 5** (Lower Bound).**
Under ETH, cannot be solved in time for s.t. is head-cycle-free, normal or tight, .
Proof.
Assume for proof by contradiction that there is such an algorithm. We show that this contradicts a very recent result [35, 21], which states that one cannot decide the validity of a QBF in time , where is in CNF. Let be an instance of -SAT parameterized by the treewidth . Then, we reduce to an instance of the decision version -exactly- when parameterized by treewidth of such that , the number of solutions is exactly , and is as follows. For each , program contains rules and . Each clause results in one additional rule . It is easy to see that the reduction is correct and therefore instance is a yes instance of -exactly- if and only if is a yes instance of problem -SAT. In fact, is head-cycle-free, normal and tight, and the reduction runs in polynomial time of and at most doubles the treewidth due to duplication of atoms, which establishes the result. ∎
Finally, we state that indeed gives the projected answer sets count of a given head-cycle-free program .
Proposition 2** ().**
Algorithm is correct and outputs for any instance of PAs restricted to head-cycle-free programs its projected answer sets count.
Proof (Idea).
Soundness follows by establishing an invariant for any row of guaranteeing that the values of indeed capture “all-overlapping” counts of . One can show that the invariant is a consequence of the properties of and the additional “purging” step, which neither destroys soundness nor completeness of . Further, completeness guarantees that all required rows are computed. ∎
Solving PAs for Disjunctive Programs. We extend our algorithm to projected answer set counting for disjunctive programs. Therefore, we simply use a table algorithm = for disjunctive ASP that was introduced in the literature [19, 30]. Recall algorithm illustrated in Figure 3. First, we heuristically compute a TD of the primal graph. Then, we run as first traversal resulting in TTD . Next, we purge rows of , which cannot be extended to an answer set resulting in TTD . Finally, we use to compute the projected answer sets count by and obtain TTD .
Proposition 3** ().**
* is correct, i.e., it outputs the projected answer sets count for any instance of PAs.*
The following lemma states the runtime results.
Lemma 2**.**
* runs in time for given instance of PAs where is a disjunctive program, and .*
Proof.
The first two steps follow the proof of Corollary 1. However, runs in time [19]. Finally, we run and obtain by Theorem 4 that . ∎
Then, the runtime of algorithm cannot be significantly improved.
Theorem 6** (Lower Bound).**
PAs* cannot be solved in time for given instance , where , unless ETH fails.*
Proof.
Assume for proof by contradiction that there is such an algorithm. We show that this contradicts a rather recent result [22] stating that one cannot decide validity of QBF in time where is in DNF, which was anticipated by Marx and Mitsou [39]. Assume we have given such an instance when parameterized by the treewidth . In the following, we employ a well-known reduction [15], which transforms into and gives a yes instance of consistency if and only if is a yes instance of -SAT. Then, we reduce instance via a reduction to an instance , where , , of the decision version -exactly- of when parameterized by treewidth such that the number of projected answer sets is exactly . It is easy to see that reduction gives a yes instance of -exactly- if and only if is a yes instance of -SAT. However, it remains to show that the reduction indeed increases the treewidth only linearly. Therefore, let be TD of . We transform into a TD of as follows. For each bag of , we add vertices for the atoms and (two additional atoms introduced in reduction ) and in addition we duplicate each vertex in (due to corresponding duplicate atoms introduced in reduction ). Observe that . By construction of , is then a TD of . Hence, runs in polynomial time and linearly preserves the parameter. ∎
In total, we obtain results presented in Table 1. Indeed, there is an increase of complexity when going from As and As to PAs (c.f., Theorem 4). For solving As (As) on tight programs one can again reuse Algorithm (Listing 2) without the orderings , or encode [16] to SAT and use established DP algorithms [44] for SAT (SAT). Then, PAs on tight programs can be solved after purging, followed by computing projected answer sets by means of .
Conclusions
We introduced novel algorithms to count the projected answer sets (PAs) of tight, normal, head-cycle-free, and arbitrary disjunctive programs. Our algorithms employ dynamic programming and exploit small treewidth of the primal graph of the input program. More precisely, for disjunctive programs, the runtime is triple exponential in the treewidth and polynomial in the size of the instance, which can not be significantly improved under the exponential time hypothesis. When we restrict the input to tight, normal, and head-cycle-free programs, the runtime drops to double exponential, c.f., Table 1. Our results extend previous work to answer set programming and we believe it is applicable to further hard combinatorial problems, such as quantified Boolean formulas(QBF) [11] and circumscription [14].
Appendix A Additional Resources
Additional Examples
Example 10** (c.f.,[19]).**
Intuitively, the tree decomposition of Figure 1 enables us to evaluate program by analyzing sub-programs and , and combining results agreeing on followed by analyzing . Indeed, for the given tree decomposition of Figure 1, , and . Note that here and the tree decomposition is not nice.
Parsimonious reductions
Let and be counting problems with witness functions and . A parsimonious reduction from to is a polynomial-time reduction such that for all , we have . It is easy to see that the counting complexity classes defined above are closed under parsimonious reductions. It is clear for counting problems and that if and there is a parsimonious reduction from to , then .
Counting Complexity of PAs: Omitted proofs
Theorem 1.
The problem is #-complete when we allow disjunctive programs as input and #NP-complete when the input is restricted to head-cycle-free, normal or tight programs.
Proof.
Membership immediately holds as we can check for a given set whether there is an answer set of with by checking if there is an answer set of program . Note that if is head-cycle-free, normal, or tight, this program is again head-cycle-free, normal, or tight, respectively. Hardness follows by establishing a parsimonious reduction from -SAT or -SAT 999For quantified Boolean formulas (QBF) and its evaluation problem (-SAT for alternating ) we refer to standard texts [6, 32]., respectively. Assume that the input is restricted to head-cycle-free, normal or tight programs. Given an instance with . We reduce to the instance of , where is defined as follows. For each variable , we add the rules and . For each clause in , we add a rule where corresponds to if for a variable , and otherwise. Then, a counter solves if and only if solves . Assume that we allow arbitrary disjunctive programs as input. Given an instance , where . We reduce to the instance of , where , , and is defined exactly as by Eiter and Gottlob [15]. Then, since is a correct encoding of -SAT, the projected model count of is the projected answer sets count of and vice versa. Consequently, the proposition sustains. ∎
Worst-Case Analysis of : Omitted proofs
Lemma 1.
Given any fixed positive integer and functions , where is a non-negative integer. Then, .
Proof.
We proceed by simultaneous induction.
Base case (): Obviously, .
Induction hypothesis:
Induction step ():
We have to show that for for some fixed , the following equation holds.
[TABLE]
Induction step (): Analogous, previous step works for any .
Induction step (): Analogous. ∎
Characterizing Extensions
In the following, we assume to be an instance of . Further, let be an -TTD of where , node , and .
Definition 1**.**
Let be a row of .
An extension below is a set of pairs where a pair consist of a node of the induced sub-tree rooted at and a row of and the cardinality of the set equals the number of nodes in the sub-tree .
We define the family of extensions below recursively as follows. If is of type leaf, then ; otherwise \operatorname{Ext}_{\leq t}(\vec{u}){\,\mathrel{\mathop{:}}=}\bigcup_{\vec{v}\in\operatorname{\mathbb{A}\hbox{-}\nobreak\hskip 0.0ptorigins}(t,\vec{u})}\big{\{} \{\langle t,\vec{u}\rangle\}\cup X_{1}\cup\ldots\cup X_{\ell}\mid X_{i}\in\operatorname{Ext}_{\leq t_{i}}({\vec{v}}_{(i)})\big{\}} for the children of . We extend this notation for an -table by . Further, we let be the family of all extensions.
Further, we define the local table for node and family of extensions (below some node) as .
If we would construct all extensions below the root , it allows us to also obtain all models of program . To this end, we state the following definition.
Definition 2**.**
We define the satisfiable extensions below for by
[TABLE]
Observation 1**.**
.
Definition 3**.**
We define the purged table mapping of by for every .
Next, we define an auxiliary notation that gives us a way to reconstruct interpretations from families of extensions.
Definition 4**.**
Let be a family of extensions below . We define the set of interpretations of by \mathcal{I}(E){\,\mathrel{\mathop{:}}=}\big{\{} \bigcup_{\langle\cdot,\vec{u}\rangle\in X}\mathcal{I}(\vec{u})\mid X\in E\big{\}} and the set of projected interpretations by \mathcal{I}_{P}(E){\,\mathrel{\mathop{:}}=}\big{\{}\bigcup_{\langle\cdot,\vec{u}\rangle\in X}\mathcal{I}(\vec{u})\cap P\mid X\in E\big{\}}.
Example 11**.**
Consider again program and TTD of , where is the root of , from Example 5. Let be an extension below . Observe that and that Figure 2 highlights those rows of tables for nodes and that also occur in (in yellow). Further, computes the corresponding answer set of , and derives the projected answer sets of . refers to the set of answer sets of , whereas is the set of projected answer sets of .
Correctness of : Omitted proofs
In the following, we assume to be a head-cycle-free program. Further, let be an -TTD of where and is a node.
We state definitions required for the correctness proofs of our algorithm . In the end, we only store rows that are restricted to the bag content to maintain runtime bounds. Similar to related work [19], we define the content of our tables in two steps. First, we define the properties of so-called -solutions up to . Second, we restrict these solutions to -row solutions at .
Definition 5**.**
Let be an interpretation, be a set of atoms and be an ordering over atoms . Then, is referred to as -solution up to if the following holds.
, 2. 2.
for each , we have , and 3. 3.
* if and only if is proven using program and ordering .*
Next, we observe that the -solutions up to suffice to capture all the answer sets.
Proposition 4**.**
The set of -solutions up to characterizes the set of answer sets of . In particular: .
Proof.
Observe that Definition 5 for root node indeed suffices for to be a model of , and, moreover, every atom in is proven in by ordering . ∎
Definition 6**.**
Let be a -solution up to . Then, , where is the partial ordering of only containing , is referred to as -row solution at node .
Given a -solution up to and a -row solution at . We say is a corresponding -solution up to of -row solution at if can be used to construct according to Definition 6.
In fact, -row solutions at suffice to capture all the answer sets of . Before we show that, we need the following definition.
Definition 7**.**
Let be a node of with . Further, let be a -solution up to and be a -solution up to . Then, is compatible with (and vice-versa) if
** 2. 2.
** 3. 3.
* is a sub-sequence of such that may additionally contain atoms in *
Lemma 3** (Soundness).**
Let be a node of with . Further, let be a -row solution at for . Then, each row in with is also a -row solution at node . Moreover, for any corresponding -solution up to (of ) there are corresponding compatible -solutions up to (for ).
Proof (Sketch).
We proceed by case distinctions. Assume case(i): . Then, is a -row solution at . This concludes case(i).
Assume case(ii): and . Let be any -row solution at child node , and be any corresponding -solution up to , which exists by Definition 6. In the following, we show that the way transforms -row solution at to a -row solution at is sound. We identify several sub-cases.
Case (a): Atom is set to false. Then, constructs where and . Note that by construction . Towards showing soundness, we define how to transform into such that is indeed the corresponding -solution up to of row constructed by . To this end, we define as follows: . Observe that is a -solution up to according to Definition 5. Moreover, by construction and Definition 6, is a corresponding -solution up to of . It remains to show, that indeed for any corresponding -solution up to (of , there is a corresponding -solution up to (of ). To this end, we define that is by construction according to Definition 5 indeed a corresponding -solution up to of . This concludes case (a).
Case (b): Atom is set to true. Conceptually, the case works analogously. This concludes cases (b) and (ii).
The remaining cases for nodes with (slightly easier) and nodes with , where we need to consider -row solutions at two different child nodes of , go through similarly. ∎
Lemma 4** (Completeness).**
Let be node of where and . Given a -row solution at node , and any corresponding -solution up to (of ). Then, there exists where is a -row solution at such that , and corresponding -solution up to (of ) that is compatible with .
Proof (Idea).
Since is a -row solution at , there is by Definition 6 a corresponding -solution up to .
We proceed again by case distinction. Assume that . Then we define , where is a sub-sequence of that does not contain and . Observe that all the conditions of Definition 5 are met and that . Then, we can easily define -row solution at according to Definition 6 by using . By construction of and by the definition of , we conclude that can be constructed with using . Moreover, -solution up to is indeed compatible with .
Assume that . The case is slightly easier as the one above, and the remainder works similar.
Similarly, one can show the result for the remaining node with , but define -row solutions for two preceding child nodes of . ∎
We are now in the position to proof our theorem.
Theorem 2.
The algorithm is correct. More precisely, the algorithm returns -TTD such that we can decide consistency of and even reconstruct the answer sets of :
[TABLE]
Proof (Idea).
By Lemma 3 we have soundness for every node and hence only valid rows as output of table algorithm when traversing the tree decomposition in post-order up to the root . By Proposition 4 we then know that we can reconstruct answer sets given -solutions up to . In more detail, we proceed by means of induction. For the induction base we only store -row solutions at a certain node starting at the leaves. For nodes with , obviously there is only the following (one) -row solution at : .
Then, by Lemma 3 we establish the induction step, since algorithm only creates -row solutions at every node , assuming that it gets -row solutions at for every child node of . As a result, if there is no answer set of , the table is empty. On the other hand, if there is an answer set of , we obtain a -row solution at root node , for which by Definition 6 a corresponding -solution up to exists. Further, in the induction step we ensured that -solutions up to for every -row solution at for every node can be found that are compatible to . In other words, by keeping track of corresponding origin -row solutions of we can combine interpretation positions of rows by following origin rows top-down in order to reconstruct only valid answer set.
Next, we establish completeness by induction starting from the root . Let therefore, be the -solution up to node . If does not exist for node , there is by definition no answer set of . Otherwise, by Definition 6, we know that for the root we can construct -row solutions at of the form for . We already established the induction step in Lemma 4 using and . As a consequence, we can reconstruct exactly all the answer sets of by following origin rows (see Definition of ) back to the leaves and combining interpretation parts , accordingly. Hence, we obtain some (corresponding) rows for every node . Finally, we stop at the leaves.
In consequence, we have shown both soundness and completeness. As a result, Theorem 2 is sustains. ∎
Corollary 2**.**
Algorithm returns -TTD such that:
[TABLE]
Proof.
The corollary follows from the proof of Theorem 2 applied up to node and by considering only rows that are involved in reconstructing answer sets (see Definition 2). ∎
Correctness of : Omitted proofs
In the following, we assume to be an instance of . Further, let be an -TTD of where , node , and .
Definition 8**.**
Table algorithm is referred to as admissible, if for each row of any node the following holds:
** 2. 2.
For any where and , we have 3. 3.
** 4. 4.
If or :
Note that the last condition is not a hard restriction, since the bags of the leaf and root nodes of a tree decomposition are defined to be empty anyway. However, it rather serves as technical trick simplifying proofs.
Observation 2**.**
Table algorithms and are admissible.
Proof.
Obviously, Conditions 1, 2, and 4 hold by construction of the table algorithms and by properties auf tree decompositions. For condition 3, we have to check for correctness and completeness, which has been shown [19] for algorithm . For , see Theorem 2 and Corollary 2. ∎
In the following, we assume that whenever occurs, is an admissible table algorithm.
Proposition 5**.**
* *
Proof.
Fill in Definition 8 with root of -TTD . ∎
The following definition is key for the correctness proof, since later we show that these are equivalent with the result of using purged table mapping .
Definition 9**.**
The projected answer sets count of below is the size of the union over projected interpretations of the satisfiable extensions of below , formally,
[TABLE]
.
The intersection projected answer sets count of below is the size of the intersection over projected interpretations of the satisfiable extensions of below , i.e.,
[TABLE]
.
In the following, we state definitions required for the correctness proofs of our algorithm . In the end, we only store rows that are restricted to the bag content to maintain runtime bounds. We define the content of our tables in two steps. First, we define the properties of so-called -solutions up to . Second, we restrict these solutions to -row solutions at .
Definition 10**.**
Let be a table with . We define a -solution up to to be the sequence .
Before we present equivalence results between and the recursive version used during the computation of , recall that and (Definition 9) are key to compute the projected answer sets count. The following corollary states that computing at the root actually suffices to compute , which is in fact the projected answer sets count of the input program.
Corollary 3**.**
[TABLE]
Proof.
The corollary immediately follows from Proposition 5 and since the cardinality of is at most one at root , by Definition 8. ∎
The following lemma establishes that the -solutions up to root of a given tree decomposition solve the PAs problem.
Lemma 5**.**
The value c=\sum_{\langle\hat{\rho}\rangle\text{ is a \mathbb{PROJ}-solution up to }n}\left|\mathcal{I}_{P}(\hat{\rho})\right| corresponds to the projected answer sets count of with respect to the set of projection atoms.
Proof.
(“”): Assume that c=\sum_{\langle\hat{\rho}\rangle\text{ is a \mathbb{PROJ}-solution up to }n}\left|\mathcal{I}_{P}(\hat{\rho})\right|. Observe that there can be at most one projected solution up to by Definition 8. If , then contains no rows. Hence, has no answer sets, c.f., Proposition 5, and obviously also no answer sets projected to . Consequently, is the projected answer sets count of . If we have by Corollary 3 that is equivalent to the projected answer sets count of with respect to .
(“”): The proof proceeds similar to the only-if direction. ∎
In the following, we provide for a given node and a given -solution up to , the definition of a -row solution at .
Definition 11**.**
Let be a -solution up to . Then, we define the -row solution at by .
Observation 3**.**
Let be a -solution up to a node . There is exactly one corresponding -row solution at .
Vice versa, let at be a -row solution at for some integer . Then, there is exactly one corresponding -solution up to .
We need to ensure that storing -row solutions at a node suffices to solve the PAs problem, which is necessary to obtain the runtime bounds as presented in Corollary 1. For the root node , this is sufficient, shown in the following.
Lemma 6**.**
There is a -row solution at the root if and only if the projected answer sets count of is larger than zero. Further, if there is a -row solution at root , then is the projected answer sets count of .
Proof.
(“”): Let be a -row solution at root where is an -table and is a positive integer. Then, by Definition 11 there also exists a corresponding -solution up to such that and . Moreover, by Definition 8, we have . Then, by Definition 10, . By Corollary 3, we have equals the projected answer sets count of . Finally, the claim follows.
(“”): The proof proceeds similar to the only-if direction. ∎
Before we show that -row solutions suffice, we require the following lemma.
Observation 4**.**
Let be a positive integer, , and , , , subsets of . The number of elements in the intersection over all sets is
[TABLE]
Proof.
We take the well-known inclusion-exclusion principle [26] and rearrange the equation. ∎
Lemma 7**.**
Let be a node of with and let be a -row solution at . Further, let be a partial mapping of (finally returned by ), which maps nodes of the sub-tree rooted at (excluding ) to -tables. Then,
** 2. 2.
for :
.
Proof (Sketch).
We prove the statement by simultaneous induction.
(“Induction Hypothesis”): Lemma 7 holds for the nodes in and also for node , but on strict subsets . (“Base Cases”): Let . Then by definition, . Recall that for the equivalence does not hold for leaves, but we use a node that has a node with as child for the base case. Observe that by definition of a tree decomposition such a node can have exactly one child. Then, we have that where is a -row solution at .
(“Induction Step”): We proceed by case distinction.
Assume that . Let be an introduced atom. We have two cases. Case (i) also belongs to , i.e., is not a projection atom; and Case (ii) also belongs to , i.e., is a projection atom. Assume that we have Case (i). Let be a -row solution at for some integer . As a consequence of admissible algorithm (see Definition 8) there can be many rows in the table for one row in the table , more precisely, . As a result, by applying Observation 3. We apply the inclusion-exclusion principle on every subset of the origins of in the definition of and by induction hypothesis we know that , therefore, . This concludes Case (i) for . The induction step for works similar by applying Observation 4 and comparing the corresponding -solutions up to or , respectively. Further, for showing the lemma for , one has to additionally apply the hypothesis for node , but on strict subsets of . Assume that we have Case (ii). We proceed similar as in Case (i), since Case (ii) is just a special case here, more precisely, we also have here.
Assume that . Let be a removed atom. We have two cases. Case (i) also belongs to , i.e., is not a projection atom; and Case (ii) also belongs to , i.e., is a projection atom. Assume that we have Case (i). Let be a -row solution at for some integer . As a consequence of admissible table algorithms (see Definition 8) there can be many rows in the table for one row in the table (and vice-versa). Nonetheless we still have , because by applying Observation 3. We apply the inclusion-exclusion principle on every subset of the origins of in the definition of and by induction hypothesis we know that , therefore, . This concludes Case (i) for . Again, the induction step for works similar, but swapped. Assume that we have Case (ii). Let be a -row solution at for some integer . Here we cannot ensure , since buckets fall together. However, by applying Observation 3 we have where the sequence consists of the tables of the children of . For every by induction hypothesis we know that . Hence, we apply the inclusion-exclusion principle over all subsets of for all independently. By construction . Then, by construction , where , since for the remaining terms is simply zero, including cases where different buckets are involved. This concludes Case (ii) for . Again, the induction step for works similar, but swapped by again applying Observation 4.
Assume that . We proceed similar to the introduce case. However, we have two -tables for the children of . Hence, we have to consider both sides when computing (see Definition of ). There we consider the cross-product of two -tables and we can also correctly apply the inclusion-exclusion principle on subsets of this cross-product, which we can do by simply multiplying -values accordingly. The multiplication is closely related to the join case in table algorithm . For this does not apply, since the inclusion-exclusion principle is carried out at the node and not for its children.
Since we outlined all cases that can occur for node , this concludes the proof sketch. ∎
Lemma 8** (Soundness).**
Let be a node of with . Then, each row at node constructed by table algorithm is also a -row solution for node .
Proof (Idea).
Observe that Listing 3 computes a row for each sub-bucket . The resulting row obtained by is indeed a -row solution for according to Lemma 7. ∎
Lemma 9** (Completeness).**
Let be node of where and . Given a -row solution at node . There exists where is set of -row solutions at such that .
Proof (Idea).
Since is a -row solution for , there is by Definition 11 a corresponding -solution up to such that .
We proceed again by case distinction. Assume that . Then we define . Then, for each subset , we define in accordance with Definition 11. By Observation 3, we have that is an -row solution at node . Since we defined the -row solutions for for all the respective -solutions up to , we encountered every -row solution for that is required for deriving via (c.f., Definitions of and of ).
Assume that . The case is slightly easier as the one above. We do not need to define a -row solution for for all subsets , since we only have to consider subsets here, with . The remainder works similar.
Similarly, one can show the result for the remaining node with , but define -row solutions for two preceding child nodes of . ∎
We are now in the position to proof our theorem.
Theorem 7**.**
The algorithm is correct. More precisely, the algorithm returns -TTD ) such that is the projected answer sets count of with respect to the set of projection atoms.
Proof.
By Lemma 8 we have soundness for every node and hence only valid rows as output of table algorithm when traversing the tree decomposition in post-order up to the root . By Lemma 6 we know that the projected answer sets count of is larger than zero if and only if there exists a certain -row solution for . This -row solution at node is of the form . If there is no -row solution at node , then since the table algorithm is admissible (c.f., Proposition 5). Consequently, we have . Therefore, is the projected answer sets count of with respect to in both cases.
Next, we establish completeness by induction starting from the root . Let therefore, be the -solution up to node , where for each row in , corresponds to an answer set of . By Definition 11, we know that for the root we can construct a -row solution at of the form for . We already established the induction step in Lemma 9. Hence, we obtain some (corresponding) rows for every node . Finally, we stop at the leaves.
In consequence, we have shown both soundness and completeness. As a result, Theorem 7 is sustains. ∎
Corollary 4**.**
The algorithm is correct and outputs for any instance of PAs its projected answer sets count.
Proof.
The result follows immediately, since consists of two dynamic programming passes , a purging step, and . For the soundness and completeness of we refer to other sources [19]. By Proposition 5, the “purging” step does neither destroy soundness nor completeness of . ∎
Proposition 2.
The algorithm is correct and outputs for any instance of PAs its projected answer sets count.
Proof.
This is a direct consequence of Corollary 4. ∎
Proposition 3.
The algorithm is correct and outputs for any instance of PAs its projected answer sets count.
Proof.
This is a direct consequence of Corollary 4. ∎
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1Aziz [2015] R. A. Aziz. Answer Set Programming: Founded Bounds and Model Counting . Ph D thesis, Department of Computing and Information Systems , The University of Melbourne, Sept. 2015.
- 2Balduccini et al. [2006] M. Balduccini, M. Gelfond, and M. Nogueira. Answer set based design of knowledge systems. Ann. Math. Artif. Intell. , 47(1-2):183–219, 2006.
- 3Baral and Gelfond [1994] C. Baral and M. Gelfond. Logic programming and knowledge representation. The Journal of Logic Programming , 19-20:73–148, 1994. Special Issue: Ten Years of Logic Programming.
- 4Ben-Eliyahu and Dechter [1994] R. Ben-Eliyahu and R. Dechter. Propositional semantics for disjunctive logic programs. Ann. Math. Artif. Intell. , 12(1):53–87, 1994. ISSN 1012-2443. doi: 10.1007/BF 01530761 .
- 5Bidoít and Froidevaux [1991] N. Bidoít and C. Froidevaux. Negation by default and unstratifiable logic programs. Theoretical Computer Science , 78(1):85–112, 1991. ISSN 0304-3975. doi: 10.1016/0304-3975(51)90004-7 .
- 6Biere et al. [2009] A. Biere, M. Heule, H. van Maaren, and T. Walsh, editors. Handbook of Satisfiability , volume 185 of Frontiers in Artificial Intelligence and Applications . IOS Press, Amsterdam, Netherlands, Feb. 2009. ISBN 978-1-58603-929-5.
- 7Bodlaender [1996] H. L. Bodlaender. A linear-time algorithm for finding tree-decompositions of small treewidth. SIAM J. Comput. , 25(6):1305–1317, 1996.
- 8Bodlaender and Kloks [1996] H. L. Bodlaender and T. Kloks. Efficient and constructive algorithms for the pathwidth and treewidth of graphs. J. Algorithms , 21(2):358–402, 1996.
