Various extensions of the basic Answer Set Programming language have been proposed by allowing more general atoms in rule bodies, for example aggregate atoms, HEX atoms, dl-atoms, generalized quantifiers, or abstract constraints. A number of semantics have been proposed for such programs, most notably the FLP semantics  and a number of coinciding semantics that we will collectively refer to as PSP semantics (from Pelov, Son, and Pontelli) [13, 17]. All of these semantics coincide with traditional ASP semantics when no generalized atoms are present. Moreover, they coincide on programs that have atomic rule heads and contain only monotonic generalized atoms. In  it is furthermore hinted that the semantics also coincide on programs that have atomic rule heads and contain only convex generalized atoms. However, no formal proof is available for this claim, and the informal explanation given in  is not as general as it could be, as we will show.
In this paper, we undertake a deeper investigation on the similarities and differences between the FLP and PSP semantics. In order to do this, we consider a simplified, yet expressive propositional language: sets of rules with atomic heads and bodies that are formed of a single “structure,” which are functions mapping interpretations to Boolean values111Note that (apart from the name) there is no connection to structures in first-order logic.
. Clearly, structures encompass atoms, literals, and conjunctions thereof, but can represent any propositional formula, generalized atom, or conjunctions of generalized atoms. Each structure has an associated domain, which is the set of propositional atoms on which the structure’s truth valuation depends. We can then classify the structures by their semantic properties, in particular, we will focus on the class of convex structures, which have single contiguous areas of truth in the lattice of interpretations. Convex structures include atoms and literals, and they are closed under conjunction (but not under negation or disjunction).
We first formally prove the claim that the FLP and PSP semantics coincide on programs with convex structures, as originally reported in . We will then move on to the main focus of this paper, trying to understand whether there is any larger class for which the semantics coincide. It is known that for programs with general structures all PSP answer sets are FLP answer sets, but not all FLP answer sets are PSP answer sets. The precise boundary for exhibiting the semantic difference is instead unknown.
We will approach this question using complexity arguments. Recently, we could show that convex structures form the precise boundary for a complexity jump in the polynomial hierarchy on cautious reasoning (but most other decision problems as well) for the FLP semantics. Cautious reasoning is -complete for the FLP semantics when allowing any non-convex structure and its variants (renaming atoms) in the input program, but it is -complete for convex structures. When considering the PSP semantics, cautious reasoning is also -complete when allowing any kind of structures in the input. This follows from a result in , and we provide an alternative proof in this paper. Analyzing this proof, it becomes clear that there is a different source of complexity for PSP than for FLP.
We then show that this different source of complexity also yields a different shape of the boundary for the complexity jump in PSP. Indeed, we first show that for a simple non-convex structure, cautious reasoning is still in for the PSP semantics, while the problem is -hard in the presence of this structure for the FLP semantics. It turns out that the same argument works for many non-convex structures, in particular, for all structures with a domain size bounded by a constant. The domain size therefore serves as a parameter that simplifies the complexity of the problem for the PSP semantics (unless the polynomial hierarchy collapses to its first level). This also means that the complexity boundary for PSP has a non-uniform shape, in the sense that an infinite number of different non-convex structures must be available for obtaining -hardness for cautious reasoning. This is in contrast to the FLP semantics, where the presence of a single non-convex structure is sufficient.
2 Syntax and Semantics
In this section we first introduce the syntax used in the paper. This is mainly based on the notion of structures, i.e., functions mapping interpretations into Boolean truth values. Then, we introduce few semantic notions and in particular we characterize structures in terms of monotonicity. Finally, we define the two semantics analyzed in this paper, namely FLP and PSP.
Let be a fixed, countable set of propositional atoms. An interpretation is a subset of . A structure on is a mapping of interpretations into Boolean truth values. Each structure has an associated, finite domain , indicating those atoms that are relevant to the structure.
A structure modeling a conjunction () of propositional atoms is such that and, for every interpretation , maps to true if and only if .
A structure modeling a conjunction () of literals, where are propositional atoms and denotes negation as failure, is such that and, for every interpretation , maps to true if and only if and .
A structure modeling an aggregate (), where are propositional atoms, is such that and, for every interpretation , maps to true if and only if .
A general rule is of the following form:
where is a propositional atom in referred as the head of , and is a structure on called the body of . A general program is a set of general rules.
Let map to true any interpretation such that , and let map to true any interpretation such that . Hence, program is equivalent to the following program with aggregates:
Note that no particular assumption is made on the syntax of rule bodies; in the case of normal propositional logic programs these structures are conjunctions of literals. We assume that structures are closed under propositional variants, that is, if is a structure, for any bijection , also is a structure, and the associated domain is .
Consider and from Example 2, and a bijection such that . Hence, , that is, is a variant of .
Given a set of structures , by datalog we refer to the class of programs that may contain only the following rule bodies: structures corresponding to conjunctions of atoms, any structure , or any of its variants .
For every , let denote the structure from Example 1. The class of normal datalog programs is datalog.
Note that this syntax does not explicitly allow for negated structures. One can, however, choose the complementary structure for simulating negation. This would be akin to the “negation as complement” interpretation of negated aggregates that is prevalent in the literature.
Let be an interpretation. is a model for a structure , denoted , if maps to true. Otherwise, if maps to false, is not a model of , denoted . We require that atoms outside the domain of are irrelevant for modelhood, that is, for any interpretation and it holds that if and only if . Moreover, for any bijection , let , and we require that if and only if . is a model of a rule of the form (1), denoted , if whenever . is a model of a program , denoted , if for every rule .
Consider program from Example 2. It can be observed that and (both rules have true bodies but false heads), while and .
Structures can be characterized in terms of monotonicity as follows.
Definition 1 (Monotone Structures)
A structure is monotonic if for all pairs of interpretations such that , implies .
Definition 2 (Antimonotone Structures)
A structure is antimonotonic if for all pairs of interpretations such that , implies .
Definition 3 (Convex Structures)
A structure is convex if for all triples of interpretations such that , and implies .
Note that monotonic and antimonotonic structures are convex. Moreover, note that convex structures are closed under conjunction (but not under disjunction or negation).
Definition 4 (FLP Reduct)
The FLP reduct of a program with respect to is defined as the set .
Definition 5 (FLP Answer Sets)
is an FLP answer set of if and for each it holds that .
Consider program from Example 2 and the interpretation . The reduct is . Since is a minimal model of the reduct, is an FLP answer set of . Similarly, it can be observed that is another FLP answer set. Actually, these are the only FLP answer sets of the program.
We will next describe a different semantics, using the definition of , called “fixpoint answer set” in that paper. Theorem 3 in  shows that it is actually equivalent to the two-valued fix-point of ultimate approximations of generalized atoms in 222There is an even closer relationship, as the operator of  coincides with defined in , as shown in the appendix of , and therefore with stable models for ultimate approximations of aggregates as defined in . We will refer to it as PSP to abbreviate Pelov/Son/Pontelli, the names most frequently associated with this semantics.
Definition 6 (Conditional Satisfaction)
A structure on is conditionally satisfied by a pair of interpretations , denoted , if for each such that .
Definition 7 (PSP Answer Sets)
An interpretation is a PSP answer set if is the least fixpoint of the following operator:
Consider program from Example 2 and the interpretation . The least fixpoint of is . In fact, and , hence , while and thus and . Therefore, is a PSP answer set. Also is a PSP answer set.
On programs considered in this paper, PSP answer sets also coincide with “answer sets” defined in  (by virtue of Proposition 10 in ) and “well-justified FLP answer sets” of  (by virtue of Theorem 5 in ). The latter is particularly interesting, as it is defined by first forming the FLP reduct. Indeed, as shown in , the operator can be equivalently defined as follows:
There are several other semantic definitions on programs that have some restrictions on the admissible structures, which also coincide with the PSP semantics on programs as defined in this paper with the respective structure restriction. Examples are  for monotonic structures (that are also allowed to occur in rule heads in that paper), or  that allows for structures corresponding to cardinality and weight constraints and largely coincide with the PSP semantics (see  for a discussion on structures on which the semantics coincides).
In this paper we are mainly interested in cautious reasoning, defined next.
Definition 8 (Cautious Reasoning)
A propositional atom is a cautious consequence of a program under FLP (resp. PSP) semantics, denoted (resp. ), if belongs to all FLP (resp. PSP) answer set of .
Consider program from Example 2. We have and , and similar for PSP semantics. If we add and to the program, then there is only one FLP answer set, namely , and no PSP answer sets. In this case and are cautious consequences of the program (under both semantics).
3 Exploring the Relationship between the FLP and PSP Semantics
In this section, we examine in detail how the FLP and PSP semantics relate. We shall proceed in three steps. First, we formally prove that FLP and PSP semantics coincide on programs with convex structures in Section 3.1. Next, we turn towards complexity as a tool to understand whether there can be any larger class of coinciding programs. We start in Section 3.2 with a result that shows that programs without restrictions exhibit the same complexity under both FLP and PSP semantics. However, it is known that the semantics do not coincide for programs without restrictions, and we examine the complexity proofs to highlight the different complexity sources. These findings are then applied in Section 3.3 in order to identify programs with bounded non-convex structures, on which the complexities for FLP and PSP semantics differ. Under usual complexity assumptions, this also implies that programs with convex aggregates is the largest class of programs on which FLP and PSP coincide.
3.1 Unison: Convex Structures
In this section we show that for programs with convex aggregates the FLP and PSP semantics coincide. In  it is stated that many semantics (and in particular, FLP and PSP) “agree on […] programs with convex aggregates” because “they can be regarded as special programs with monotone constraints.” However, the comment on regarding convex aggregates as monotone constraints relies on a transformation described in  that transforms convex structures into conjunctions of positive and negated monotone constraints. Since our language does not explicitly allow negation, and in particular since convex structures are not closed under negation, we next prove in a more direct manner that the FLP and PSP semantics coincide on convex structures.
Let be program whose body structures are convex, and let be an interpretation. is an FLP answer set of if and only if is an PSP answer set of .
The left implication follows from Theorem 2 in . For the right implication, let be an FLP answer set of . Let , for , and let be the fixpoint of this sequence. Since is a minimal model of by definition of FLP answer set, we can prove the claim by showing (i) and (ii) .
(i) Consider a rule such that . We have to show . Since , holds. Thus, and therefore .
(ii) We prove for each . We use induction on . The base case is trivially true as . Suppose for some in order to prove . By definition of , for each there is such that and . Thus, , which implies . ∎
Therefore, programs with convex structures form a class of programs for which the FLP and PSP semantics coincide. In the following, we will show that it is likely also the largest class for which this holds.
3.2 Consonance: Complexity of Unrestricted Structures
In this section we will examine the computational impact of allowing non-convex structures. We will limit ourselves to structures for which the truth value with respect to an interpretation can be determined in polynomial time. Moreover, we will focus on cautious reasoning, but similar considerations apply also to related problems such as brave reasoning, answer set existence, or answer set checking.
It is known that cautious reasoning over programs with arbitrary structures under the FLP semantics is -complete in general, as shown in . Pelov has shown -completeness for deciding the existence of PSP answer sets in , from which -completeness for cautious reasoning under the PSP semantics can be derived. We formally state this result now and provide a different proof than Pelov’s that will more directly lead to the subsequent considerations.
Cautious reasoning under PSP semantics is -complete.
Membership follows by Corollary 1 of . For the hardness, we provide a reduction from 2-QBF. Let , where is in 3CNF. Formula is equivalent to , where , and is a 3DNF equivalent to and obtained by applying De Morgan’s laws. To prove the claim we construct a program such that ( a fresh atom) if and only if is valid, i.e., iff is invalid.
Let , for some . Program is the following:
where is defined recursively as follows:
and for all ;
and for all .
Note that structure can also be encoded by means of a sum aggregate as shown in .
Rules (3.2)–(3.2) force each PSP answer set of to contain at least one of , (), and one of , (), respectively, encoding an assignment of the propositional variables in . Rules (3.2) are used to simulate universality of the variables, as described later. Having an assignment, rule (3.2) derives if the assignment satisfies some disjunct of (and hence also itself). Finally, rule (3.2) derives if is false.
We first show that not valid implies . If is not valid, is valid. Hence, there is an assignment for such that no extension to satisfies , i.e., all these extensions satisfy . Let us consider the following interpretation (which is also a model of ):
We claim that is a PSP answer set of . In fact, because of rules (3.2) in . Since any assignment for the s satisfies at least a disjunct of , from rule (3.2) we derive . Hence, rules (3.2) force all atoms to belong to , which is thus the least fixpoint of and coincides with .
Now we show that implies that is not valid. To this end, let be a PSP answer set of such that . Hence, by rule (3.2) we have that . From and rules (3.2), we have for all . And contains either or for because of rules (3.2). Suppose by contradiction that is valid. Thus, for all assignments of , there is an assignment for such that is true, i.e., is false. We can show that the least fixpoint of is . In fact, cannot be derived because . We thus have a contradiction with the assumption that is a PSP answer set of . ∎
It is also known that the complexity drops to if structures in body rules are constrained to be convex. This appears to be “folklore” knowledge and can be argued to follow from results in . An easy way to see membership in is that all convex structures can be decomposed into a conjunction of a monotonic and an antimonotonic structure, for which membership in has been shown in .
The fundamental tool in the FLP hardness proofs is the availability of structures that allow for encoding “need to have either atom or , or both of them, but the latter only upon forcing the truth of both atoms.” have domains and the following satisfaction patterns:
The reductions then use these structures in a similar way than disjunction is used in the classic -hardness proofs in . In particular, the same structures are used for all instances to be reduced.
On the other hand, in the PSP hardness proofs, one dedicated structure is used for each instance of the problem reduced from (2QBF in Theorem 3.2). Indeed, a construction using structures as described earlier is not feasible for PSP, because and . This is because there is one satisfaction “hole” between and for both and . In the next section, we will exploit this difference.
3.3 Dissonance: Complexity of Non-convex Structures with Bounded Domains
In this section, we look more carefully at programs with non-convex structures and identify computational differences between the FLP and PSP semantics. In  it has been shown that any non-convex structure (plus all of its variants) can be used in order to implement and . This result makes it clear that the presence of any non-convex structure that is closed under variants causes a complexity increase for the FLP semantics (unless the polynomial hierarchy collapses). From the above considerations, it is immediately clear that the same construction is not feasible for PSP. It turns out that also no alternative way exists to obtain a similar result, and that the difference in the -hardness proofs for FLP and PSP is intrinsic.
We start by considering a simple non-convex structure Å with and if and only if . Therefore, Å behaves like a cardinality constraint .
Deciding whether an interpretation is a PSP answer set of a datalog program is feasible in polynomial time, in particular , where is the number of rules in .
For any interpretation, testing whether (for a variant of Å) can be done by examining and and returning false if either one of , is 1, or if and . Alternatively, in a less syntax dependent way, one can test whether and for each . Since there are at most 4 different for each , either method is feasible in constant time.
For determining whether is a PSP answer set of , we can check whether it is the least fixpoint of . Computing the least fixpoint takes at most applications of (where is the number of rules in ). Each application of involves in turn at most tests for . ∎
Given Proposition 1 it follows that cautious reasoning is still in for datalog programs under the PSP semantics.
Given a datalog program and an atom , deciding is in .
It follows that for datalog cautious reasoning (and also answer set existence and brave reasoning) is more complex for the FLP semantics than for the PSP semantics (unless the polynomial hierarchy collapses to its first level).
Examining this result and its proof carefully, we can see that it depends on the fact that each contains 2 elements and therefore at most 4 satisfaction tests are needed to determine . Indeed, we can apply similar reasoning whenever the domains of involved structures are smaller than a given bound.
Let be a program. If is an upper bound for the domain size of any structure occurring in , then checking whether a given interpretation is a PSP answer set of is decidable in , where is the number of rules in and is the polynomial function (in terms of the input size ) bounding determining satisfaction of any aggregate in .
We show that the least fixpoint of can be computed in time . In the worst case, each application of the operator derives at most one new atom, and thus the fixpoint is reached after at most applications of the operator. Each application requires at most the evaluation of all rules of , and thus at most rule evaluations are sufficient. To evaluate a rule, the truth of the body has to be checked w.r.t. at most interpretations (similar to Proposition 1, in which ), each requiring time. We thus obtain the bound . ∎
This means that actually most languages with non-convex structures exhibit a complexity gap between the FLP and PSP semantics. There is a uniformity issue here, which we informally noted earlier when examining the -hardness proof for cautious reasoning under PSP. We can now formalize this, as it follows from Theorem 3.3 that we need an infinite number of inherently different non-convex structures in order to obtain hardness.
Let be any finite set of structures, possibly including non-convex structures. Cautious reasoning over datalog is in under the PSP semantics.
This means that there is also a clear difference in uniformity between the complexity boundary of the FLP and the PSP semantics, respectively. It also means that it is impossible to simulate the FLP semantics in a compact way using the PSP semantics on the class of programs with bounded domain structures, unless the polynomial hierarchy collapses to its first level. The general picture of our complexity results is shown in Figure 1. We can see that the complexity transition from to is different for the FLP and PSP semantics, respectively. The solid line between convex and non-convex structures denotes a crisp transition for FLP, while the dashed line between bounded non-convex and unbounded non-convex structures is a rougher transition.
Looking at Figure 1, the transition from to appears somewhat irregular for PSP, as the availability of single non-convex structures does not cause the transition, but only their union. However, in practice the availability of an infinite number of different structures is not unusual: indeed, if aggregates are considered, the presence of one aggregate function and suitable comparison relations usually gives rise to such an infinite repertoire of structures.
Consider the availability of over any set of atoms and the comparison relation . The structures generated by aggregates of the form do not have a bound on the domains of non-convex aggregates. Indeed, for any structure , which is non-convex and for which the domain size is , one can formulate also , which is also non-convex and has a larger domain.
However, as noted earlier, for expressing -hard problems, one needs a non-uniform approach for PSP, in the sense that a dedicated aggregate has to be formulated for each problem instance, whereas for FLP one can re-use the same aggregates for all problem instances.
In practical terms, our results imply that for programs containing only convex structures, techniques as those presented in  for FLP can be used for computing answer sets also for PSP, and techniques presented for PSP can be used for FLP in turn. It also means that this is the largest class for which this can be done with currently available methods in an efficient way. There are several examples for convex structures that are easy to identify syntactically: count aggregates with equality guards, sum aggregates with positive summands and equality guards, dl-atoms that do not involve and rely on a tractable Description Logic . However many others are in general not convex, for example sum aggregates that involve both positive and negative summands, times aggregates that involve the factor 0, average aggregates, dl-atoms with , and so on. It is still possible to find special cases of such structures that are convex, but that requires deeper analyses.
The results also immediately imply impossibility and possibility results for rewritability: unless the polynomial hierarchy collapses to its first level, it is not possible in the FLP semantics to rewrite a program with non-convex structures into one containing only convex structures (for example, a program not containing any generalized atoms), unless disjunction or similar constructs are allowed in rule heads. On the other hand, such rewritings are possible for the PSP semantics if the non-convex structures are guaranteed to have bounded domains. This seems to be most important for dl-programs, where such rewritings are sought after.
The semantics considered in this paper encompass several approaches suggested for programs that couple answer set programming with description logics. The approaches presented in  and  directly employ the FLP semantics, while the approach of  is shown to be equivalent to the PSP semantics. There are other proposals, such as , which appears to be different from both FLP and PSP already on convex structure. In future work we plan to relate also these other semantics with FLP and PSP and attempt to identify the largest coinciding classes of programs.
Alviano, M., Calimeri, F., Faber, W., Leone, N., Perri, S.: Unfounded Sets and Well-Founded Semantics of Answer Set Programs with Aggregates. Journal of Artificial Intelligence Research 42, 487–527 (2011)
-  Alviano, M., Faber, W.: The complexity boundary of answer set programming with generalized atoms under the flp semantics. In: Cabalar, P., Tran, S.C. (eds.) Logic Programming and Nonmonotonic Reasoning — 12th International Conference (LPNMR 2013). Springer Verlag (Sep 2013), accepted for publication
-  Eiter, T., Gottlob, G.: On the Computational Cost of Disjunctive Logic Programming: Propositional Case. Annals of Mathematics and Artificial Intelligence 15(3/4), 289–323 (1995)
-  Eiter, T., Ianni, G., Lukasiewicz, T., Schindlauer, R., Tompits, H.: Combining answer set programming with description logics for the semantic web. Artif. Intell. 172(12–13), 1495–1539 (2008)
-  Eiter, T., Ianni, G., Schindlauer, R., Tompits, H.: A Uniform Integration of Higher-Order Reasoning and External Evaluations in Answer Set Programming. In: International Joint Conference on Artificial Intelligence (IJCAI) 2005. pp. 90–96. Edinburgh, UK (Aug 2005)
-  Faber, W., Leone, N., Pfeifer, G.: Recursive aggregates in disjunctive logic programs: Semantics and complexity. In: Alferes, J.J., Leite, J. (eds.) Proceedings of the 9th European Conference on Artificial Intelligence (JELIA 2004). Lecture Notes in AI (LNAI), vol. 3229, pp. 200–212. Springer Verlag (Sep 2004)
-  Faber, W., Leone, N., Pfeifer, G.: Semantics and complexity of recursive aggregates in answer set programming. Artificial Intelligence 175(1), 278–298 (2011), special Issue: John McCarthy’s Legacy
-  Ferraris, P.: Answer Sets for Propositional Theories. In: Baral, C., Greco, G., Leone, N., Terracina, G. (eds.) Logic Programming and Nonmonotonic Reasoning — 8th International Conference, LPNMR’05, Diamante, Italy, September 2005, Proceedings. Lecture Notes in Computer Science, vol. 3662, pp. 119–131. Springer Verlag (2005)
-  Liu, L., Pontelli, E., Son, T.C., Truszczyński, M.: Logic programs with abstract constraint atoms: The role of computations. Artificial Intelligence 174(3–4), 295–315 (2010)
-  Liu, L., Truszczyński, M.: Properties and applications of programs with monotone and convex constraints. Journal of Artificial Intelligence Research 27, 299–334 (2006)
-  Lukasiewicz, T.: A novel combination of answer set programming with description logics for the semantic web. IEEE Transactions on Knowledge and Data Engineering 22(11), 1577–1592 (2010)
-  Marek, V.W., Niemelä, I., Truszczyński, M.: Logic Programming with Monotone Cardinality Atom. In: Lifschitz, V., Niemelä, I. (eds.) Proceedings of the 7th International Conference on Logic Programming and Non-Monotonic Reasoning (LPNMR-7). LNAI, vol. 2923, pp. 154–166. Springer (Jan 2004)
-  Pelov, N.: Semantics of Logic Programs with Aggregates. Ph.D. thesis, Katholieke Universiteit Leuven, Leuven, Belgium (Apr 2004)
-  Pelov, N., Denecker, M., Bruynooghe, M.: Well-founded and Stable Semantics of Logic Programs with Aggregates. Theory and Practice of Logic Programming 7(3), 301–353 (2007)
-  Shen, Y.D., Wang, K.: FLP semantics without circular justifications for general logic programs. In: Hoffmann, J., Selman, B. (eds.) Proceedings of the 26th AAAI Conference on Artificial Intelligence (AAAI-12) (Jul 2012)
-  Simons, P., Niemelä, I., Soininen, T.: Extending and Implementing the Stable Model Semantics. Artificial Intelligence 138, 181–234 (Jun 2002)
-  Son, T.C., Pontelli, E.: A Constructive Semantic Characterization of Aggregates in ASP. Theory and Practice of Logic Programming 7, 355–375 (May 2007)
-  Son, T.C., Pontelli, E., Tu, P.H.: Answer Sets for Logic Programs with Arbitrary Abstract Constraint Atoms. Journal of Artificial Intelligence Research 29, 353–389 (2007)