Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Law of thought wikipedia , lookup
Model theory wikipedia , lookup
Propositional calculus wikipedia , lookup
Quantum logic wikipedia , lookup
Mathematical logic wikipedia , lookup
Combinatory logic wikipedia , lookup
Laws of Form wikipedia , lookup
Intuitionistic logic wikipedia , lookup
TLP 9 (4): 529–564, 2009. C 2009 Cambridge University Press doi:10.1017/S1471068409990056 First published online 16 June 2009 529 Printed in the United Kingdom Characterizations of stable model semantics for logic programs with arbitrary constraint atoms YI-DONG SHEN State Key Laboratory of Computer Science, Institute of Software, Chinese Academy of Sciences, Beijing 100190, China (e-mail: [email protected]) JIA-HUAI YOU and LI-YAN YUAN Department of Computing Science, University of Alberta, Edmonton, Alberta, T6G 2H1 Canada (e-mail: {you,yuan}@cs.ualberta.ca) submitted 22 March 2008; revised 1 Dec 2008, 29 March 2009; accepted 28 April 2009 Abstract This paper studies the stable model semantics of logic programs with (abstract) constraint atoms and their properties. We introduce a succinct abstract representation of these constraint atoms in which a constraint atom is represented compactly. We show two applications. First, under this representation of constraint atoms, we generalize the Gelfond–Lifschitz transformation and apply it to define stable models (also called answer sets) for logic programs with arbitrary constraint atoms. The resulting semantics turns out to coincide with the one defined by Son et al. (2007), which is based on a fixpoint approach. One advantage of our approach is that it can be applied, in a natural way, to define stable models for disjunctive logic programs with constraint atoms, which may appear in the disjunctive head as well as in the body of a rule. As a result, our approach to the stable model semantics for logic programs with constraint atoms generalizes a number of previous approaches. Second, we show that our abstract representation of constraint atoms provides a means to characterize dependencies of atoms in a program with constraint atoms, so that some standard characterizations and properties relying on these dependencies in the past for logic programs with ordinary atoms can be extended to logic programs with constraint atoms. KEYWORDS: answer set programing, abstract constraint atoms, stable model semantics, Gelfond–Lifschitz transformation 1 Introduction Answer set programing (ASP) as an alternative logic programing paradigm has been demonstrated to be an effective knowledge representation formalism for solving combinatorial search problems arising in many application areas such as planning, reasoning about actions, diagnosis, abduction, and so on (Marek and Truszczynski 1999; Niemela 1999; Gelfond and Leone 2002; Lifschitz 2002; Baral 2003). In recent years, researchers have paid particular attention to extensions of ASP with means to model aggregate constraints in particular, and constraints on sets in general (Denecker et al. 2001; Simons et al. 2002; Dell’Armi et al. 2003; Pelov et al. 530 Y.-D. Shen et al. 2003; Elkabani et al. 2004; Faber et al. 2004; Marek and Remmel 2004; Marek and Truszczynski 2004; Pelov 2004; Pelov and Truszczynski 2004; Calimeri et al . 2005; Elkabani et al. 2005; Ferraris 2005; Liu and Truszczynski 2005; Liu and Truszczynski 2006; Son et al. 2006; Liu et al. 2007; Pelov et al. 2007; Shen and You 2007; Son and Pontelli 2007; Son et al. 2007; Marek et al. 2008). Logic programs with constraint atoms were introduced as a general framework for representing, and reasoning with, sets of atoms (Marek and Remmel 2004; Marek and Truszczynski 2004; Marek et al. 2008). This is in contrast with traditional logic programs, which are used primarily to reason with individuals. The abstract form of a constraint atom takes the form (D, C), where D is a finite set of atoms and C a collection of subsets from the power set of D, which expresses a constraint on the domain D with the collection C of admissible solutions. By allowing constraint atoms to appear anywhere in a rule, the framework of logic programs has become a highly expressive knowledge representation language. For example, many constraints can be conveniently and compactly represented with constraint atoms such as weight and cardinality constraints and aggregates (see, e.g., Denecker et al. 2001; Simons et al. 2002; Dell’Armi et al. 2003; Faber et al. 2004; Marek and Truszczynski 2004; Pelov 2004; Calimeri et al. 2005). In fact, any constraint studied in the context of constraint satisfaction problem (CSP) can be represented by a constraint atom. In this way, the framework of logic programs with constraint atoms can express complex constraint satisfaction problems, such as those involving conditional constraints (Mittal and Falkenhainer 1990) (called dynamic CSPs), which are useful in modeling configuration and design problems. When the head of a rule is allowed to be a disjunction of constraint atoms, logic programs become capable of expressing, not only conditional constraints, but also disjunctive constraints, both of which have been investigated by the constraint programing community outside of logic programing (see, e.g., Baptistie and Pape 1996; Cohen et al. 2000; Marriott et al. 2001). For example, disjunctive constraints have been widely used in scheduling to ensure that the time intervals over which activities require the same resource do not overlap in time (Baptiste and Pape 1996). Although practical ASP languages and systems typically incorporate concrete, predefined constraint atoms, such as weight constraint atoms (Simons et al. 2002) and aggregate atoms (Dell’Armi et al. 2003), the adoption of the abstract form of constraint atoms has made it possible to study the semantics and properties of these programs in an abstract setting. In this paper, we characterize and define stable models for logic programs with constraint atoms by introducing a succinct abstract representation of constraint atoms. In the current literature as mentioned above, a constraint atom is expressed as a pair (D, C), where D is a finite set of ground atoms and C a collection of sets of atoms in D. We call this a power set form representation (w.r.t. D) of constraint atoms, as C may involve the whole power set 2D of D. This is the case even for special classes of constraint atoms such as monotone constraint atoms (a constraint atom (D, C) is monotone if for any S ⊂ D, whenever S ∈ C all of its supersets in 2D are in C). Characterizations of stable model semantics for constraint programs 531 For instance, suppose we have a monotone constraint atom A1 = (D, 2D ). Semantically, this constraint atom is a tautology, since for any set I of atoms, it is a fact that I satisfies A1 , in the sense that I ∩ D ∈ 2D . A clever representation would just need to express two pieces of information, the “bottom element” ∅ and the “top element” D; two elements together implicitly cover all the sets in between. So, instead of using the power set representation to express all the admissible solutions of this constraint atom, we could use a pair of sets. As another example, consider a monotone constraint atom A2 = (D, 2D \ {∅}). A minimal element (set inclusive) in 2D \ {∅} is a singleton in 2D . In this case, any minimal element B in 2D and D form a pair with B being the bottom element and D being the top. So, we could represent this constraint atom by a collection of pairs, one for each singleton in D. The number of such pairs in this case equals to the size of D. In this paper, we introduce such an abstract representation. In general, the abstract representation of a constraint atom (Ad , Ac ) is expressed as (Ad , A∗c ), where A∗c consists of what will be called abstract prefixed power sets, denoted W V , with W , V ⊆ Ad and W ∩ V = ∅. Intuitively, W V represents a collection of sets of the form W ∪ S with S ∈ 2V , all of which are in Ac . The abstract representation of constraint atoms not only yields a compact representation, but also captures the essential information embodied in constraint atoms appearing in the bodies of rules. To substantiate this claim, we show two applications. In the first application, we restore the power of the Gelfond–Lifschitz transformation by generalizing it for logic programs with constraint atoms. The key idea is that given an interpretation I, each constraint atom A = (Ad , A∗c ) under our abstract representation can be concisely characterized by a set of abstract satisfiable sets of the form W V ∈ A∗c such that W V covers I ∩ Ad . Therefore, the standard Gelfond–Lifschitz transformation can be naturally generalized to logic programs with constraint atoms by representing each constraint atom by its abstract satisfiable sets. We then use the generalized Gelfond–Lifschitz transformation to define stable models for disjunctive logic programs with constraint atoms. It turns out that, for nondisjunctive logic programs with arbitrary constraint atoms, the stable models defined this way are precisely those defined by Son et al. (2006, 2007) for logic programs with arbitrary constraint atoms, and the equivalent semantics, called the ultimate stable semantics, for aggregate logic programs (Denecker et al. 2001). These semantics are defined by a substantially different approach, the fixpoint approach. One advantage of our approach is that the semantics is defined for disjunctive programs where a constraint atom can appear anywhere in a disjunctive rule. This is due to the power of the Gelfond–Lifschitz transformation. Roughly speaking, for a nondisjunctive program with constraint atoms, a stable model M is just the least model of the reduct by the generalized Gelfond–Lifschitz transformation, while for a disjunctive program with constraint atoms, a stable model M is a minimal model of the reduct. We show that logic programs whose constraint atoms appearing in disjunctive rule heads are elementary possess the minimality property; i.e., for such logic programs, all stable models under the generalized 532 Y.-D. Shen et al. Gelfond–Lifschitz transformation are minimal models. Thus, by the known relationships among different definitions of stable models, the stable model semantics defined in this paper extends the semantics of conventional disjunctive logic programs (Gelfond and Lifschitz 1991), the semantics defined by Marek and Truszczynski (2004) for nondisjunctive logic programs with monotone constraint atoms, the semantics by Son et al. (2006, 2007), and others equivalent to it (Denecker et al. 2001; Pelov et al. 2003). We note that disjunctive programs with aggregates have been studied previously by Faber et al. (2004) and Pelov and Truszczynski (2004), where aggregates do not appear in the heads of program rules. In the second application, we show that our abstract representation of constraint atoms provides a means to characterize the dependency relation among ordinary atoms in a program with constraint atoms. This dependency relation in the past is defined using a dependency graph. One question for logic programs with constraint atoms is how this dependency graph may be constructed so that the means to characterize the properties of programs by odd cycles, even cycles, call-consistency, acyclic programs in the traditional context is applicable to the new context. We show that the information captured in our abstract representation is essential in constructing the dependency graph for a program with constraint atoms. As we will see, this is due to a simple way to represent a logic program with constraint atoms by a normal logic program. To summarize, the main contributions of this paper are: • We introduce an abstract representation of constraint atoms, independently of any programs in which they appear. • Using this abstract representation, we present a generalized form of Gelfond– Lifschitz transformation and apply it to define stable models for disjunctive logic programs with constraint atoms. For nondisjunctive programs, the semantics defined this way coincides with the one based on conditional satisfaction (Son et al. 2006, 2007), and with the ones equivalent to it (Denecker et al. 2001). • We show that our abstract representation of constraint atoms encodes the information needed to capture the atom dependency relation in a given program, thus the means to characterize the properties for normal programs can still be applied to programs with constraint atoms, and in the process, the unfolding approach (Son and Pontelli 2007) is made simple. The paper is structured as follows. Following the preliminaries in the next section, in Section 3 we present our abstract representation of constraint atoms. In Section 4, we show some characterization of constraint atoms under this abstract representation. In Section 5, we introduce a generalized Gelfond–Lifschitz transformation and apply it to define stable models for disjunctive logic programs with constraint atoms. In Section 6, we prove the relationship of our approach with Son et al. (2006)’s fixpoint approach. Then in Section 7, we show that our abstract representation of constraint atoms encodes precisely the needed information to define the dependency graph of a program with constraint atoms. In Section 8, we Characterizations of stable model semantics for constraint programs 533 discuss the related approaches. Finally in Section 9, we provide conclusions and discuss future work. Proofs of theorems and lemmas will be delayed to Appendix. Some results of this paper have been reported in (Shen and You 2007). The current paper, however, contains substantial new results. 2 Preliminaries We consider propositional (ground) logic programs and assume a fixed propositional language with a countable set V of propositional atoms (atoms for short). Any subset I of V is called an interpretation. A literal is an atom A (a positive literal) or its negation not A (a negative literal). For a set S = {A1 , . . . , Am } of atoms, we use not S to denote {not A1 , . . . , not Am } and |S| to denote the size of S. For convenience, when S appears in a logic expression, it represents a conjunction A1 ∧ . . . ∧ Am ; when not S appears in a logic expression, it represents a conjunction not A1 ∧ . . . ∧ not Am . An abstract constraint atom (or c-atom following Son et al. 2006, 2007) A is a pair (D, C), where D is a finite set of atoms in V and C a collection of sets of atoms in D, i.e., C ⊆ 2D . For convenience, we use Ad and Ac to refer to the components D and C of A, respectively. As a general framework, c-atoms can be used to represent any constraints with a finite set Ac of admissible solutions over a finite domain Ad . A c-atom A is elementary if it is of the form ({a}, {{a}}), where a is an atom. Due to the equivalence in satisfaction, an elementary c-atom may be simply written by the atom in it. A is monotone if it has the property that for any S ⊂ Ad , if S ∈ Ac then all of its supersets in 2Ad are in Ac . A is nonmonotone if it is not monotone. A is antimonotone if Ac is closed under subsets, i.e., for every X, Y ⊆ Ad , if Y ∈ Ac and X ⊆ Y then X ∈ Ac . A is convex if for any S1 , S, S2 ⊆ Ad such that S1 ⊆ S ⊆ S2 and S1 , S2 ∈ Ac , we have S ∈ Ac . A disjunctive constraint program, or a disjunctive (logic) program with c-atoms, is a finite set of rules of the form H1 ∨ . . . ∨ Hk ← A1 , . . . , Am , not B1 , . . . , not Bn where k > 1, m, n > 0 and Hi , Ai and Bi are either an atom or a c-atom (“←” is omitted when m = n = 0). P is a normal constraint program if k = 1 for all of its rules; P is a positive constraint program if n = 0 for all of its rules; P is a positive basic program if n = 0 and k = 1 with H1 being an elementary c-atom for all of its rules. As usual, P is a normal program if P is a normal constraint program where all c-atoms are elementary; P is a disjunctive program if P is a disjunctive constraint program where all c-atoms are elementary. In the sequel, if not specifically quantified, a logic program (or simply a program) refers to a disjunctive constraint program. To make it explicit, when a program contains only elementary c-atoms, it may be called a program with ordinary atoms, or just a program without c-atoms. Let r be a rule of the above form. We define head(r) = {H1 , . . . , Hk } body(r) = {A1 , . . . , Am , not B1 , . . . , not Bn } 534 Y.-D. Shen et al. which will be referred to as the head and the body of the rule, respectively, where body(r) denotes the conjunction of the elements in the set and head(r) the disjunction. Without confusion, we may use the set notation in a rule to express the body as well as the head. For example, given a rule r, we may write head(r) ← body(r). We will use At(P ) to denote the set of atoms that appear in a program P . The satisfaction relation is defined as follows. An interpretation I ⊆ V satisfies an atom a if a ∈ I; not a if a ∈ I. I satisfies a c-atom A if I ∩ Ad ∈ Ac ; not A if I ∩ Ad ∈ Ac . This relation extends to arbitrary expressions F mentioning negation not, conjunction ∧ and disjunction ∨, in a usual way. We will use I |= F to denote that I satisfies F, and I |= F to denote that I does not satisfy F. We say F is true (resp. false) in I if and only if I satisfies (resp. does not satisfy) F. I satisfies a rule r if it satisfies head(r) or it does not satisfy body(r). I is a model of a logic program P if it satisfies all rules of P . I is a minimal model of P if it is a model of P and there is no proper subset of I which is also a model of P . I is a supported model of P if for any a ∈ I, there is r ∈ P such that a ∈ head(r) and I |= body(r). As commented earlier, atoms can be viewed as elementary c-atoms. This is due to the fact that for an atom a, an interpretation I satisfies a iff a ∈ I iff I |= ({a}, {{a}}). Sometimes we say a model M restricted to the atoms appearing in a program P . By this we mean M ∩ At(P ), and denote it by M|At(P ) . Note that c-atoms of the form (D, ∅) are not satisfied by any interpretation. We will use a special symbol ⊥ to denote any such c-atom. Following Son et al. (2007), for any c-atom A = (Ad , Ac ), its negation not A is − Ad 1 interpreted by its complement, which is a c-atom (Ad , A− c ) where Ac = 2 \ Ac . So a logic program with negated c-atoms can be rewritten to a logic program free of negated c-atoms by replacing all occurrences of negated c-atoms with their respective complement c-atoms. Due to this assumption, in the sequel we only consider logic programs without negated c-atoms in rule bodies. Given a disjunctive program P (where c-atoms are elementary) and an interpretation I, the standard Gelfond–Lifschitz transformation of P w.r.t. I, written as P I , is obtained from P by performing two operations: (1) remove from P all rules whose bodies contain a negative literal not A such that I |= not A, and (2) remove from the remaining rules all negative literals. Since P I is a positive constraint program where c-atoms are elementary, it has a set of minimal models. I is defined to be a stable model of P if it is a minimal model of P I (Gelfond and Lifschitz 1988; Gelfond and Lifschitz 1991; Przymusinski 1991). The cardinality and weight constraints can be represented by c-atoms. In some of the example programs of this paper we may write weight constraints instead of c-atoms. We will adopt the notation proposed in (Simons et al. 2002). A weight constraint is an expression of the form l{a1 = wa1 , . . . , an = wan , not b1 = wb1 , . . . , not bm = wbm }u 1 Note that this is consistent with our definition of satisfaction of negated c-atoms. But not all semantics are based on the complement approach. A detailed comparison can be found in (Son et al. 2007). Characterizations of stable model semantics for constraint programs 535 where ai and bj are atoms and wai is the weight of atom ai and wbj is the weight of negative literal not bj . The numbers l and u are lower and upper bounds of the constraint, respectively. A weight constraint is satisfied by a set of atoms S if the sum of the weights of the literals in the set {a1 , . . . , an , not b1 , . . . , not bm } that are satisfied by S is between l and u (inclusive). A cardinality constraint is a special case of weight constraint where each weight is one. In writing a cardinality constraint, we will omit the weights. A choice constraint is a cardinality constraint of the form l{a1 , . . . , an }u, where l = 0 and u = n. In writing a choice constraint, we will omit the bounds. 3 Abstract representation of constraint atoms In this section, we present a compact representation of c-atoms. In the current literature, for any c-atom A its admissible solutions are all explicitly enumerated and written in Ac . In many cases, Ac may involve a large portion of Ad . It is then of great interest if we can represent Ac using some abstract structure so that its size can be substantially compressed. We begin by introducing a notion of prefixed power sets. Definition 3.1 Let I = {a1 , . . . , am } and J = {b1 , . . . , bn } (m, n > 0) be two sets of atoms. (1) The I-prefixed power set of J, denoted by I J, is the collection {I ∪ Jsub |Jsub ∈ 2J }; i.e., each set in the collection consists of all ai s in I plus zero or more bi s in J. For any set of atoms S, we say S is covered by I J (or I J covers S) if I ⊆ S and S ⊆ I ∪ J. (2) For any two abstract prefixed power sets I J and I J , I J is included in I J if any set covered by I J is covered by I J . Theorem 3.1 When I J is included in I1 J1 , we have I1 ⊆ I and I ∪ J ⊆ I1 ∪ J1 . If I J is included in I1 J1 and I1 J1 is included in I2 J2 , then I J is included in I2 J2 . Given a c-atom A, let I ∈ Ac and J ⊆ Ad \ I. I J is called I-maximal in A (or just maximal) if all sets covered by I J are in Ac and there is no J with J ⊂ J ⊆ Ad \ I such that all sets covered by I J are in Ac . Definition 3.2 Let A be a c-atom and S ∈ Ac . The collection of abstract S-prefixed power sets of A is {S J | S J is S-maximal in A}. For instance, consider a c-atom A, where Ad = {a, b, c, d} Ac = {∅, {b}, {c}, {a, c}, {b, c}, {c, d}, {a, b, c}, {b, c, d}}. For ∅ ∈ Ac , the collection of abstract ∅-prefixed power sets of A is {∅ {b, c}}; for {b} ∈ Ac , the collection is {{b} {c}}; for {c} ∈ Ac , the collection is {{c} {a, b}, {c} {b, d}}. Note that {b} {c} is included in ∅ {b, c}. It is easy to check that all abstract 536 Y.-D. Shen et al. prefixed power sets for {a, c}, {b, c}, {a, b, c} ∈ Ac are included in {c} {a, b} and all those for {b, c}, {c, d}, {b, c, d} ∈ Ac are included in {c} {b, d}. When a collection contains two abstract prefixed power sets, I J and I J with I J being included in I J , we say I J is redundant in this collection. For instance, consider I J where I = {a, b} and J = {c}, and I J where I = {a} and J = {b, c}. Then, I J is redundant in a collection that contains I J , since every set covered by I J is covered by I J . Definition 3.3 The abstract representation A∗ of a c-atom A is a pair (Ad , A∗c ) where A∗c is the collection S ∈Ac CS , where CS is the collection of abstract S-prefixed power sets of A, with all redundant abstract prefixed power sets removed. Observe that when W V is in A∗c , all sets in the collection {W ∪ Vsub |Vsub ∈ 2V } are in Ac . Conversely, when {W ∪ Vsub |Vsub ∈ 2V } ⊆ Ac , there exist W , V ⊆ Ad such that W ⊆ W and W ∪ V ⊆ W ∪ V , and W V ∈ A∗c , i.e., W V is included in W V ∈ A∗c . In other words, A∗c is the collection of maximal sublattices of the lattice (2Ad , ⊆), of which all elements are in Ac . For such a maximal sublattice W V , the bottom element is W and the top element is W ∪ V . Consider the above example c-atom A again. Its abstract representation is (Ad , A∗c ) with A∗c = {∅ {b, c}, {c} {a, b}, {c} {b, d}}. Theorem 3.2 Let A = (Ad , Ac ) be a c-atom. (1) A has a unique abstract form (Ad , A∗c ). (2) For any interpretation I, I |= A if and only if A∗c contains an abstract prefixed power set W V covering I ∩ Ad . For some special classes of c-atoms, their abstract representations are much simpler and can be stated more structurally. We need a terminology: given a set S of sets, we say that I ∈ S is minimal (resp. maximal) in S if there is no I ∈ S such that I ⊂ I (resp. I ⊃ I). Theorem 3.3 Let A be a c-atom. (1) A is monotone if and only if A∗c = {B Ad \ B : B is minimal in Ac } if and only if |W | + |V | = |Ad | for each W V ∈ A∗c . (2) A is antimonotone if and only if A∗c = {∅ T : T is maximal in Ac } if and only if W = ∅ for each W V ∈ A∗c . (3) A is convex if and only if A∗c = {B T : B is minimal and B ∪ T is maximal in Ac }. By this theorem, given A∗ , to check if A is monotone (resp. antimonotone) it suffices to check if |W | + |V | = |Ad | (resp. W = ∅) for each W V ∈ A∗c . This process takes linear time in the size of A∗c . Let S1 = {W | W V ∈ A∗c } and S2 = {W ∪ V | W V ∈ A∗c }. To check if A is convex, it suffices to check (a) there are no p, q ∈ S1 with p ⊂ q, and (b) there are no p, q ∈ S2 with p ⊂ q. Case (a) Characterizations of stable model semantics for constraint programs 537 guarantees that W is minimal while case (b) guarantees W ∪ V is maximal in Ac , for each W V ∈ A∗c . The time for the two cases is bounded by O(|A∗c |2 ∗ |Ad |2 ), where each subset check is assumed to take time |Ad |2 . This leads to the following complexity result. Theorem 3.4 Given the abstract representation A∗ of a c-atom A, the time to check if A is monotone or antimonotone is linear in the size of A∗c , while the time to check if A is convex is bounded by O(|A∗c |2 ∗ |Ad |2 ). We now discuss the issue of compactness. Given a c-atom A, its abstract representation A∗ is more compact than A when Ac contains some relatively large abstract prefixed power sets. This can be seen from the special classes of c-atoms in Theorem 3.3. Since the admissible solutions in such a c-atom are tightly clustered together, they easily form large abstract prefixed power sets. For example, since a monotone c-atom is closed under its supersets in Ac , for any minimal set S in Ac , all the sets in between S and Ad must be in Ac . Therefore, S Ad \ S is an abstract S-prefixed power set. The bigger is the difference between S and Ad , the more information is captured compactly. As another example, we know that weight constraints without negative literals or negative weights are convex. That is, these constraints are of the form l{a1 = wa1 , . . . , an = wan }u, where wai > 0, for all 1 6 i 6 n. Let A denote such a weight constraint. Then, Ad = {a1 , . . . , an } and Ac consists of all subsets of Ad where the sum of the weights of the atoms in such a subset is between l and u. Thus, if the sets B and T are such that B ⊆ T ⊆ Ad , and B is minimal and T is maximal in Ac , then B T \ B forms an abstract B-prefixed power set, representing all the sets in between. Apparently, c-atoms that are nearly monotone (or antimonotone or convex) can greatly benefit from the abstract representation. For example, given a set S = {a1 , . . . , an }, a c-atom that expresses all subsets of S except some V in between ∅ and S can easily fall outside of the above special classes. For instance, suppose S = {a, b, c} and let A = (S, 2S \{{a, b}}). Then A∗ = (S, {∅{a, c}, ∅{b, c}, {a, c}{b}, {b, c}{a}}). It should also be clear that there are situations where A∗ may not be strictly more compact than A. This is typically the case where the admissible solutions in Ac are largely unrelated. We say that two sets I and J are unrelated if either no one is a subset of the other, or I ⊆ J and J \ I is not singleton. For example, consider a c-atom A where Ac consists of all subsets of Ad with an equal size. In this case, no set in Ac is a subset of another in Ac . The abstract representation of such a c-atom A is (Ad , A∗c ) where A∗c = {I ∅ : I ∈ Ac }, which trivially enumerates all admissible solutions in Ac . As another example, consider a c-atom A = ({a, b, c, d}, {∅, {a, b}, {a, b, c, d}}). In this case, for any I, J ∈ Ac , if J is a superset of I, then J \ I is not singleton. The abstract representation of A is (Ad , A∗c ), where A∗c = {∅ ∅, {a, b} ∅, {a, b, c, d} ∅}. Again, A∗c essentially enlists all admissible solutions in Ac . Although all the evidence indicates that for any c-atom A the number of abstract prefixed power sets in A∗c is less than or equal to the number of admissible solutions 538 Y.-D. Shen et al. in Ac , i.e., |A∗c | 6 |Ac |, a rigorous proof for this claim seems challenging. We leave this proof as an interesting open problem. Finally in this section, we comment that for a c-atom A, it takes polynomial time in the size of A to construct A∗ . This result will be useful in determining the complexity of the semantics defined by the generalized Gelfond–Lifschitz transformation later in this paper. Below, we give a bound for the construction. Theorem 3.5 Let A be a c-atom. The time to construct A∗ from A is bounded by O(|Ac |4 ∗ |Ad |2 ). 4 Characterizations of c-atoms under abstract representation In this section, we present some characterizations of c-atoms under the abstract representation. Essentially, these characterizations are related to the fact that a c-atom can be semantically represented by a propositional formula. Recall that the standard semantics of a c-atom A is defined by its satisfaction: for any set of atoms M, M |= A if and only if M ∩ Ad ∈ Ac . For nonmonotone c-atoms, a difficulty with this interpretation of the meaning of a c-atom is that the iterative construction by the one-step provability operator (Liu and Truszczynski 2006; Marek et al. 2008) may lead to an undesirable situation—there is no guarantee that once a c-atom is satisfied by a set of atoms I, it remains to be satisfied by an extension of I. However, by definition, a set of atoms M satisfies a c-atom A if and only if M satisfies the propositional formula that corresponds to the admissible solutions in Ac . This formula is a disjunction of conjunctions, each of which represents an admissible solution in Ac . As a propositional formula, it can be simplified to a logically equivalent one. It turns out that this simplification process is significant as it reveals the nature of the information encoded in our abstract representation. Therefore, the main result of this section is to show that the abstract representation of a c-atom encodes the “simplest” propositional formula, in the form of a disjunctive normal form (DNF). We then use this insight to define what are called abstract satisfiable sets, which make it possible to define a new form of Gelfond–Lifschitz transformation. Below, we make it precise as what the formula is, and state some facts which easily follow from the definition. Proposition 4.1 Let A = (Ad , Ac ) be a c-atom with Ac = {S1 , . . . , Sm }, and I be an interpretation. The DNF C1 ∨ . . . ∨ Cm for A is defined as: each Ci is a conjunction Si ∧ not (Ad \ Si ). (1) I satisfies A if and only if C1 ∨ . . . ∨ Cm is true in I. (2) I satisfies not A if and only if not (C1 ∨ . . . ∨ Cm ) is true in I. Given a c-atom A, the DNF C1 ∨ . . . ∨ Cm for A can be simplified. In propositional logic, we have (S ∧ ¬F) ∨ (S ∧ F) ≡ S, for any formulas S and F. Characterizations of stable model semantics for constraint programs 539 Example 4.1 Consider a monotone c-atom A = ({a, b}, {{a}, {b}, {a, b}}). Its corresponding DNF is (a ∧ not b) ∨ (b ∧ not a) ∨ (a ∧ b), which can be simplified as follows: (a ∧ not b) ∨ (b ∧ not a) ∨ (a ∧ b) ≡ (a ∧ not b) ∨ (a ∧ b) ∨ (b ∧ not a) ∨ (a ∧ b) ≡ a ∨ b. Note that in the second line above, a disjunct in the previous DNF is added. What is interesting is that the resulting propositional formula corresponds to the abstract representation of A, where A∗c = {{a} {b}, {b} {a}}. This correspondence is made precise in the following theorem. Theorem 4.2 Let A be a c-atom and M be a set of atoms. M |= A if and only if M satisfies W ∧ not (Ad \ (W ∪ V )). (1) W V ∈A∗c The proof of this theorem requires the following lemma. Lemma 4.3 Let E = {a1 , . . . , am } be a set of atoms and F be a DNF covering all possible interpretations on the ai s, i.e., F= L1 ∧ ... ∧ Lm . 16i6m, Li ∈{ai ,not ai } F can be simplified to true in propositional logic by applying the following rule: For any S1 and S2 , (S1 ∧ L ∧ S2 ) ∨ (S1 ∧ not L ∧ S2 ) ≡ S1 ∧ S2 . (2) Note that rule (2) is like the resolution rule in its underlying pattern, but it applies to a DNF while resolution applies to CNFs. Theorem 4.2 shows that the satisfaction of a c-atom A can be simplified to (1) in terms of its abstract representation by applying rule (2). As a slightly more involved example, consider a c-atom B = ({a, b, c, d}, {{d}, {a}, {a, b}, {a, c}, {a, b, c}}). The DNF for this c-atom is: (d ∧ not a ∧ not b ∧ not c) ∨ (a ∧ not b ∧ not c ∧ not d)∨ (a ∧ b ∧ not c ∧ not d) ∨ (a ∧ c ∧ not b ∧ not d) ∨ (a ∧ b ∧ c ∧ not d). which can be simplified to (d ∧ not a ∧ not b ∧ not c) ∨ (a ∧ not d), each disjunct of which corresponds to a prefixed power set in the abstract representation of B, i.e., Bc∗ = {{d} ∅, {a} {b, c}}. We say that a DNF is maximally simplified if it cannot be further simplified by applying rule (2). The following theorem shows that (1) is maximally simplified. 540 Y.-D. Shen et al. Theorem 4.4 The semantic characterization (1) of a c-atom A is maximally simplified. Theorems 4.2 and 4.4 suggest that the satisfaction of c-atom A can be described by its simplest DNF given in (1), independently of any interpretations. When we generalize the standard Gelfond–Lifschitz transformation for constraint programs, we can apply a given interpretation to further simplify this DNF. In the following, and in the rest of the paper, given an interpretation I, for any c-atom A we use TAI to denote I ∩ Ad and FAI to denote Ad \ TAI . We are ready to define abstract satisfiable sets. Definition 4.1 Let A be a c-atom and I an interpretation. W V ∈ A∗c is an abstract satisfiable set of A w.r.t. I if W V covers TAI . In this case, W is called a satisfiable set of A w.r.t. TAI . We use AIs to denote the set of abstract satisfiable sets of A w.r.t. I. The next two theorems characterize some properties of abstract satisfiable sets as well as satisfiable sets. Theorem 4.5 Let A be a c-atom and I an interpretation. I |= A if and only if I |= W V ∈AIs W ∧ not (Ad \ (W ∪ V )). Theorem 4.6 Let A be a c-atom and I an interpretation. If S is a satisfiable set of A w.r.t. TAI , then for every S with S ⊆ S ⊆ TAI , we have S ∈ Ac . 5 A generalization of the Gelfond–Lifschitz transformation In this section we show that the characterizations of c-atoms presented in the last section can be used to generalize the standard Gelfond–Lifschitz transformation for logic programs with c-atoms. In the following, special atoms of the forms θA , βA and ⊥ will be used, where A is a c-atom. Unless otherwise stated, we assume that these special atoms will not occur in any given logic programs or interpretations. Let Γθ and Γβ be the sets of special atoms prefixed with θ and β, respectively. Let Γ = Γθ ∪ Γβ . Definition 5.1 Given a logic program P and an interpretation I, the generalized Gelfond–Lifschitz transformation of P w.r.t. I, written as P I , is obtained from P by performing the following four operations: (1) Remove from P all rules whose bodies contain either a negative literal not A such that I |= not A or a c-atom A such that I |= A. (2) Remove from the remaining rules all negative literals. (3) Replace each c-atom A in the body of a rule with a special atom θA and introduce a new rule θA ← A1 , . . . , Am for each satisfiable set {A1 , . . . , Am } of A w.r.t. TAI . Characterizations of stable model semantics for constraint programs 541 (4) Replace each c-atom A in the head of a rule with ⊥ if I |= A, or replace it with a special atom βA and introduce a new rule B ← βA for each B ∈ TAI , a new rule ⊥ ← B, βA for each B ∈ FAI , and a new rule βA ← TAI . In the first operation, we remove all rules whose bodies are not satisfied in I because of the presence of a negative literal or a c-atom that is not satisfied in I. In the second operation, we remove all negative literals because they are satisfied in I. The last two operations transform c-atoms in the body and head of each rule, respectively. Each c-atom A in the body of a rule is substituted by a special atom θA . By Theorem 4.5, θA can be defined by introducing a new rule θA ← W ∧not (Ad \(W ∪V )) for each abstract satisfiable set W V . Since the negative part not (Ad \(W ∪V )) is true in I, it can be removed from the rule body following the standard Gelfond–Lifschitz transformation. Note that the remaining part W is a satisfiable set. Therefore, in the third operation, θA is defined by introducing a new rule θA ← A1 , . . . , Am for each satisfiable set {A1 , . . . , Am } of A w.r.t. TAI . When I |= A, each c-atom A in the head of a rule is replaced by a special atom βA . Note that βA represents a conclusion that every B ∈ TAI is true and every B ∈ FAI is false in I. Such a conclusion is formulated, in the fourth operation, by introducing a new rule B ← βA for each B ∈ TAI , a new rule ⊥ ← B, βA for each B ∈ FAI , and a new rule βA ← TAI . ⊥ is a special atom meaning false. The last rule comes from the rule βA ← TAI ∧ not FAI , where the negative part not FAI is true in I and thus is removed following the standard Gelfond–Lifschitz transformation. When I |= A, we replace A with ⊥. In the case that ⊥ appears in a disjunction B1 ∨ . . . ∨ ⊥ ∨ . . . ∨ Bm with m > 0, ⊥ can be removed, as the satisfaction of the disjunction is determined by the Bi s. Apparently, the generalized Gelfond–Lifschitz transformation coincides with the standard Gelfond–Lifschitz transformation when P contains no c-atoms. Since the generalized transformation P I is a positive logic program without catoms, it has minimal models. We then define the stable model semantics of a constraint program in the same way as that of a logic program with ordinary atoms. Definition 5.2 For any logic program P , an interpretation I is a stable model of P if I = M \ Γ, where M is a minimal model of the generalized Gelfond–Lifschitz transformation P I. Immediately, if P is a normal constraint program, then I is a stable model of P if I = M \ Γ and M is the least model of the generalized Gelfond– Lifschitz transformation P I . In other words, the extension to disjunctive constraint programs from normal constraint programs follows the same way as the extension to disjunctive programs from normal programs. Again, stable models of P under the generalized Gelfond–Lifschitz transformation coincide with stable models under the standard Gelfond–Lifschitz transformation when P has no c-atoms. In the following, unless otherwise stated, by stable models we refer to stable models under the generalized Gelfond–Lifschitz transformation. 542 Y.-D. Shen et al. Example 5.1 Consider the following program: P1 : p(1). p(−1) ← p(2). p(2) ← SUM({X|p(X)}) > 1. The aggregate constraint SUM({X|p(X)}) > 1 can be represented by a c-atom A where Ad = {p(−1), p(1), p(2)}, Ac = {{p(1)}, {p(2)}, {p(−1), p(2)}, {p(1), p(2)}, {p(−1), p(1), p(2)}}. Its abstract representation is (Ad , A∗c ) with A∗c = {{p(1)} {p(2)}, {p(2)} {p(−1), p(1)}}. Let us check if I = {p(−1), p(1), p(2)} is a stable model of P1 using the generalized Gelfond–Lifschitz transformation. The first two operations do not apply. Since I |= A with TAI = I ∩ Ad = {p(−1), p(1), p(2)}, A has only one abstract satisfiable set {p(2)} {p(−1), p(1)}, and thus it has only one satisfiable set {p(2)} w.r.t. TAI . So, in the third operation A is replaced by a special atom θA , followed by a new rule θA ← p(2). Hence we have P1I : p(1). p(−1) ← p(2). p(2) ← θA . θA ← p(2). The only minimal model of P1I is {p(1)}, so I is not a stable model of P1 . It is easy to check that this program has no stable model. Example 5.2 Consider a disjunctive constraint program: P2 : A ∨ B. a ← b. where A is a c-atom ({a}, {{a} ∅}) and B = ({b}, {{b} ∅}). (1) Let I1 = {a, b}. After performing the fourth operation, we obtain P2I1 : βA ∨ βB . a ← βA . βA ← a. b ← βB . βB ← b. a ← b. P2I1 has only one minimal model, M = {a, βA }; hence, I1 is not a stable model of P2 . Characterizations of stable model semantics for constraint programs 543 (2) Let I2 = {a}. After performing the fourth operation, we obtain P2I2 : βA . a ← βA . βA ← a. a ← b. P2I2 has one minimal model, M = {a, βA }; hence, I2 is a stable model of P2 . The introduction of disjunction into the head of a rule increases the expressiveness of the language, and allows natural representation using disjunction. Example 5.3 In scheduling, combinatorial counting or grouping is often needed. For example, a shift either has a in it, or not. If a is in it, then either a goes along with exactly one in {b, c}, or any two in {d, e, f}. This can be represented by a disjunctive program with cardinality constraints: 1{a, not a}1. 1{b, c}1 ∨ 2{d, e, f}2 ← a. The semantics of this program can be understood by the semantics of the corresponding constraint program: ({a}, {∅, {a}}). ({b, c}, {{b}, {a}}) ∨ ({d, e, f}, {{d, e}, {d, f}, {e, f}}) ← a. This program has the following stable models: ∅, {a, b}, {a, c}, {a, d, e}, {a, d, f}, and {a, f, e}. Once c-atoms are allowed to appear in the disjunctive head of a rule, disjunctive aggregates may be expressed. Example 5.4 Suppose the set of atoms in our propositional language is {p(−1), p(1), p(2)}2 . Consider the following program: p(1) ∨ p(−1). SUM(X|p(X)) > 3 ∨ SUM(X|p(X)) 6 0 ← COUNT(X|p(X)) > 1. Its stable models are: {p(1), p(2)}, {p(−1), p(1)}, and {p(−1)}. As commented in Simons et al. (2002), a weight constraint can be transformed to one with negative weights but without negative literals. The weight constraints of this kind in fact express linear inequations. Thus, a disjunction of weight constraints can be viewed as specifying a disjunction of linear inequations. For instance, the second rule in the above example can be expressed using weight constraints. To encode the 2 Note that we assume a fixed propositional language that includes all the atoms appearing in a given program. 544 Y.-D. Shen et al. SUM aggregate constraint above, let l Σ u denote l{p(−1) = −1, p(1) = 1, p(2) = 2}u, where l and u are the lower and upper bounds, respectively. When l (resp. u) is omitted, it means −∞ (resp. ∞). Then, we can write the following rule 3 Σ ∨ Σ 2 ← 1{p(−1) = 1, p(1) = 1, p(2) = 1} where the right-hand side encodes the COUNT aggregate constraint. We argue that disjunctive logic programing with constraint atoms provides a rich knowledge representation language for modeling conditional as well as disjunctive constraints, which have been studied in the past in constraint programing (see, e.g., Baptiste and Pape 1996; Cohen et al. 2000; Marriott et al. 2001)3 . 5.1 Properties of stable models We now show some properties of stable models. Theorem 5.1 Any stable model M of a logic program P is a model of P . A stable model may not be a minimal model for some constraint programs. To illustrate, consider a logic program P : ({a, b}, {{a} {b}, {b} {a}}). It is easy to check that {a}, {b} and {a, b} are all stable models of P . We see that {a, b} is not minimal. It turns out that logic programs whose c-atoms appearing in rule heads are elementary possess the minimality property. Theorem 5.2 Let P be a logic program such that c-atoms appearing in the heads of its rules are all elementary. Any stable model of P is a minimal model of P . Recall that any atom A can be expressed as a c-atom A = ({A}, {{A}}) and any negative literal not A can be expressed as a c-atom A = ({A}, {∅}), such that for any interpretation I, I |= A (resp. I |= not A) if and only if I |= A (resp. I |= A ). The following result further justifies our generalization of the standard stable model semantics to logic programs with c-atoms. Theorem 5.3 Let P be a logic program with ordinary atoms and P be P with each positive literal A replaced by a c-atom ({A}, {{A}}), and each negative literal not A replaced by a c-atom ({A}, {∅}). An interpretation I is a stable model of P if and only if it is a stable model of P . If all c-atoms are coded in the abstract representation, the time complexity of the generalized Gelfond–Lifschitz transformation is as follows. 3 But note that disjunction in rule heads is epistemic disjunction (Gelfond and Lifschitz 1991), not the classic disjunction in propositional logic. Characterizations of stable model semantics for constraint programs 545 Theorem 5.4 Let P be a logic program with n different c-atoms that are coded in the abstract representation and I be an interpretation. Let A be a c-atom such that I |= A. (1) The time complexity of computing all satisfiable sets of A w.r.t. TAI is linear in the size of A∗c . (2) The time complexity of the generalized Gelfond–Lifschitz transformation is bounded by O(|P | + n ∗ (2MA∗c + MAd + 1)), where MA∗c and MAd are the maximum sizes of A∗c and Ad of a c-atom in P , respectively. The following result is immediate. Corollary 5.5 The size of P I is bounded by O(|P | + n ∗ (MA∗c + MAd + 1)). Finally, we show the complexity of the major decision problem, namely the stable model existence problem. In the following, we assume the explicit representation of c-atoms A in the form (Ad , Ac ) in a given program P . Theorem 5.6 (1) The problem of deciding whether a stable model exists for a normal constraint program P is NP-complete. (2) The problem of deciding whether a stable model exists for a disjunctive constraint program P is Σ2P -complete. 6 Relationship to conditional satisfaction Recently, Son et al. (2006) proposed a fixpoint definition of stable models for logic programs with c-atoms. They introduce a key concept termed conditional satisfaction. Definition 6.1 (Son et al. 2006 ) Let R and S be two sets of atoms. The set R conditionally satisfies a c-atom A w.r.t. S, denoted R |=S A, if R |= A and for every S such that R ∩ Ad ⊆ S and S ⊆ S ∩ Ad , we have S ∈ Ac . An immediate consequence operator TP (R, S) is introduced, which evaluates each c-atom using the conditional satisfaction |=S instead of the standard satisfaction |=. Definition 6.2 (Son et al. 2006 ) Let P be a positive basic logic program and R and S be two sets of atoms. Define ∃r ∈ P : R |=S body(r), TP (R, S) = A . head(r) = ({A}, {{A}}) When the second argument is a model of P , TP is monotone w.r.t. the first argument. In particular, given a model M and let R ⊆ U ⊆ M, then TP (R, M) ⊆ TP (U, M) ⊆ M. Thus, for any model I, the sequence TPi (∅, I) with TP0 (∅, I) = ∅ and TPi+1 (∅, I) = TP (TPi (∅, I), I), converges to a fixpoint TP∞ (∅, I). I is defined to be a stable model if it is the same as the fixpoint. The following result reveals the relationship between conditional satisfaction and satisfiable sets. 546 Y.-D. Shen et al. Theorem 6.1 Let A be a c-atom and R and I be two interpretations with R ⊆ I. Let TAI = I ∩ Ad . R |=I A if and only if A∗c has an abstract prefixed power set W V such that R ∩ Ad TAI \ (R ∩ Ad ) is included in W V (thus W is a satisfiable set of A w.r.t. TAI and W ⊆ R ∩ Ad ). Theorem 6.1 leads us to the conclusion that Son et al. (2006)’s fixpoint definition and our definition of stable models are semantically equivalent for positive basic programs, as stated formally by the following theorem. Theorem 6.2 Let P be a positive basic program and I a model of P . I is a stable model under Son et al. (2006)’s fixpoint definition if and only if it is a stable model derived from the generalized Gelfond–Lifschitz transformation. Note that by Theorem 5.2, any stable model of a positive basic program is a minimal model. When the head A of a rule r is not elementary, given an interpretation I, Son et al. (2006) transform r into the following set of rules: B ← body(r), ⊥ ← B, body(r), for each B ∈ TAI for each B ∈ FAI . Under our generalized Gelfond–Lifschitz transformation, r is transformed into the following set of rules: βA ← body(r), for each B ∈ TAI B ← βA , ⊥ ← B, βA , for each B ∈ FAI I βA ← TA . Apparently, the two transformations are semantically equivalent in that when body(r) is true, they derive the same conclusions except for the special atoms. Combining with Theorem 6.2, we then conclude that Son et al.(2006)’s fixpoint definition and our definition of stable models under the generalized Gelfond–Lifschitz transformation are semantically equivalent for normal constraint programs. Note that any normal constraint program can be transformed into a positive basic program by replacing each negative literal not B with a c-atom ({B}, {∅}) and replacing each negative c-atom not A with the complement (Ad , 2Ad \ Ac ) of A. Therefore, our approach with the generalized Gelfond–Lifschitz transformation is semantically equivalent to Son et al. (2006)’s approach for normal constraint programs, as stated by the following result. Corollary 6.3 Let P be a normal constraint program and I a model of P . Let P be P with each negative literal not B being replaced by ({B}, {∅}) and each negative c-atom not A replaced by (Ad , 2Ad \ Ac ). I is a stable model of P under Son et al. (2006)’s approach if and only if it is a stable model of P derived from the generalized Gelfond–Lifschitz transformation. Characterizations of stable model semantics for constraint programs 547 7 Properties based on dependency relation In normal logic programing, the dependency relation over the atoms in a program is an essential notion based on which a number of important properties are characterized (see, e.g., Sato 1990; Fages 1994; You and Yuan 1994). In this section, we extend these characterizations to normal constraint programs. A central question here is what should be the dependency graph for a given program. We will see that our abstract representation of c-atoms in the bodies of rules is precisely what is needed to construct such a dependency graph, for the semantics defined by (Son et al. 2006). In this section, a basic program P refers to a collection of rules of the form H ← A1 , . . . , An (3) where H is either ⊥ or an elementary c-atom, and Ai are arbitrary c-atoms. Each rule in a basic program is also called a basic rule. To be consistent with the original definition of stable model (Gelfond and Lifschitz 1988), we assume that a rule of the form ⊥ ← body in a basic program is already replaced by a rule with an elementary head f ← body, ({f}, {∅}) where f is a new symbol representing the elementary c-atom ({f}, {{f}}) and the c-atom ({f}, {∅}) in the body is its complement. The proof of the main result of this section is based on a method of representing a basic program by a normal program, directly using the abstract representation of c-atoms, while preserving the stable model semantics. Since the material is of interest on its own, we will first present it in the next subsection. 7.1 Representing basic programs by normal programs The semantics of logic programs with c-atoms or aggregates have been studied by the unfolding approach (Pelov et al. 2003; Son and Pontelli 2007). It turns out, under our abstract representation of c-atoms, the unfolding approach can be made simple. Let P be a basic program. The normal program translation of P , denoted Pn , is a normal program defined as follows. For each rule in P H ← A1 , . . . , An , (4) H ← θA1 , . . . , θAn , (5) we have a rule in Pn , where θAi are new symbols, plus the following rules: for each 1 6 i 6 n, θAi ← W , not d1 , . . . , not dk for each W V ∈ A∗ic , where {d1 , . . . , dk } = Aid \ W ∪ V . 548 Y.-D. Shen et al. Example 7.1 Consider the program P2 in Example 5.1 again, which consists of the following rules p(1). p(−1) ← p(2). p(2) ← SUM({X | p(X)}) > 1. Let A denote the aggregate in P2 . Recall that A∗c = {{p(1)} {p(2)}, {p(2)} {p(−1), p(1)}}. Thus, Pn consists of p(1). p(−1) ← p(2). p(2) ← θ. θ ← p(1), not p(−1). θ ← p(2). It is clear that this normal program has no stable models. A distinct feature of our translation, as compared with the previous unfolding approach (Pelov et al. 2003; Son and Pontelli 2007), is that the abstract representation of c-atoms is defined independently of any given program, while in (Pelov et al. 2003; Son and Pontelli 2007), the translation to a normal program is an integrated process. This difference contributes to the simplicity of our approach. The use of the abstract representation of c-atoms is essential. The following example shows that a simple enumeration of admissible solutions in a c-atom does not work. This is the case even for logic programs with only monotone c-atoms. Example 7.2 Suppose a program P that consists of a single rule a←A where A = ({a}, {∅, {a}}). Note that A is monotone, as well as a tautology, and P has a unique stable model {a}. Since A∗c = {∅ {a}}, Pn consists of a ← θ. θ←. Without the information encoded in the prefixed power set above, it may appear that a natural normal program encoding is to split admissible solutions as conditions into different rules. If we adopt this strategy, we will get the following normal program: a ← θ. θ ← not a. θ ← a. This program has no stable model. We now show that our translation preserves the stable models semantics. Though the result is presented as a lemma for proving Theorem 7.2 of the next subsection, it is obviously of independent interest. Below, given a program P , we denote by ST (P ) the set of stable models of P . Characterizations of stable model semantics for constraint programs 549 Lemma 7.1 Let P be a basic program and Pn be its normal program translation. Then, ST (P ) = {M|At(P ) |M is a stable model of Pn }. 7.2 Dependency relation-based characterizations We are now ready to extend some of the well-known characterizations for normal programs to normal constraint programs. The key is the notion of a dependency graph for normal constraint programs. Definition 7.1 Let P be a basic program. The dependency graph GP is a graph (V , E), where V = At(P ) and E is the set of positive and negative edges defined as the follows: there is a positive edge from u to v, denoted u →+ v, if there is a rule r of the form (3) in P such that head(r) = u, and for some Ai ∈ body(r) and W V ∈ A∗ic , v ∈ W ; there is a negative edge from u to v, denoted u →− v, if there is a rule r of the form (3) in P such that head(r) = u, and for some Ai ∈ body(r) and W V ∈ A∗ic , v ∈ Aid \ W ∪ V . It is important to notice that, in the definition above, for an abstract prefixed power set W V ∈ A∗ic , although we know that for any I such that W ⊆ I ⊆ W ∪ V we have I ∈ Aic , positive edges are only into atoms in W , not into any atom in I \W . Also, in normal logic programing, negative edges are only into negative literals in rule bodies, but here a negative edge may result from a positive c-atom in the body of a rule. Example 7.3 Suppose program P consists of a single rule a ← ({a, b, c}, {∅, {b}, {b, c}}). Let A be the c-atom in the body of the above rule. Since A∗c = {∅ {b}, {b} {c}}, we have a →− a, a →− c, and a →+ b. We say that P has an positive cycle if there is a path in GP from an atom to itself via only positive edges. P has an odd cycle if there is a path in GP from an atom to itself via an odd number of negative edges, and P has an even cycle if there is a path in GP from an atom to itself via an even number of negative edges. P is said to be call-consistent if P has no odd cycles. P is acyclic if it has no cycle of any kind. We remark that our definition of dependency graph reduces to the standard one for normal programs. Recall that the dependency graph for a normal program is defined as: for each normal rule in a normal program P a ← b1 , . . . , bk , not c1 , . . . , not cm , (6) there is a positive edge a →+ bi in GP for each i, and a negative edge a →− cj for each j. A normal program is in fact a basic program, in the sense that each positive literal bi in the rule above is replaced by an elementary c-atom ({bi }, {{bi }}) and each 550 Y.-D. Shen et al. negative literal not ci replaced by ({ci }, {∅}), i.e., the complement of ({ci }, {{ci }}). Let the resulting program be P . Since if Ci = ({ci }, {∅}) then Ci∗ = ({ci }, {∅ ∅}), by Definition 7.1, there is a negative edge a →− ci in GP . The following theorem shows that the well-known properties based on the dependency graphs for normal programs as shown in You and Yuan (1994) remain to hold for normal constraint programs under the new definition of dependency graph for the latter. Theorem 7.2 Let P be a basic program. (1) (2) (3) (4) P has a stable model if P is call-consistent. P has more than one stable model only if P has an even loop. P has a unique stable model if P is acyclic. If P has no positive cycles, then every supported model of P is a stable model of P . Example 7.4 To illustrate the point (2) above, consider the following program. p←. a ← ({p, b}, {{p}}). b ← ({p, a}, {{p}}). The program has two stable models {p, a} and {p, b}. Then, according to the theorem, there must exist an even loop in its dependency graph. Indeed, the edges a →− b and b →− a form such an even cycle. 8 Related work The notion of logic programs with c-atoms is introduced in Marek and Remmel (2004) and Marek and Truszczynski (2004), and further developed in Liu and Truszczynski (2005), Marek et al. (2008), Son and Pontelli (2007), and Son et al. (2007). As we mentioned earlier, major existing approaches can be roughly classified into three types: unfolding approaches, fixpoint approaches, and minimal model approaches. Representative unfolding approaches to handling c-atoms include Pelov et al. (2003) and Son and Pontelli (2007), where a notion of aggregate solutions (or solutions) is introduced. Informally, a solution of a c-atom A = (Ad , Ac ) is a pair S1 , S2 of disjoint sets of atoms of Ad such that for every interpretation I, if S1 ⊆ I and S2 ∩ I = ∅ then I |= A. This definition is given by Son and Pontelli (2007). Pelov et al. (2003) define an aggregate solution A as a pair S1 , S2 with S1 ⊆ S2 ⊆ Ad such that for every interpretation I, if S1 ⊆ I and (Ad \ S2 ) ∩ I = ∅ then I |= A. In the following, we use the former definition. It turns out that each W V ∈ A∗c corresponds to a minimal solution W , Ad \ (W ∪ V ) of A. A solution S1 , S2 of A is minimal if for no S3 ⊂ S1 nor S4 ⊂ S2 , S3 , S2 or S1 , S4 is a solution of A. First, W , Ad \ (W ∪ V ) is a solution of A; by Characterizations of stable model semantics for constraint programs 551 Theorem 4.2 for any interpretation I, if W ⊆ I and (Ad \ (W ∪ V )) ∩ I = ∅ then I |= A. Second, W , Ad \ (W ∪ V ) is a minimal solution of A, as by Theorem 4.4, W ∧ not (Ad \ (W ∪ V )) cannot be further simplified. Representative fixpoint approaches include Liu et al. (2007), Marek et al. (2008), Marek and Truszczynski (2004), Pelov (2004), Pelov and Truszczynski (2004), and Son et al. (2006, 2007). Son et al. (2006; 2007) can handle arbitrary catoms, while Marek et al. (2008), Marek and Truszczynski (2004), and Pelov and Truszczynski (2004) apply only to monotone c-atoms. Liu et al. (2007) extend Liu and Truszczynski (2005), Marek et al. (2008), Marek and Truszczynski (2004), and Pelov and Truszczynski (2004) for arbitrary c-atoms based on a concept of computation. Son et al. (2006, 2007) show that their fixpoint approach is semantically equivalent to that of Marek and Truszczynski (2004) for normal logic programs with monotone catoms; equivalent to that of Faber et al. (2004) and Ferraris (2005) for positive basic logic programs with monotone c-atoms; equivalent to that of Denecker et al. (2001) and Pelov et al. (2003) for positive basic logic programs with arbitrary c-atoms. In Section 6, we show that our approach using the generalized Gelfond–Lifschitz transformation is semantically equivalent to the approach of Son et al. (2007) for normal logic programs with arbitrary c-atoms. Therefore, the stable model semantics defined in this paper for disjunctive logic programs with arbitrary c-atoms extends these existing semantics. Faber et al. (2004) propose a minimal model approach. To check if an interpretation I is a stable model of P , they first remove all rules in P whose bodies are not satisfied by I, then define I to be a stable model if it is a minimal model of the simplified program. They consider the class of disjunctive logic programs whose rule heads are a disjunction of ordinary atoms. Stable models of P under this semantics are minimal models of P . Ferraris (2005) defines a stable model semantics in a different way, which (when negated c-atoms are treated as their complement c-atoms) agrees with the minimal-model based one on this class of programs. Son et al. (2006) show that for normal logic programs whose c-atoms appearing in rule heads are elementary, stable models under their semantics are stable models under the semantics of Faber et al. (2004) and Ferraris (2005). It immediately follows that for such normal logic programs, stable models under our semantics are stable models under the semantics of Faber et al. and Ferraris. However, the converse is not necessarily true, even for positive basic logic programs. Consider the positive basic logic program P : b ← c. c ← d. d ← ({b, c}, {∅, {b}, {b, c}}). P has only one model I = {b, c, d}. It is easy to check that I is not a stable model under the semantics of Son et al. (2006) and ours. However, I is a stable model under the semantics of Faber et al. (2004) and Ferraris (2005). Observe that the truth of b, c, d can only be inferred via a self-supporting loop: b → d → c → b. 552 Y.-D. Shen et al. This example program indicates that both the semantics of Faber et al. (2004) and that of Ferraris allow self-supporting loops. 9 Conclusions and future work In this paper we have introduced an abstract representation of c-atoms. To substantiate the claim that the abstract representation captures the essential information correctly and compactly, we showed two applications. In the first one, we show that the semantics based on conditional satisfaction (Son et al. 2006; Son et al. 2007), and the one equivalent to it (Denecker et al. 2001), can be defined by a generalized form of Gelfond–Lifschitz transformation, thus demonstrating that Gelfond–Lifschitz transformation can still play an important role in the study of semantics for logic programs with arbitrary c-atoms. In the second application, we show that our abstract representation of c-atoms encodes the information needed to define the atom dependency relation in a given program. As a result, the properties known to normal programs can be extended to programs with c-atoms. In this process, the unfolding approach (Son and Pontelli 2007) is made simple. Several interesting tasks remain open. One is the possibility of showing that other semantics may be characterized by our abstract representation of c-atoms. This is because prefixed power sets identify “monotone components” of c-atoms. Another task is to develop new algorithms for efficiently constructing the abstract form of c-atoms from the power set form representation. Finally, methods for computing the stable models (under our generalized Gelfond–Lifschitz transformation) of logic programs with arbitrary c-atoms remain a challenging open problem. Acknowledgements We would like to thank the anonymous referees for their constructive comments and suggestions that helped us improve this work. Yi-Dong Shen is supported in part by NSFC grants 60673103, 60721061, and 60833001, and by the National High-Tech R&D Program (863 Program). The work by Jia-Huai You and Li-Yan Yuan is supported in part by the Natural Sciences and Engineering Research Council of Canada. A Proof of theorems and lemmas Proof of Theorem 3.1: Assume that I J is included in I1 J1 . We first prove I1 ⊆ I. If on the contrary I1 ⊆ I, there is an atom a such that a ∈ I1 and a ∈ I. This means that every S covered by I1 J1 must contain a. Since I is covered by I J, I is covered by I1 J1 . But I does not contain a, a contradiction. We now prove I ∪ J ⊆ I1 ∪ J1 . If on the contrary I ∪ J ⊆ I1 ∪ J1 , I ∪ J is not covered by I1 J1 . This means I J is not included in I1 J1 , a contradiction. Next, assume that I J is included in I1 J1 and I1 J1 is included in I2 J2 . We have I2 ⊆ I1 ⊆ I, and I ∪ J ⊆ I1 ∪ J1 ⊆ I2 ∪ J2 . This means all sets covered by I J are covered by I2 J2 . That is, I J is included in I2 J2 . Characterizations of stable model semantics for constraint programs 553 Proof of Theorem 3.2: (1) For each S ∈ Ac , the collection CS of abstract S-prefixed power sets of A is uniquely defined by Definition 3.2, thus A∗c is uniquely defined by Definition 3.3. (2) Assume I |= A, i.e., I ∩ Ad = S ∈ Ac . By Definition 3.2, the collection CS of abstract S-prefixed power sets of A contains S Si covering S. By Definition 3.3, A∗c has an abstract prefixed power set W V such that either W V = S Si or S Si is included in W V . This means that W V covers S. Conversely, assume that A∗c has an abstract prefixed power set W V covering I ∩ Ad . By Definition 3.3, W V is an abstract W -prefixed power set of A with W ∈ Ac . By Definition 3.2, all sets covered by W V are in Ac . This means I ∩ Ad ∈ Ac , and hence I |= A. Proof of Theorem 3.3: Let G = S ∈Ac CS , where CS is the collection of abstract S-prefixed power sets of A. By Definition 3.3, A∗c is G with all redundants removed. (1) (=⇒) Assume that A is monotone. Then, all supersets of S ∈ Ac from 2Ad are in Ac , so all abstract S-prefixed power sets in G must be of the form S Ad \ S. If S is not minimal in Ac , S Ad \ S is redundant in G since for some S ⊂ S, which is minimal in Ac , S Ad \ S is in G. Therefore, A∗c = {B Ad \ B : B is minimal in Ac }. Clearly, |W | + |V | = |Ad | for each W V ∈ A∗c . (⇐=) Assume that for every W V ∈ A∗c , we have |W | + |V | = |Ad |; i.e., V = Ad \ W . Every abstract S-prefixed power set in G must be of the form S Ad \S, for otherwise, there is one W V ∈ A∗c with W ⊆ S and V ⊂ Ad \W . As shown above, in this case every S Ad \ S in G is redundant unless S is minimal in Ac . Therefore, A∗c is G with all S Ad \ S removed, where S is not minimal in Ac . That is, A∗c = {B Ad \ B : B is minimal in Ac }. This shows that for any S which is minimal in Ac , all supersets of S are in Ac . For any S ∈ Ac , there is some S ⊆ S, which is minimal in Ac . Since all supersets of S are in Ac , all supersets of S are in Ac . This shows that A is monotone. (2) (=⇒) Assume that A is antimonotone. Every abstract S-prefixed power set in G must be of the form ∅ T . By Definition 3.2, T is maximal in Ac . That is, A∗c = {∅ T : T is maximal in Ac }. Clearly, W = ∅ for each W V ∈ A∗c . (⇐=) Assume that every abstract prefixed power set in A∗c is of the form ∅ T . By Definition 3.2, T is maximal in Ac . That is, A∗c = {∅ T : T is maximal in Ac }. Clearly, for any T ∈ Ac all subsets of T are in Ac . This shows that A is antimonotone. (3) (=⇒) Assume that A is convex. Consider B T in G. If B is not minimal in Ac , since A is convex B T is included in B T , where B ⊂ B is minimal in Ac . For the same reason, if B ∪ T is not maximal in Ac , B T is included in B T , where T ⊃ T and B ∪ T is maximal in Ac . In both cases, B T is redundant in G. Therefore, A∗c is G with all B T removed, where either B is not minimal or B ∪ T is not maximal in Ac . That is, A∗c = {B T : B is minimal and B ∪ T is maximal in Ac }. (⇐=) Assume A∗c = {B T : B is minimal and B ∪ T is maximal in Ac }. Then, for any S1 , S2 ∈ Ac with S1 ⊂ S2 , there is some B T in A∗c , which covers 554 Y.-D. Shen et al. all S with B ⊆ S1 ⊆ S ⊆ S2 ⊆ B ∪ T . This means that all subsets in between S1 and S2 are in Ac . That is, A is convex. Proof of Theorem 3.5: Let A be a c-atom. We use a simple algorithm to construct A∗c . The algorithm returns a set, say Π, which is set to ∅ at the beginning. Note that for any p ∈ Ac , |p| 6 |Ad |. Therefore, for any p, q ∈ Ac it takes O(|Ad |2 ) time to determine if p is a subset of q. Moreover, when p ⊂ q, there are at most 2|q\p| − 2 sets w such that p ⊂ w ⊂ q. For each pair (p, q), where p, q ∈ Ac and p ⊂ q, let S be the set of all w ∈ Ac such that p ⊂ w ⊂ q. If |S| = 2|q\p| − 2, we add p q \ p to Π. Since there are at most O(|Ac |2 ) such pairs to check, and for each, it takes O(|Ac | ∗ |Ad |2 ) time to perform the test (i.e., for each w ∈ Ac we check if p ⊂ w ⊂ q), the time for the above process is bounded by O(|Ac |3 ∗ |Ad |2 ). Note that |Π| is bounded by O(|Ac |2 ). After the above process, all possible abstract prefixed power sets of A are in the resulting Π. Then, we remove all (redundant) π from Π if π is included in some other ξ ∈ Π. By Theorem 3.1, it takes O(|Ad |2 ) time to check if π is included in ξ. Therefore, the time for this redundancy removing process is bounded by O(|Ac |4 ∗ |Ad |2 ). As a result, Π consists of all nonredundant abstract prefixed power sets of A. By Definition 3.3, Π is A∗c . In total, it takes O(|Ac |4 ∗ |Ad |2 ) time to construct A∗ from A. Proof of Proposition 4.1: (1) Assume that I satisfies A; i.e., Ad ∩ I = Si ∈ Ac . Then, we have Ci = Si ∧ not (Ad \ Si ) with Si ⊆ I and (Ad \ Si ) ∩ I = ∅. This means that both Si and not (Ad \ Si ) are true in I. Hence, Ci is true in I and thus C1 ∨ ... ∨ Cm is true in I. Conversely, assume that C1 ∨ . . . ∨ Cm is true in I. Some Ci = Si ∧ not (Ad \ Si ) must be true in I, meaning that Si ⊆ I and (Ad \ Si ) ∩ I = ∅. This shows that Ad ∩ I = Si . Since Si ∈ Ac , I satisfies A. (2) Assume that I satisfies not A; i.e., Ad ∩ I ∈ Ac . Then, every Ci = Si ∧ not (Ad \ Si ) is false in I because either Si ⊆ I or (Ad \ Si ) ∩ I = ∅. Thus, not (C1 ∨ . . . ∨ Cm ) is true in I. Conversely, assume that not (C1 ∨ . . . ∨ Cm ) is true in I; i.e., every Ci = Si ∧ not (Ad \ Si ) is false in I. This means that for each Si ∈ Ac , either Si ⊆ I or (Ad \ Si ) ∩ I = ∅; therefore, Ad ∩ I = Si . This shows Ad ∩ I ∈ Ac ; thus I satisfies not A. Proof of Lemma 4.3: The proof is by induction on k with 1 6 k 6 m. When k = 1 (induction basis), F = a1 ∨ not a1 ≡ true. For the induction hypothesis, assume that F = 16i6k, Li ∈{ai ,not ai } L1 ∧ . . . ∧ Lk can be simplified to true by applying rule (2) for any k < m. This holds for k = m, as shown below: F = 16i6m, Li ∈{ai ,not ai } L1 ∧ . . . ∧ Lm ≡ [ 16i6(m−1), Li ∈{ai ,not ai } (L1 ∧ . . . ∧ Lm−1 ) ∧ am ] ∨ [ 16i6(m−1), Li ∈{ai ,not ai } (L1 ∧ . . . ∧ Lm−1 ) ∧ not am ] ≡ am ∧ [ 16i6(m−1), Li ∈{ai ,not ai } L1 ∧ . . . ∧ Lm−1 ] ∨ not am ∧ [ 16i6(m−1), Li ∈{ai ,not ai } L1 ∧ . . . ∧ Lm−1 ] ≡ am ∨ not am (by the induction hypothesis) ≡ true Characterizations of stable model semantics for constraint programs 555 Proof of Theorem 4.2: By Theorem 3.2, Ac and A∗c express the same set of admissible solutions to A in that for any S ⊆ Ad , S ∈ Ac if and only if A∗c contains an abstract prefixed power set W V covering S. Let V = {a1 , . . . , am }. Note that each W V in A∗c exactly covers the set {W ∪ S|S ⊆ V } of items in Ac , and all items in A∗c exactly cover all items in Ac . Since the semantics of each S ∈ Ac is S ∧ not (Ad \ S), the semantics of each W V in A∗c is . . ∧ Lm ) ∧ not (Ad \ (W ∪ V )) 16i6m, Li ∈{ai ,not ai } W ∧ (L1 ∧ . ≡ W ∧ not (Ad \ (W ∪ V )) ∧ [ 16i6m, Li ∈{ai ,not ai } L1 ∧ . . . ∧ Lm ] which, by Lemma 4.3, can be simplified to W ∧ not (Ad \ (W ∪ V )) by applying rule (2). Thus, we have A ≡ S ∈Ac S ∧ not (Ad \ S) ≡ W V ∈A∗c 16i6m, Li ∈{ai ,not ai } W ∧ (L1 ∧ . . . ∧ Lm ) ∧ not (Ad \ (W ∪ V )) ≡ W V ∈A∗c W ∧ not (Ad \ (W ∪ V )) Proof of Theorem 4.4: For any two W1 V1 , W2 V2 ∈ A∗c , we distinguish between three cases: (1) if W1 = W2 , then the two conjunctions W1 ∧ not (Ad \ (W1 ∪ V1 )) and W2 ∧ not (Ad \ (W2 ∪ V2 )) have no conflicting literals, thus they cannot be pairwise simplified using rule (2); (2) if W1 ⊂ W2 with |W2 | − |W1 | = 1, then V1 = V2 (otherwise, W1 V1 ∪ (W2 \ W1 ) should be in A∗c so that W1 V1 is not in A∗c ), which means that the two conjunctions W1 ∧not (Ad \(W1 ∪V1 )) and W2 ∧not (Ad \(W2 ∪V2 )) have at least two different literals, one in their positive part and another in their negative part, so that they cannot be pairwise simplified using rule (2); (3) otherwise (i.e., W1 = W2 and W1 ⊂ W2 and W2 ⊂ W1 , or W1 ⊂ W2 with |W2 | − |W1 | > 1), the two conjunctions W1 ∧ not (Ad \ (W1 ∪ V1 )) and W2 ∧ not (Ad \ (W2 ∪ V2 )) have at least two different positive literals, thus they cannot be pairwise simplified using rule (2). Proof of Theorem 4.5: By Proposition 4.1, I |= A if and only if I |= S ∈Ac S ∧not (Ad \ S), and by Theorem 4.2, if and only if I satisfies W V ∈A∗c W ∧ not (Ad \ (W ∪ V )). For each W V ∈ A∗c \ AIs , since it does not cover TAI , W ∧ not (Ad \ (W ∪ V )) is false in I. This means that W V ∈A∗c W ∧ not (Ad \ (W ∪ V )) is true in I if and only if W V ∈AIs W ∧ not (Ad \ (W ∪ V )) is true in I. Therefore, I |= A if and only if I |= W V ∈AIs W ∧ not (Ad \ (W ∪ V )). Proof of Theorem 4.6: When S is a satisfiable set, there is an abstract S-prefixed power set S S1 in A∗c such that TAI is covered by S S1 . By the definition of an abstract prefixed power set, every S with S ⊆ S ⊆ TAI is covered by S S1 . By Definition 3.2, every such S is in Ac . Proof of Theorem 5.1: Let M be a stable model of P obtained by applying the generalized Gelfond–Lifschitz transformation. Note that ⊥ is not in M. To prove that M is a model of P is to prove that for any rule r in P we have M |= r. By definition, if M |= head(r) or M |= body(r) then M |= r. Assume that M |= head(r) 556 Y.-D. Shen et al. and, on the contrary, that M |= body(r). Let r take the form H1 ∨ ... ∨ Hk ← B1 , . . . , Bm , A1 , . . . , An , not C1 , . . . , not Cl where each Bi or Ci is an atom and each Ai is a c-atom. Hi can be an atom or a c-atom. We then have M |= Bi , M |= Ai , M |= not Ci and M |= Hi . For every negative literal not Ci in body(r), since M |= not Ci it will be removed in the second operation of the generalized Gelfond–Lifschitz transformation. For every c-atom Ai in body(r), since M |= Ai it will be replaced in the third operation by a special atom θAi along with a new rule θAi ← D1 , . . . , Dt for each satisfiable set {D1 , . . . , Dt } of Ai w.r.t. TAMi . As a result, the generalized Gelfond–Lifschitz transformation P M contains the following rules derived from r: H1 ∨ . . . ∨ Hk ← B1 , . . . , Bm , θA1 , . . . , θAn , θAi ← D1 , . . . , Dt , for each c-atom Ai and each satisfiable set {D1 , . . . , Dt } of Ai w.r.t. TAMi Here, Hi is Hi if Hi is an atom; or when Hi is a c-atom, Hi is ⊥ because M |= Hi (Hi is replaced by ⊥ in the fourth operation). Let N be a minimal model of P M with M = N \ Γ (which leads to M being a stable model of P ). For each c-atom Ai , we have M ∩ Aid = N ∩ Aid = TAMi . Since each satisfiable set {D1 , . . . , Dt } of Ai is a subset of TAMi , we have {D1 , . . . , Dt } ⊆ M ⊆ N. This means that for each Ai , the body of the rule θAi ← D1 , . . . , Dt in P M is satisfied in N. Since N is a minimal model of P M , the head θAi of the above rule must be in N. As a result, the body of the rule H1 ∨ . . . ∨ Hk ← B1 , . . . , Bm , θA1 , . . . , θAn in P M is satisfied in N, thus some Hj in the head is in N. Since no Hi is a special atom prefixed with θ or β, Hj is also in M. Since ⊥ is not in M, Hj must be Hj in the rule r. This means that M satisfies head(r), contradicting the assumption M |= head(r). We then conclude that M is a model of P . Proof of Theorem 5.2: Let I be a stable model of P and M be a minimal model of the generalized Gelfond–Lifschitz transformation P I with I = M \ Γ. Let (P I )i be obtained from P after performing the ith operation (i = 1, . . . , 4) in Definition 5.1. Note that P I = (P I )4 . Since every c-atom A appearing in each rule head is an elementary c-atom of the form ({a}, {{a}}), the semantics of P will not be changed if we replace A in the head with a new symbol βA and define βA by the two rules βA ← a and a ← βA (expressing βA ≡ a). This means that when c-atoms in the rule heads are all elementary, performing the fourth operation in Definition 5.1 does not change the semantics of P . Therefore, since M is a minimal model of (P I )4 , M \ Γβ is a minimal model of (P I )3 . Note that for each rule (introduced in the third operation) of the form θA ← W , where W = {A1 , . . . , Am } is a satisfiable set, we have W ⊂ M \ Γβ and θA ∈ M \ Γβ . Characterizations of stable model semantics for constraint programs 557 Let Q be the set of rules in (P I )3 whose heads are not special atoms prefixed with θ. For any nonempty set S of M \ Γ, M \ (Γβ ∪ S) will not satisfy Q; otherwise, M \ Γβ would not be a minimal model of (P I )3 . Let Q1 be (P I )3 such that all rules θA ← W with the same head θA are replaced by a compact rule W ∧ not (Ad \ (W ∪ V )) θA ← W V ∈A∗c Since M \ Γβ is a minimal model of (P I )3 , M \ Γβ is a minimal model of Q1 . Now let Q2 be Q1 obtained by first replacing all occurrences of each θA in rule bodies with the body of the above compact rule, then removing all compact rules. Since M \ Γβ is a minimal model of Q1 , M \ Γ is a minimal model of Q2 . Note I = M \ Γ. By Theorem 4.2, we can replace each W V ∈A∗c W ∧ not (Ad \ (W ∪ V )) in Q2 with c-atom A without changing the semantics of Q2 . This transforms Q2 into (P I )2 . Therefore, I is a minimal model of (P I )2 . (P I )2 is (P I )1 with all negative literals removed. Since all such negative literals are satisfied by I, that I is a minimal model of (P I )2 implies I is a minimal model of (P I )1 . (P I )1 is P with those rules removed whose bodies are no satisfied by I. Assume, on the contrary, that some M ⊂ I is a model of P . Since I is a minimal model of (P I )1 , (P I )1 is not satisfied by M. Since (P I )1 ⊆ P , P is not satisfied by M, a contradiction. As a result, I is a minimal model of P . This concludes the proof. The following lemma is required for the proof of Theorem 5.3. Lemma Appendix A.1 Let P be a positive logic program with ordinary atoms and A be a literal in P . Let P be P with each occurrence of A in rule bodies replaced by a special atom θA , and each occurrence of A in rule heads replaced by a special atom βA , where θA is defined in P by a rule θA ← A, and βA is defined in P by two rules A ← βA and βA ← A. An interpretation I is a stable model of P if and only if M is a stable model of P with I = M \ {θA , βA }. Proof: Since θA is used only to replace A in rule bodies, it can be derived from P only by applying the rule θA ← A. That is, if θA is in a stable model of P , A must be in the model. The converse also holds. Therefore, replacing θA with A does not change the semantics of P . For βA , the two rules A ← βA and βA ← A express A ≡ βA . Thus, replacing βA with A does not change the semantics of P . After the above replacement, we transform P to P . Therefore, P and P have the same stable models. Proof of Theorem 5.3: Let not A be a negative literal in the body of a rule r of P , which is replaced in P by a c-atom A = ({A}, {∅}). When I |= not A (i.e., 558 Y.-D. Shen et al. A ∈ I), we have I |= A ; when I |= not A (i.e., A ∈ I), we have I |= A . For the former case, r will be removed in the first operation, from P under the standard Gelfond–Lifschitz transformation, and from P under the generalized Gelfond– Lifschitz transformation. For the latter case, not A will be removed from r under the standard Gelfond–Lifschitz transformation, while A will be replaced, under the generalized Gelfond–Lifschitz transformation, by a special atom θA , where θA is defined by a bodiless rule θA in P . In this case, θA can be removed from P . Let P I be the standard Gelfond–Lifschitz transformation of P w.r.t. I. We can further remove all rules from P I whose body contains a positive literal A ∈ I, since if I is a stable model, A will not be derived from P I and thus these rules will not be applicable. These rules will also be removed from P in the first operation of the generalized Gelfond–Lifschitz transformation, as A ∈ I implies I |= ({A}, {{A}}). As a result, the resulting standard transformation P I of P is the same as P I obtained by applying to P the first two operations of the generalized Gelfond–Lifschitz transformation, except that each atom A in P I is replaced in P I by a c-atom ({A}, {{A}}). Then, after applying to P I the third and fourth operations of the generalized Gelfond–Lifschitz transformation, P I becomes P I except that for each literal A in P I , each occurrence of A in rule bodies are replaced by a special atom θA , and each occurrence of A in rule heads replaced by a special atom βA , where θA is defined in P I by a rule θA ← A, and βA is defined in P I by two rules A ← βA and βA ← A. By Lemma A, I is a stable model of P I if and only if M is a stable model of P I with I = M \ Γ. This means that I is a stable model of P if and only if it is a stable model of P . Proof of Theorem 5.4: The first part of the theorem is straightforward, as all satisfiable sets of A w.r.t. TAI can be obtained simply by comparing each W V in A∗c with TAI to see if it covers TAI . For the second part of the theorem, the time complexity of the generalized Gelfond–Lifschitz transformation consists of the following three parts: (a) The time complexity of the standard Gelfond–Lifschitz transformation of P with all c-atoms ignored. This is linear in the number |P | of rules in P . (b) The time complexity of computing all satisfiable sets of all n c-atoms. As just proved above, it is bounded by O(n ∗ MA∗c ). (c) The time complexity of introducing new rules for all n c-atoms. Assume that it takes constant time to introduce a new rule for a special atom θA or βA (see the third and fourth operations). Then, the time complexity of this part is bounded by O(n ∗ (MA∗c + MAd + 1)), as the generalized Gelfond–Lifschitz transformation introduces at most 2 ∗ n special atoms (one θA and one βA for each c-atom A), each accompanied by at most MA∗c (for θA ) or MAd + 1 (for βA ) new rules. The total time complexity of the generalized Gelfond–Lifschitz transformation is then bounded by O(|P | + n ∗ (2MA∗c + MAd + 1)). Proof of Theorem 5.6: For normal constraint programs, since our stable model semantics coincides with that of Son et al. (2007), the complexity of the latter semantics applies, which is known to be NP-complete (stated in Liu et al. 2007 as part of computation-based semantics and proved in You et al. 2007). Characterizations of stable model semantics for constraint programs 559 It is known that the decision problem for disjunctive programs (without c-atoms) is Σ2P -complete (Eiter and Gottlob 1993). Since disjunctive programs are disjunctive constraint programs, the decision problem is at least as hard as for disjunctive programs, i.e., it is Σ2P -hard. To see that the problem is in Σ2P , we first note that replacing c-atoms by their abstract representations takes polynomial time, in the size of P (cf. Theorem 3.5), so does the generalized Gelfond–Lifschitz transformation (cf. Theorem 5.4) for a given interpretation I. Then, to determine whether M is a minimal model of the generalized Gelfond–Lifschitz transformation P I (cf. Definition 5.2) is to determine whether M is a minimal model of a positive disjunctive program. Therefore, the fact that the latter is in Σ2P implies that the former is also in Σ2P . Proof of Theorem 6.1: (=⇒) Assume R |=I A. By Definition 6.1, R |= A and for every S such that R ∩ Ad ⊆ S and S ⊆ TAI , we have S ∈ Ac . By Definition 3.2, the collection of abstract (R ∩ Ad )-prefixed power sets of A contains R ∩ Ad Si with Si ⊇ TAI \ (R ∩ Ad ), which covers all S with R ∩ Ad ⊆ S ⊆ TAI . By Definition 3.3, A∗c contains an abstract prefixed power set W V such that R ∩ Ad Si is included in W V . Since Si ⊇ TAI \ (R ∩ Ad ), R ∩ Ad TAI \ (R ∩ Ad ) is included in R ∩ Ad Si , hence R ∩ Ad TAI \ (R ∩ Ad ) is included in W V . Note that in this case, W ⊆ R ∩ Ad , and since W V covers TAI , W is a satisfiable set of A w.r.t. TAI . (⇐=) Assume that A∗c has an abstract prefixed power set W V such that R ∩ Ad TAI \ (R ∩ Ad ) is included in W V . Then, W V covers the whole collection covered by R ∩ Ad TAI \ (R ∩ Ad ). This means that W V covers every S with R ∩ Ad ⊆ S and S ⊆ TAI . Since W V is in A∗c , this collection covered by W V is included in Ac and thus R |= A. By Definition 6.1, we have R |=I A. Note again that in this case, W ⊆ R ∩ Ad and W is a satisfiable set of A w.r.t. TAI . Proof of Theorem 6.2: Let P I be the generalized Gelfond–Lifschitz transformation. Since P I is a positive normal logic program, it has a least model which is the fixpoint i TP∞I (∅) with TP0 I (∅) = ∅ and TPi+1 I (∅) = TP I (TP I (∅)), where the operator TP I is defined by ∃r ∈ P I : R |= body(r), TP I (R) = A . head(r) = A We want to prove, by induction on i > 0, that TPi (∅, I) = TP3iI (∅) \ Γ. As induction basis, when i = 0, TP0 (∅, I) = TP3∗0 I (∅) = ∅. For induction hypothesis, assume that for any i 6 k we have TPi (∅, I) = TP3iI (∅) \ Γ. Now consider i = k + 1. (=⇒) Assume that I is a stable model under the fixpoint definition of Son et al. (2007). We first prove that for each atom B derived in TPk+1 (∅, I) (i.e., B ∈ TPk+1 (∅, I) (∅). By Definition 6.2, there is a rule r in P of but B ∈ TPk (∅, I)), we have B ∈ TP3(k+1) I the form r: ({B}, {{B}}) ← A1 , . . . , Am such that TPk (∅, I) |=I body(r). Consider an arbitrary c-atom Aj in body(r). Note that TPk (∅, I) |=I Aj . By Theorem 6.1, there is a satisfiable set W of Aj w.r.t. TAI j = I ∩ Ajd 560 Y.-D. Shen et al. such that W ⊆ TPk (∅, I) ∩ Ajd . Let W = {D1 , . . . , Dt } ⊆ TPk (∅, I). The generalized Gelfond–Lifschitz transformation P I must contain the following rules: (1) βB ← θA1 , . . . , θAm , (2) B ← βB , (3) θAj ← D1 , . . . , Dt . By the induction hypothesis, {D1 , . . . , Dt } ⊆ TP3kI (∅). Due to this, rule (3) can be (∅). This process applies to all c-atoms Aj in body(r) so applied, leading to θAj ∈ TP3k+1 I (∅). Rule (1) is then applied, leading to βB ∈ TP3k+2 (∅). that θA1 , . . . , θAm are all in TP3k+1 I I 3k+3 Then, rule (2) is applied, leading to B ∈ TP I (∅). The above induction shows that for any atom B ∈ TPi (∅, I), we have B ∈ TP3iI (∅). When i → ∞, TP∞ (∅, I) ⊆ TP∞I (∅). Since I is a stable model under Son et al.’s fixpoint definition with TP∞ (∅, I) = I and contains no special atoms, we have I ⊆ TP∞I (∅) \ Γ. Next, we prove that when I is a stable model under Son et al.’s fixpoint definition, (∅), there we have TP∞I (∅) \ Γ ⊆ I. For any (nonspecial) atom B derived in TP3(k+1) I must be a rule r as above in P and a rule of form (2) in P I derived from r such (∅) by applying rule (1) where each θAj is satisfiable in that βB is derived in TP3k+2 I 3k+1 (∅) and at least one θ (∅) by applying rule (3) where each TP3k+1 I Aj is derived in TP I 3k atom Dj is satisfiable in TP I (∅). By the induction hypothesis, TPk (∅, I) = TP3kI (∅) \ Γ, so TPk (∅, I) |= {D1 , . . . , Dt }. Let W = {D1 , . . . , Dt }. Since W comes from rule (3), it is a satisfiable set of Aj w.r.t. TAI j = I ∩ Ajd . By Definition 4.1, A∗jc contains an abstract W -prefixed power set W V covering TAI j . So, W TAI j \ W is included in W V . Since TPk (∅, I) ⊆ TP∞ (∅, I) = I, we have W ⊆ TPk (∅, I) ∩ Ajd ⊆ TAI j . By Theorem 3.1, TPk (∅, I) ∩ Ajd TAI j \ (TPk (∅, I) ∩ Ajd ) is included in W TAI j \ W , thus it is included in W V . By Theorem 6.1, TPk (∅, I) |=I Aj . This holds for all Aj in body(r). By Definition 6.2, B is in TPk+1 (∅, I). This induction shows that for any nonspecial atom B ∈ TP3iI (∅), we have B ∈ TPi (∅, I). When i → ∞, TP∞I (∅) \ Γ ⊆ TP∞ (∅, I) = I. The above proof concludes that when I is a stable model under Son et al.’s fixpoint definition, TP∞I (∅) \ Γ = I. Hence, by Definition 5.2 I is a stable model derived from the generalized Gelfond–Lifschitz transformation. (⇐=) Assume that I is a stable model, with TP∞I (∅) \ Γ = I, derived from the generalized Gelfond–Lifschitz transformation. Copying the same proof as the first part above, we can prove that any nonspecial atom B derived in TPk+1 (∅, I) is in (∅). That is, TP∞ (∅, I) ⊆ TP∞I (∅) \ Γ = I. Next, we prove the converse part: TP3(k+1) I I ⊆ TP∞ (∅, I). (∅), there must be a rule r as above For any (nonspecial) atom B derived in TP3(k+1) I (∅) in P and a rule of form (2) in P I derived from r such that βB is derived in TP3k+2 I (∅) and at least one θ by applying rule (1) where each θAj is satisfiable in TP3k+1 I Aj is 3k+1 3k derived in TP I (∅) by applying rule (3) where each atom Dj is satisfiable in TP I (∅). By the induction hypothesis, TPk (∅, I) = TP3kI (∅) \ Γ, so TPk (∅, I) |= {D1 , . . . , Dt }. Let W = {D1 , . . . , Dt }. Since W comes from rule (3), it is a satisfiable set of Aj w.r.t. TAI j = I ∩ Ajd . By Definition 4.1, A∗jc contains an abstract W -prefixed power set W V covering TAI j . So, W TAI j \ W is included in W V . Note that TPk (∅, I) ⊆ I because TP3kI (∅) \ Γ ⊆ TP∞I (∅) \ Γ = I. Then, we have W ⊆ TPk (∅, I) ∩ Ajd ⊆ TAI j . By Characterizations of stable model semantics for constraint programs 561 Theorem 3.1, TPk (∅, I)∩Ajd TAI j \(TPk (∅, I)∩Ajd ) is included in W TAI j \W , thus it is included in W V . By Theorem 6.1, TPk (∅, I) |=I Aj . This holds for all Aj in body(r). By Definition 6.2, B is in TPk+1 (∅, I). This induction shows that for any nonspecial atom B ∈ TP3iI (∅), we have B ∈ TPi (∅, I). When i → ∞, TP∞I (∅) \ Γ ⊆ TP∞ (∅, I). That is, I ⊆ TP∞ (∅, I). The above proof concludes that when I is a stable model derived from the generalized Gelfond–Lifschitz transformation, TP∞ (∅, I) = I. Hence, I is also a stable model under Son et al.’s fixpoint definition. Proof of Lemma 7.1: First, we note that, under the assumptions of basic programs in this section, part 4 in Definition 5.2 can be omitted. Thus, that I is a stable model of P if and only if M = I ∪ Γθ is the least model of the generalized Gelfond– Lifschitz transformation P I , if and only if M is the least model of the standard Gelfond–Lifschitz transformation PnM . Proof of Theorem 7.2: We know that the same claims hold for normal programs ((1), (3), and (4) are due to Fages 1994, and (2) due to You and Yuan 1994), where the dependency graph is defined as: for each rule a ← b1 , . . . , bm , not c1 , . . . , not cn in a normal program, there is a positive edge from a to each bi , 1 6 i 6 m, and a negative edge from a to each cj , 1 6 j 6 n. Let us denote by GN P the dependency graph for a normal program P . Recall that we use GP to denote the dependency graph for a basic program P . Let P be a basic program and Pn be its normal program translation. By definition, for any positive edge u →+ v in GP , there is a path u →+ θAi →+ v in GN Pn , for some new symbol θAi , and vice versa. Similarly, for any negative edge u →− v in GP , there is a path u →+ θAi →− v in GN Pn , and vice versa. Therefore, for any loop L in GP , with some additional positive edges to new symbols, and there is a loop L in GN Pn vice versa. Therefore, there is a one-to-one correspondence between loops in GP and those in GN Pn , modulo the new symbols θAi . Notice that the extra positive edges have no effect on the type of the loops based on negative dependency; i.e., for any odd cycle in GP , the same odd cycle with some additional positive edges is in GN Pn , and vice versa; similarly for even cycles. Let P be a basic program. Suppose P is call-consistent, i.e., P has no odd cycles in GP . By the one-to-one correspondence between cycles, Pn has no odd cycles in GN Pn . Thus, according to Fages (1994), a stable model, say M, exists for Pn . By Lemma 7.1, M|At(P ) is a stable model of P . This proves claim (1). Now assume P has more than one stable model, say M1 and M2 (and possibly others). By Lemma 7.1, Pn has stable models S1 and S2 such that S1|At(P ) = M1 and S2|At(P ) = M2 . Thus, according to (You and Yuan 1994), Pn has an even loop in GN Pn , and it follows that P has an even loop in GP . This proves claim (2). Now assume P is acyclic in GP . Then Pn is acyclic in GN Pn . By Lemma 7.1 again, that Pn has a unique stable model implies the same for P . This shows claim (3). Finally, suppose P has no positive cycles in GP . Let M be a supported model of P . We can extend M to be a supported model of Pn by adding extra symbols δAi in the following way: whenever a rule of the form 562 Y.-D. Shen et al. (4) in P supports atom H in M, add θAi (1 6 i 6 n) of the rule (5) in Pn to M. Let the resulting set be S. That is, M = S|At(P ) . Clearly, S is a supported model of Pn . Since Pn has no positive cycle in GN Pn , S is a stable model of Pn , and by Lemma 7.1, M is a stable model of P . This proves claim (4). References Baptiste, P. and Pape, C. 1996. Disjunctive constraints for manufacturing scheduling: Principles and extensions. International Journal of Computer Integrated Manufacturing 9 (4), 306–310. Baral, C. 2003. Knowledge Representation, Reasoning and Declarative Problem Solving with Answer Sets. Cambridge University Press, Cambridge. Calimeri, F., Faber, W., Leone, N. and Perri, S. 2005. Declarative and computational properties of logic programs with aggregates. In Proc. IJCAI’05, Edinburgh, UK. Professional Book Center, 406–411. Cohen, D., Jeavons, P. and Jonsson, P. 2000. Building tractable disjunctive constraints. Journal of the ACM 47 (5), 826–853. Dell’Armi, T., Faber, W., Ielpa, G., Leone, N., and Pfeifer, G. 2003. Aggregate functions in disjunctive logic programming: semantics, complexity and implementation in dlv. In Proc. IJCAI’03, Acapulco, Mexico. Morgan Kaufmann, 847–852. Dell’Armi, T., Faber, W., Lelpa, G., and Leone, N. 2003. Aggregate functions in disjunctive logic programming: semantics, complexity, and implementation in DLV. In Proc. IJCAI’03, Utrecht, the Netherlands. Lecture Notes in Computer Science 1048, Springer, 847–852. Denecker, M., Pelov, N. and Bruynooghe, M. 2001. Ultimate well-founded and stable semantics for logic programs with aggregates. In Proc. ICLP’01, Paphos, Cyprus. Lecture Notes in Computer Science 2237, Springer, 212–226. Eiter, T. and Gottlob, G. 1993. Complexity results for disjunctive logic programming and application to nonmonotonic logics. In Proc. International Logic Programming Symposium, Vancouver, Canada. MIT Press, 266–278. Elkabani, I., Pontelli, E. and Son, T. C. 2004. Smodels with clp and its applications: A simple and effective approach to aggregates in asp. In Proc. ICLP’04, Saint-Malo, France. Lecture Notes in Computer Science 3132, Springer, 73–89. Elkabani, I., Pontelli, E. and Son, T. C. 2005. Smodelsa − A system for computing answer sets of logic programs with aggregates. In Proc. LPNMR’05, Diamante, Italy. Lecture Notes in Computer Science 3662, Springer, 427–431. Faber, W., Leone, N. and Pfeifer, G. 2004. Recursive aggregates in disjunctive logic programs: Semantics and complexity. In Proc. JELIA’04, Lisbon, Portugal. Lecture Notes in Computer Science 33229, Springer, 200–212. Fages, F. 1994. Consistency of Clark’s completion and existence of stable models. Journal of Methods of Logic in Computer Science 1, 51–60. Ferraris, P. 2005. Answer sets for propositional theories. In Proc. LPNMR’05, Diamante, Italy. Lecture Notes in Computer Science 3662, Springer, 119–131. Gelfond, M. and Leone, N. 2002. Logic programming and knowledge representation – The a-prolog perspective. Artificial Intelligence 138 (1–2), 3–38. Gelfond, M. and Lifschitz, V. 1988. The stable model semantics for logic programming. In Proc. ICLP’88, Seattle, Washington. MIT Press, 1070–1080. Gelfond, M. and Lifschitz, V. 1991. Classical negation in logic programs and disjunctive databases. New Generation Computing 9, 365–385. Characterizations of stable model semantics for constraint programs 563 Lifschitz, V. 2002. Answer set programming and plan generation. Artificial Intelligence 138 (1–2), 39–54. Liu, L., Pontelli, E., Son, T. and Truszczynski, M. 2007. Logic programs with abstract constraint atoms: the role of computations. In Proc. ICLP’07, Porto, Portugal. Lecture Notes in Computer Science 4670, Springer, 286–301. Liu, L. and Truszczynski, M. 2005. Properties of programs with monotone and convex constraints. In Proc. AAAI’05, Pittsburgh, USA. AAAI Press/The MIT Press, 701–706. Liu, L. and Truszczynski, M. 2006. Properties and applications of programs with monotone and convex constraints. Journal of Artificial Intelligence Research 7, 299–334. Marek, V., Niemelä, I. and Truszczyński, M. 2008. Logic programs with monotone abstract constraint atoms. Theory and Practice of Logic Programming 8 (2), 167–199. Marek, V. W. and Remmel, J. B. 2004. Set constraints in logic programming. In Proc. LPNMR’04, Fort Lauderdale, USA. Lecture Notes in Computer Science 2923, Springer, 167–179. Marek, V. W. and Truszczynski, M. 1999. Stable models and an alternative logic programming paradigm. In The Logic Programming Paradigm: A 25-Year Perspective. Springer, 375–398. Marek, V. W. and Truszczynski, M. 2004. Logic programs with abstract constraint atoms. In Proc. AAAI’04, San Jose, USA. AAAI Press/The MIT Press, 86–91. Marriott, K., Moulder, P. and Stuckey, P. 2001. Solving disjunctive constraints for interactive graphical applications. In Proc. CP’01, Paphos, Cyprus. Lecture Notes in Computer Science 2239, Springer, 361–376. Mittal, S. and Falkenhainer, B. 1990. Dynamic constraint satisfaction problems. In Proc. AAAI’90, Boston, USA. AAAI Press/The MIT Press, 25–32. Niemela, I. 1999. Logic programs with stable model semantics as a constraint programming paradigm. Annals of Mathematics and Artificial Intelligence 25, 241–273. Pelov, N. 2004. Semantics of Logic Programs with Aggregates. Ph.D. thesis, Katholieke Universiteit Leuven, Leuven, http://www.cs.kuleuven.ac.be/publicaties/doctoraten/cw/ cw2004 02.abs.html. Pelov, W., Denecker, M. and Bruynooghe, M. 2003. Translation of aggregate programs to normal logic programs. In CEUR Workshop Proceedings, CEUR-WS.org, Messina, Italy, 29–42. Pelov, W., Denecker, M. and Bruynooghe, M. 2007. Well-founded and stable semantics of logic programs with aggregates. Theory and Practice of Logic Programming 7 (3), 301–353. Pelov, W. and Truszczynski, M. 2004. Semantics of disjunctive programs with monotone aggregates − An operator-based approach. In Proc. NMR’04, Whistler, Canada, 327–334. Przymusinski, T. C. 1991. Stable semantics for disjunctive programs. New Generation Computing 9, 401–424. Sato, T. 1990. Completed logic programs and their consistency. Journal of Logic Programming 9 (1), 33–44. Shen, Y. D. and You, J. H. 2007. A generalized Gelfond–Lifschitz transformation for logic programs with abstract constraints. In Proc. AAAI’07, Vancouver, Canada. AAAI Press, 483–488. Simons, P., Niemela, I. and Soininen, T. 2002. Extending and implementing the stable model semantics. Artificial Intelligence 138 (1–2), 181–234. Son, T. C. and Pontelli, E. 2007. A constructive semantic characterization of aggregates in answer set programming. Theory and Practice of Logic Programming 7 (3), 355–375. Son, T. C., Pontelli, E. and Tu, P. H. 2006. Answer sets for logic programs with arbitrary abstract constraint atoms. In Proc. AAAI’06, Boston, USA. AAAI Press, 129–134. 564 Y.-D. Shen et al. Son, T. C., Pontelli, E. and Tu, P. H. 2007. Answer sets for logic programs with arbitrary abstract constraint atoms. Journal of Artificial Intelligence Research 29, 353–389. You, J. and Yuan, L. 1994. A three-valued semantics for deductive databases and logic programs. Journal of Computer and System Sciences 49, 334–361. You, J. H., Yuan, L. Y., Liu, G. H. and Shen, Y. D. 2007. Logic programs with abstract constraints: representation, disjunction, and complexities. In Proc. LPNMR’07, Tempe, USA. Lecture Notes in Computer Science 4483, Springer, 228–240.