Answer Sets for Logic Programs with Arbitrary Abstract Constraint Atoms

In this paper, we present two alternative approaches to defining answer sets for logic programs with arbitrary types of abstract constraint atoms (c-atoms). These approaches generalize the fixpoint-based and the level mapping based answer set semantics of normal logic programs to the case of logic programs with arbitrary types of c-atoms. The results are four different answer set definitions which are equivalent when applied to normal logic programs. The standard fixpoint-based semantics of logic programs is generalized in two directions, called answer set by reduct and answer set by complement. These definitions, which differ from each other in the treatment of negation-as-failure (naf) atoms, make use of an immediate consequence operator to perform answer set checking, whose definition relies on the notion of conditional satisfaction of c-atoms w.r.t. a pair of interpretations. The other two definitions, called strongly and weakly well-supported models, are generalizations of the notion of well-supported models of normal logic programs to the case of programs with c-atoms. As for the case of fixpoint-based semantics, the difference between these two definitions is rooted in the treatment of naf atoms. We prove that answer sets by reduct (resp. by complement) are equivalent to weakly (resp. strongly) well-supported models of a program, thus generalizing the theorem on the correspondence between stable models and well-supported models of a normal logic program to the class of programs with c-atoms. We show that the newly defined semantics coincide with previously introduced semantics for logic programs with monotone c-atoms, and they extend the original answer set semantics of normal logic programs. We also study some properties of answer sets of programs with c-atoms, and relate our definitions to several semantics for logic programs with aggregates presented in the literature.


Introduction and Motivation
Logic programming under the answer set semantics has been introduced as an attractive and suitable knowledge representation language for AI research (Baral, 2005), as it offers several desirable properties for this type of applications.Among other things, the language is declarative and it has a simple syntax; it naturally supports non-monotonic reasoning, and it is sufficiently expressive for representing several classes of problems (e.g., normal logic programs capture the class of NP-complete problems); it has solid theoretical foundations with a large body of building block results (e.g., equivalence between programs, systematic program development, relationships to other non-monotonic formalisms), which is extremely useful in the development and validation of large knowledge bases; it also has a large number of efficient computational tools.For further discussion of these issues, the interested reader is referred to the book of Baral (2003), the overview paper of Gelfond and Leone (2002), the paper of Marek and Truszczyński (1999), and the paper of Niemelä (1999).
A large number of extensions of logic programming, aimed at improving its usability in the context of knowledge representation and reasoning, have been proposed.The Smodels system introduces weight and cardinality constraint atoms to facilitate the encoding of constraints on atom definitions (Simons, Niemelä, & Soininen, 2002).These constructs can be generalized to aggregates; aggregates have been extensively studied in the general context of logic programming by the work of (see, e.g., Kemp & Stuckey, 1991;Mumick, Pirahesh, & Ramakrishnan, 1990;Gelder, 1992), and further developed in recent years (see, e.g., Dell'Armi, Faber, Ielpa, Leone, & Pfeifer, 2003;Denecker, Pelov, & Bruynooghe, 2001;Elkabani, Pontelli, & Son, 2004;Faber, Leone, & Pfeifer, 2004;Gelfond, 2002;Pelov, 2004;Son & Pontelli, 2007).Both dlv (Eiter, Leone, Mateis, Pfeifer, & Scarcello, 1998) and Smodels have been extended to deal with various classes of aggregates (Dell'Armi et al., 2003;Elkabani, Pontelli, & Son, 2005).The semantics of these extensions have been defined either indirectly, by translating programs with these extensions to normal logic programs, or directly, by providing new characterizations of the concept of answer sets for programs with such extensions.Each of the above mentioned extensions to logic programming has been introduced to facilitate the representation of a desirable type of knowledge in logic programming.As such, it is not a surprise that the focus has been on the definition of the semantics and little has been done to investigate the basic building block results for the new classes of logic programs.In this context, the study of a uniform framework covering various classes of extensions will provide us with several benefits.For example, to prove (or disprove) whether a basic building block result (e.g., splitting theorem) can be extended to the new classes of logic programs, we will need to prove (or disprove) this result only once; new results in the study of the generic framework are applicable to the study of one of the aforementioned extensions; etc. Naturally, for these studies to be possible, a uniform framework whose semantical definition exhibits the behavior of various extensions of logic programming, needs to be developed.The main goal in this paper is to address this issue.
The concept of logic programs with abstract constraint atoms (or c-atoms) has been introduced by Marek, Remmel, and Truszczyński as an elegant theoretical framework for investigating, in a uniform fashion, various extensions of logic programming, including cardinality constraint atoms, weight constraint atoms, and more general forms of aggregates (Marek & Remmel, 2004;Marek & Truszczyński, 2004).Intuitively, a c-atom A represents a constraint on models of the program containing A-and the description of A includes an explicit description of what conditions each interpretation has to meet in order to satisfy A. This view is very general, and it can be shown to subsume the description of traditional classes of aggregates (e.g., Sum, Count, Min, etc.). 1 Thus, programs with weight constraint atoms or other aggregates can be represented as logic programs with c-atoms.
The first explicit definition of answer sets for positive programs with arbitrary c-atoms (i.e., programs without the negation-as-failure operator)-called programs with set constraints or SC-programs-has been introduced in the work of Marek and Remmel (2004).
In this work answer sets for programs with c-atoms are defined by extending the notion of answer sets for programs with weight constraint atoms proposed in the work of Niemelä, Simons, and Soininen (1999).Nevertheless, this approach provides, in certain cases, unintuitive answer sets (see, e.g., Examples 7 and 20).In particular, the approach of Marek and Remmel does not naturally capture some of the well-agreed semantics for aggregates.One of our main goals in this paper is to investigate alternative solutions to the problem of characterizing answer sets for programs with arbitrary c-atoms.Our aim is to match the semantics provided in the more recent literature for monotone c-atoms, and to avoid the pitfalls of the approach developed in the work of Marek and Remmel (2004).
The concept of answer sets for programs with c-atoms has been later revisited by Marek and Truszczyński (2004), focusing on answer sets for programs with monotone constraint atoms, where a c-atom A is monotone if, for each pair of interpretations I and I with I ⊆ I , we have that I satisfies A implies that I satisfies A. This proposal has been further extended to the case of disjunctive logic programs with monotone c-atoms (Pelov & Truszczyński, 2004).In another paper (Liu & Truszczyński, 2005b), it is extended to deal with convex c-atoms where a c-atom A is convex if, for every pair of interpretations I and J with I ⊆ J, we have that I and J satisfy A implies that I satisfies A for every I ⊆ I ⊆ J.This paper also proves several properties of programs with monotone and convex c-atoms.It is shown that many well-known properties of standard logic programming under answer set semantics are preserved in the case of programs with monotone c-atoms.
The main advantage of focusing on monotone c-atoms lies in that monotonicity provides a relatively simpler way for defining answer sets of logic programs with c-atoms.On the other hand, this restriction does not allow several important classes of problems to be directly expressed.For example2 , the aggregate atom Min({X | p(X)}) > 2 cannot be viewed as a monotone aggregate atom-since monotonic extensions of the definition of p might make the aggregate false; e.g., the aggregate is true if {p(3)} is the definition of p, but it becomes false if we consider a definition containing {p(3), p(1)}.Similarly, the cardinality constraint atom 1 {a, b} 1 is not a monotone constraint.Neither of these two examples can be directly encoded using monotone c-atoms.
The studies in Marek and Remmel (2004), Marek and Truszczyński (2004) and in Liu and Truszczyński (2005b) lead to the following question: "what are the alternatives to the approach to defining answer sets of programs with arbitrary c-atoms developed by Marek and Remmel (2004)?"Furthermore, will these alternatives-if any-capture the semantics of programs with monotone c-atoms proposed by Marek and Truszczyński (2004) and avoid the pitfalls of the notion of answer sets for arbitrary c-atoms in Marek and Remmel (2004)?
We present two equivalent approaches for defining answer sets for logic programs with arbitrary c-atoms.
• The first approach is inspired by the notion of conditional satisfaction-originally developed in Son and Pontelli (2007)-to characterize the semantics of logic programs with aggregates.We generalize this notion to the case of programs with c-atoms.The generalization turns out to be significantly more intuitive and easier to understand than the original definition in Son and Pontelli (2007).Using this notion, we define an immediate consequence operator T P for answer set checking.
• The second approach is inspired by the notion of well-supportedness, proposed by Fages (1994) for normal logic programs.
The approaches are very intuitive, and, we believe, they improve over the only other semantics proposed for logic programs with arbitrary c-atoms in Marek and Remmel (2004).
We show that the newly defined semantics coincide with the previously introduced semantics in Marek and Truszczyński (2004) in the case of programs with monotone c-atoms, and they extend the original stable model semantics for normal logic programs.We discuss different approaches for treating negation-as-failure c-atoms.We also relate our definitions to several semantics for logic programs with aggregates, since the notion of c-atom can be used to encode arbitrary aggregates.These results show that the proposed framework naturally subsumes many existing treatments of aggregates in logic programming.
In summary, the main contributions of the paper are: • A new notion of fixpoint answer set for programs with arbitrary c-atoms, which is inspired by the fixpoint construction proposed in Son and Pontelli (2007) (but simpler) and which differs significantly from the only proposal for programs with arbitrary catoms in Marek and Remmel (2004); this will lead to two different definitions of answer sets (answer set by reduct and answer set by complement); • A generalization of the notion of well-supported models in Fages (1994) to programs with arbitrary c-atoms, which-to the best of our knowledge-has not been investigated by any other researchers, which leads to the notions of weakly and strongly well-supported models; • A result showing that the set of answer sets by reduct (resp.by complement) is equivalent to the set of weakly (resp.strongly) well-supported models; and • A number of results showing that the newly defined notions of answer sets capture the answer set semantics of various extensions to logic programming, in those cases all the previously proposed semantics agree.
The rest of this paper is organized as follows.Section 2 presents preliminary definitions, including the syntax of the language of logic programming with c-atoms, the basic notion of satisfaction, and the notion of answer set for programs with monotone c-atoms in Marek and Truszczyński (2004) and for positive programs with arbitrary c-atoms in Marek and Remmel (2004).Section 3 presents our first approach to defining answer sets for logic programs with arbitrary c-atoms based on a fixpoint operator, while Section 4 introduces an alternative definition based on well-supportedness.Section 5 extends the semantics to programs with arbitrary c-atoms in the head of rules.Section 6 relates the semantics presented in this paper with early work on abstract constraint atoms and aggregates.Section 7 provides conclusions and future work.Proofs of theorems and propositions are deferred to the appendix.

Preliminaries-Logic Programs with Abstract Constraint Atoms
We follow the syntax used in Liu and Truszczyński (2005b) to define programs with abstract constraint atoms.Throughout the paper, we assume a fixed propositional language L with a countable set A of propositional atoms.A c-atom of the form ({p}, {{p}}) is called an elementary c-atom and will be simply written as p.A c-atom of the form (A, ∅), representing a constraint which does not admit any solutions, will be denoted by ⊥.A c-atom A is said to be monotone if for every
For a program P , hset(P ) denotes the set ∪ r∈P head(r) d .We recognize special types of rules: A logic program with c-atoms (or logic program, for simplicity)3 is a set of rules.A program P is called a basic program if each rule r ∈ P is a basic or a constraint rule.P is said to be positive if every rule in P is positive.P is monotone (resp.naf-monotone) if each c-atom occurring in P (resp. in a naf-atom in P ) is monotone.Clearly, a monotone program is also naf-monotone.

Models and Satisfaction
In this subsection, we introduce the basic definitions for the study of logic programs with constraints.We will begin with the definition of the satisfaction of c-atoms.We then introduce the notion of a model of programs with c-atoms.

Satisfaction of C-Atoms
A set of atoms S ⊆ A satisfies a c-atom A, denoted by It has been shown in Marek and Remmel (2004) and in Marek and Truszczyński (2004) that the notion of c-atom is more general than extended atoms such as cardinality constraint atoms and aggregate atoms; thus, c-atoms can be used to conveniently represent weight constraints, cardinality constraints (Simons et al., 2002), and various other classes of aggregates, such as maximal cardinality constraints.For example, • Let us consider an arbitrary choice atom of the form L{p 1 , . . ., p k , notq 1 , . . ., notq h }U ; this can be represented by the c-atom (A, S) where: • Let us consider an arbitrary aggregate of the form F {v | p(v)} ⊕ V where F is a set function (e.g., Sum, Avg), V is a number, and ⊕ is a comparison operation (e.g., ≥, >, =).This can be represented by the c-atom (A, S), where: Example 1 Let us consider the aggregate sum({X | p(X)})≥ − 1, defined in a language where A = {p(1), p(−2)}.From the considerations above, we have that this aggregate can be represented by the c-atom ({p 1 ), p(−2)}, S) where Example 2 Let us consider the cardinality constraint atom 1 {p(1), p(−1)} 1.This can be represented by the c-atom ({p(1), p(−1)}, S) where C-atoms allow us to compactly represent properties that would require complex propositional combinations of traditional aggregates.E.g., a condition like "either all elements or no elements of the set {a, b, c, d} are true" can be simply written as the single c-atom ({a, b, c, d}, {∅, {a, b, c, d}}).Further motivations behind the use of c-atoms can be found in Marek and Remmel (2004) and Marek and Truszczyński (2004).
In the rest of the paper, we will often use in our examples the notation of cardinality constraint atoms, weight constraint atoms, or general aggregate atoms instead of c-atoms, whenever no confusion is possible.

Models
A set of atoms S satisfies the body of a rule r of the form (1), denoted by S |= body(r), if S |= A i for i = 1, . . ., k and S |= not A j for j = k + 1, . . ., n. S satisfies a rule r if it satisfies head(r) or if it does not satisfy body(r).
A set of atoms S is a model of a program P if S satisfies every rule of P .M is a minimal model of P if it is a model of P and there is no proper subset of M which is also a model of P .In particular, programs may have more than one minimal model (see, for example, Example 5).
Given a program P , a set of atoms S is said to support an atom a ∈ A if there exists some rule r in P and X ∈ head(r) c such that the following conditions are met: • X ⊆ S, and The aggregate notation Count({X|p(X)}) > 2 represents the c-atom (D, {D}) where D = {p(a), p(b), p(c)}.P 1 has two models: Example 4 Let P 2 be the program The aggregate notation Sum({X|p(X)})≥1 represents the c-atom (D, C) where Because of the first rule, any model of P 2 will need to contain {p(1)}.It is easy to see that {p(1), p(−1)} and {p(1), p(2), p(−1)} are models of P 2 but {p(1), p(2)} is not a model of P 2 . 2 Example 5 Let P 3 be the program p ← ({q}, {∅}) q ← ({p}, {∅}) P 3 has three models {p}, {q}, and {p, q}, of which {p} and {q} are minimal.2

Previously Proposed Semantics
In this section, we will overview the semantical characterizations for programs with c-atoms proposed in the existing literature.In particular, we will review the notion of answer sets for monotone programs (i.e., program that contain only monotone c-atoms), as defined in Marek and Truszczyński (2004).A formal comparison between these semantics and the novel approach we propose in this paper is described in Section 6.Given a set of atoms S, a rule r is applicable in S if S |= body(r).The set of applicable rules in S is denoted by P (S).A set S is nondeterministically one-step provable from S by means of P if S ⊆ hset(P (S)) and S |= head(r) for every r ∈ P (S).The nondeterministic one-step provability operator T nd P is a function from 2 A to 2 2 A such that for every S ⊆ A, T nd P (S) consists of all sets S that are nondeterministically one-step provable from S by means of P .
A P -computation is a sequence t = (X n ) n=0,1,2,... where X 0 = ∅ and for every nonnegative integer n, A set of atoms S is a derivable model of P if there exists a P -computation t such that S = S t .The Gelfond-Lifschitz reduct for normal logic programs is generalized to monotone programs as follows.
Definition 1 Let P be a monotone program.For a set of atoms M , the reduct of P with respect to M , denoted by P M , is obtained from P by 1. removing from P every rule containing in the body a literal not A such that M |= A; and 2. removing all literals of the form not A from the remaining rules.
Answer sets for monotone programs are defined next.
Definition 2 A set of atoms M is an answer set of a monotone program P if M is a derivable model of the reduct P M .
The next example shows that, for programs with non-monotone c-atoms, Definition 2 is, in general, not applicable.
Example 6 Consider the program P 3 from Example 5. We can check that this program does not allow the construction of any P 3 -computation.In fact, T nd P 3 (∅) = {{p, q}} and T nd P 3 ({p, q}) = {∅}.Hence, {p} would not be an answer set of P 3 (according to Definition 2) since it is not a derivable model of the reduct of P 3 with respect to {p} (which is P 3 ).
On the other hand, it is easy to see that P 3 is intuitively equivalent to the normal logic program {p ← not q, q ← not p}.As such, P 3 should accept {p} as one of its answer sets. 2 The main reason for the inapplicability of Definition 2 lies in that the nondeterministic onestep provability operator T nd P might become non-monotone in the presence of non-monotone c-atoms.

Answer Sets for Positive Programs
Positive programs are characterized by the lack of negation-as-failure atoms.Positive programs with arbitrary c-atoms have been investigated in Marek and Remmel (2004), under the name of SC-programs.Let us briefly review the notion of answer sets for SC-programswhich, in turn, is a generalization of the notion of answer sets for logic programs with weight constraints, as presented in Niemelä et al. (1999).A detailed comparison between the approach in Marek and Remmel (2004) and our work is given in Section 6.
For a c-atom A, the closure of A, denoted by A, is the c-atom Intuitively, the closure is constructed by including all the supersets of the existing solutions.A c-atom A is said to be closed if A = A. A rule of the form ( 1) is a Horn-rule if (i) its head is an elementary c-atom; and (ii) each c-atom in the body is a closed c-atom.A SC-program P is said to be a Horn SC-program if each rule in P is a Horn-rule.The one-step provability operator, defined by T P (X) = {a | ∃r ∈ P, head(r) = a, X |= body(r)}, associated to a Horn SC-program P is monotone.Hence, every Horn SC-program P has a least fixpoint M P which is the only minimal model of P (w.r.t.set inclusion).Given a set of atoms M and a SC-program P , the NSS-reduct of P with respect to M , denoted by NSS(P, M ), is obtained from P by (i) removing all rules whose body is not satisfied by M ; and (ii) replacing each rule A ← e 1 , .It is easy to see that M 1 = M NSS(P,M 1 ) and M 2 = M NSS(P,M 2 ) .Thus, observe that P 4 has a non-minimal answer set {a, c} according to Marek and Remmel (2004).Note that the program P 4 can be viewed as the following program with aggregates which does not have {a, c} as an answer set under most of the proposed semantics for aggregates (Denecker et al., 2001;Faber et al., 2004;Ferraris, 2005;Pelov, 2004;Son & Pontelli, 2007).Furthermore, all these approaches accept {c} as the only answer set of this program.2

Answer Sets for Basic Programs: A Fixpoint Based Approach
In this section, we define the notion of answer sets of basic programs.In this approach, we follow the traditional way for defining answer sets of logic programs, i.e., by: 1. first characterizing the semantics of positive programs (Definition 4), and then 2. extending it to deal with naf-atoms (Definitions 7 and 8).

Answer Sets for Basic Positive Programs
Example 5 shows that a basic positive program might have more than one minimal model.This leads us to define a T P -like operator for answer set checking, whose construction is based on the following observation.
Observation 1 Let P be a propositional normal logic program (i.e., without c-atoms) 5 and let R, S be two sets of atoms.Given a set of atoms M , we define the operator T P (R, S) and the monotone sequence of interpretations I M i ω i=0 as follows.
Let us denote with I M ω the limit of this sequence of interpretations.It is possible to prove that M is an answer set of P w.r.t.Gelfond and Lifschitz (1988) As we can see from the above observation, the (modified) consequence operator T P takes two sets of atoms, R and S, as its arguments, and generates one set of atoms which could be viewed as the consequences of P given that R is true and S is assumed to be an answer set of P .It is easy to see that T P is monotone w.r.t.its first argument, i.e., if R ⊆ V , then T P (R, S) ⊆ T P (V, S).Thus, the sequence I M j ω j=0 is monotone and converges to I M ω for a given S. We will next show how T P can be generalized to programs with c-atoms.
Observe that the definition of T P requires that pos(r) ⊆ R or, equivalently, R |= pos(r).For normal logic programs, this is sufficient to guarantee the monotonicity of T P (•, S).If this definition is naively generalized to the case of programs with c-atoms, the monotonicity of T P (., S) is guaranteed only under certain circumstances, e.g., when c-atoms in pos(r) are monotone.To deal with arbitrary c-atoms, we need to introduce the notion of conditional satisfaction of a c-atom.

for every
Observe that this notion of conditional satisfaction has been inspired by the conditional satisfaction used to characterize aggregates in Son and Pontelli (2007), but it is significantly simpler.
We say that S conditionally satisfies a set of c-atoms V w.r.t.M , denoted by Thus, conditional satisfaction ensures that if the body of a rule is satisfied in S then it is also satisfied in S , provided that S ⊆ S ⊆ M .This allows us to generalize the operator T P defined in Observation 1 as follows.For a set of atoms S and a positive basic program P , let The following proposition holds.
Proposition 1 Let M be a model of P , and let S ⊆ U ⊆ M .Then T P (S, M ) ⊆ T P (U, M ) ⊆ M.
Let T 0 P (∅, M) = ∅ and, for i ≥ 0, let Then, the following corollary is a natural consequence of Proposition 1.
Corollary 1 Let P be a positive, basic program and M be a model of P .Then, we have The above corollary implies that the sequence T i P (∅, M) ∞ i=0 is monotone and limited (w.r.t.set inclusion) by M .Therefore, it converges to a fixpoint.We denote this fixpoint by Definition 4 Let M be a model of a basic positive program P .M is an answer set of Observe that the constraint rules present in P (i.e., rules whose head is ⊥) do not contribute to the construction performed by T P ; nevertheless, the requirement that M should be a model of P implies that all the constraint rules will have to be satisfied by each answer set.We illustrate Definition 4 in the next examples.
Example 8 Consider the program P 1 from Example 3.
} is an answer set of P 1 since: is not an answer set of P 1 , since: Example 9 Consider again the program P 3 (Example 5).Let M 1 = {p} and M 2 = {q}.
We have that Thus, both {p} and {q} are answer sets of P 3 .On the other hand, for M = {p, q}, we have that T 1 P 3 (∅, {p, q}) = ∅ because ∅ |= M ({q}, {∅}) and ∅ |= M ({p}, {∅}).Hence, {p, q} is not an answer set of P 3 .2 We conclude this section by observing that the answer sets obtained from the above construction are minimal models.
Corollary 2 Let P be a positive basic program and M be an answer set of P .Then, M is a minimal model of P .
The next example shows that not every positive program has an answer set.
Example 10 Consider P 2 (Example 4).Since answer sets of positive programs are minimal models (Corollary 2) and M = {p(1), p(−1)} is the only minimal model of P 2 , we have that M is the only possible answer set of P 2 .Since 1)} we can conclude that M is not an answer set of P 2 .Thus, P 2 does not have answer sets. 2 The example highlights that supportedness, in our approach, is not a sufficient condition for being an answer set-M = {p(1), p(−1), p(2)} is a supported model, but it is not accepted as an answer set.The reason for rejecting M is the fact that the element p( 2) is essentially self-supporting itself (cyclically) in M .Note that M is rejected, as an answer set, in most approaches to aggregates in logic programming-e.g., the approach in Faber et al. (2004) rejects M for not being a minimal model of the FLP-reduct of the program.

Answer Sets for Basic Programs
We will now define answer sets for basic programs, i.e., programs with elementary c-atoms in the head of the rules, and rule bodies composed of c-atoms and naf-atoms.
In the literature, two main approaches have been considered to deal with negation of aggregates and of other complex atoms.Various extensions of logic programming (e.g., weight constraints in Simons et al. (2002) and aggregates in Faber et al. ( 2004)) support negationas-failure atoms by replacing each naf-atom not A with a c-atom A , where A is obtained from A by replacing the predicate relation of A with its "negation".For example, following this approach, the negated cardinality constraint atom not 1 {a, b} 1 can be replaced by ({a, b}, {∅, {a, b}}).Similarly, the negated aggregate atom not Sum({X | p(X)}) = 5 can be replaced by Sum({X | p(X)}) = 5.
On the other hand, other researchers (see, e.g., Marek & Truszczyński, 2004;Ferraris, 2005) have suggested to handle naf-atoms by using a form of program reduct-in the same spirit as in Gelfond and Lifschitz (1988).
Following these perspectives, we study two different approaches for dealing with nafatoms, described in the next two subsections.It is worth mentioning that both approaches coincide in the case of monotone programs (Proposition 2).

Negation-as-Failure by Complement
In this approach, we treat a naf-atom not A by replacing it with its complement.We define the notion of complement of a c-atom as follows.

Definition 5 The complement Ā of a c-atom
We next define the complement of a program P .
Definition 6 Given a basic program P , we define C(P ) (the complement of P ) to be the program obtained from P by replacing each occurrence of not A in P with the complement of A.
The program C(P ) is a basic positive program, whose answer sets have been defined in Definition 4. This allows us to define the notion of answer sets of basic programs as follows.
Definition 7 A set of atoms M is an answer set by complement of a basic program P iff it is an answer set of C(P ).
It is easy to see that each answer set of a program P is indeed a minimal model of P .
Example 11 Let us consider the program P 5 , which consists of the following rules: Another approach for dealing with naf-atoms is to adapt the Gelfond-Lifschitz reduction of normal logic programs (Gelfond & Lifschitz, 1988) to programs with c-atoms-this approach has been considered in Marek and Truszczyński (2004) and Ferraris (2005).We can generalize this approach to programs with arbitrary c-atoms as follows.For a basic program P and a set of atoms M , the reduct of P w.r.This result indicates that, for certain programs with c-atoms, there might be different ways to treat naf-atoms, leading to different semantical characterizations.This problem has been mentioned in Ferraris (2005).Investigating other methodologies for dealing with naf-atoms is an interesting topic of research, that we plan to pursue in the future.

Properties of Answer Sets of Basic Programs
We will now show that the notion of answer sets for basic programs with c-atoms is a natural generalization of the notions of answer sets for normal logic programs.We prove that answer sets of basic positive programs are minimal and supported models and characterize situations in which these properties hold for basic programs.We begin with a result stating that, for the class of naf-monotone programs, the two approaches for dealing with naf-atoms coincide.
Proposition 2 Let P be a basic program.Each answer set by complement of P is an answer set by reduct of P .Furthermore, if P is naf-monotone, then each answer set by reduct of P is also an answer set by complement of P .
The above proposition implies that, in general, the negation-as-failure by complement approach is more 'skeptical' than the negation-as-failure by reduct approach, in that it may accept fewer answer sets.6Furthermore, Examples 12 and 14 show that a minimal (w.r.t.set inclusion) answer set by reduct is not necessarily an answer set by complement of a program.
Let P be a normal logic program (without c-atoms) and let c-atom(P ) be the program obtained by replacing each occurrence of an atom a in P with ({a}, {{a}}).Since ({a}, {{a}}) is a monotone c-atom, c-atom(P ) is a monotone program.Proposition 2 implies that, for c-atom(P ), answer sets by reduct and answer sets by complement coincide.In the next proposition, we prove that the notion of answer sets for programs with c-atoms preserves the notion of answer set for normal logic programs, in the following sense.Gelfond and Lifschitz (1988)).

Proposition 3 (Preserving Answer Sets) For a normal logic program P , M is an answer set (by complement or by reduct) of c-atom(P ) iff M is an answer set of P (w.r.t. the definition in
The above proposition, together with Proposition 2, implies that normal logic programs can be represented by positive basic programs.This is stated in the following corollary. Corollary 3 Every answer set of a normal logic program P is an answer set of C(c-atom(P )) and vice versa.
In the next proposition, we study the minimality and supportedness properties of answer sets of basic programs.

Proposition 4 (Minimality of Answer Sets)
The following properties hold: 1. Every answer set by complement of a basic program P is a minimal model of P .
2. Every answer set by reduct of a basic, naf-monotone program P is a minimal model of P .
3. Every answer set (by complement/reduct) of a basic program P supports each of its members.

Answer Sets for Basic Programs: A Level Mapping Based Approach
The definition of answer sets provided in the previous section can be viewed as a generalization of the answer set semantics for normal logic programs-in the sense that it relies on a fixpoint operator, defined for positive programs.In this section, we discuss another approach for defining answer sets for programs with c-atoms, which is based on the notion of well-supported models.
The notion of well-supported models for normal logic programs was introduced in Fages (1994), and it provides an interesting alternative characterization of answer sets.Intuitively, a model M of a program P is a well-supported model iff there exists a level mapping, from atoms in M to the set of positive integers, such that each atom a ∈ M is supported by a rule r, whose body is satisfied by M and the level of each positive atom in body(r) is strictly smaller than the level of a. 7 Fages proved that answer sets are well-supported models and vice versa (Fages, 1994).The notion of well-supportedness has been extended to deal with dynamic logic programs in Banti, Alferes, Brogi, and Hitzler (2005).Level mapping has also been used as an effective tool to analyze different semantics of logic programs in a uniform way (Hitzler & Wendt, 2005).
In what follows, we will show that the notion of well-supported models can be effectively applied to programs with c-atoms.A key to the formulation of this notion is the answer to the following question: "what is the level of a c-atom A given a set of atoms M and a level mapping L of M ?"On one hand, one might argue that the level mapping of A should be defined independently from the mapping of the other atoms, being A an atom itself.On the other hand, it is reasonable to assume that the level of A depends on the levels of the atoms in A d , since the satisfaction of A (w.r.t. a given interpretation) depends on the satisfaction of the elements in A d .The fact that every existing semantics of programs with c-atoms evaluates the truth value of a c-atom A based on the truth value assigned to elements of A d stipulates us to adopt the second view.
It is worth to mention that this view also allows us to avoid undesirable circular justifications of elements of a well-supported model: if we follow the first view, the program P 7 consisting of the following rules would have {a, b} as a well-supported model in which a, b, and ({a, b}, {∅, {a, b}}) are supported by ({a, b}, {∅, {a, b}}), a, and {a, b} respectively.This means that a is true because both a and b are true, i.e., there is a circular justification for a w.r.t. the model {a, b}.
Let M be a set of atoms, be a mapping from M to positive integers, and let A be a c-atom.We define H(X) = max({ (a) | a ∈ X}), and Intuitively, the "level" of each atom is given by the smallest of the levels of the solutions of the atom compatible with M -where the level of a solution is given by the maximum level of atoms in the solution.We assume that max(∅) = 0, while min(∅) is undefined.We will now introduce two different notions of well-supported models.The first notion, called weakly well-supported models, is a straightforward generalization of the definition given in Fages (1994)-in that it ignores the naf-atoms.The second notion,, called strongly well-supported models, does take into consideration the naf-atoms in its definition.
Definition 9 (Weakly Well-Supported Model) Let P be a basic program.A model M of P is said to be weakly well-supported iff there exists a level mapping such that, for each b ∈ M , P contains a rule r with head(r) = ({b}, {{b}}), M |= body(r), and for each A ∈ pos(r), L(A, M ) is defined and l(b) > L(A, M ).
We illustrate this definition in the next example.
Example 15 Let us consider again the program P 5 and the set of atoms M = {a, b}.Let A = ({a, b}, {∅, {a, b}}).Obviously, M is a model of P 5 .Assume that M is a weakly wellsupported model of P 5 .This means that there exists a mapping from M to the set of positive integers satisfying the condition of Definition 9. Since b ∈ M and there is only one rule in P 5 with b as head, we can conclude that (b) > (a).Observe that ∅ |= M A and {a, b} |= M A. Thus, by the definition of L(A, M ), we have that This implies that there exists no rule in P 5 , which satisfies the condition of Definition 9 and has a as its head.In other words, M is not a weakly well-supported model of P 5 . 2 The next proposition generalizes Fages' result to answer sets by reduct for programs with c-atoms.
Proposition 5 A set of atoms M is an answer set by reduct of a basic program P iff it is a weakly well-supported model of P .
As we have seen in the previous section, different ways to deal with naf-atoms lead to different semantics for basic programs with c-atoms.To take into consideration the fact that naf-atoms can be dealt with by complement, we develop an alternative generalization of Fages's definition of a well-supported model to programs with abstract c-atoms as follows.
Definition 10 (Strongly Well-Supported Model) Let P be a basic program.A model M of P is said to be strongly well-supported iff there exists a level mapping such that, for each b ∈ M , P contains a rule r with head( r The above two propositions, together with Proposition 2, lead to the following corollary.
Corollary 4 For every naf-monotone basic program P , each weakly well-supported model of P is also a strongly well-supported model of P and vice versa.
As we have discussed in the previous section, each normal logic program P can be easily translated into a monotone basic program with c-atoms of the form ({a}, {{a}}), c-atom(P ).Thus, Corollary 4 indicates that the notion of weakly/strongly well-supported model is indeed a generalization of Fages's definition of well-supported model to programs with catoms.

Answer Sets for General Programs
General programs are programs with non-elementary c-atoms in the head.The usefulness of rules with non-elementary c-atoms in the head, in the form of a weight constraint or an aggregate, has been discussed in Ferraris (2005), Simons et al. (2002) and in Son, Pontelli, and Elkabani (2006).For example, a simple atom 8 Count({X | taken(X, ai)}) ≤ 10 can be used to represent the constraint that no more than 10 students can take the AI class.
The next example shows how the 3-coloring problem of a graph G can be represented using c-atoms.
8. Recall that aggregates are special form of c-atoms.
Example 16 Let the three colors be red (r), blue (b), and green (g).The program contains the following rules: • the set of atoms edge(u, v) for every edge (u, v) of G, • for each vertex u of G, the following rule: ({color(u, b), color(u, r), color(u, g)}, {{color(u, b)}, {color(u, r)}, {color(u, g)}}) ← which states that u must be assigned one and only one of the colors red, blue, or green.
• for each edge (u, v) of G, three rules representing the constraint that u and v must have different color: We note that, with the exception of the proposals in Ferraris (2005), Son, Pontelli, and Elkabani (2006), other approaches to defining answer sets of logic programs with aggregates do not deal with programs with aggregates in the head.On the other hand, weight constraint and choice atoms are allowed in the head (Simons et al., 2002).Similarly, c-atoms are considered as head of rules in the framework of logic programs with c-atoms by Marek and Remmel (2004) and by Marek and Truszczyński (2004).
In this section, we define answer sets for general programs-i.e., programs where the rule heads can be arbitrary c-atoms.Our approach is to convert a program P with c-atoms in the head into a collection of basic programs, whose answer sets are defined as answer sets of P .To simplify the presentation, we will talk about "an answer set of a basic program" to refer to either an answer set by complement, an answer set by reduct, or a well-supported model of the program.The distinction will be stated clearly whenever it is needed.
Let P be a program, r ∈ P , and let M be a model of P .The instance of r w.r.t.M , denoted by inst(r, M ) is defined as follows The instance of P w.r.The next example shows that in the presence of non-elementary c-atoms in the head, answer sets might not be minimal.
Example 18 Let P 9 be the program consisting of the following rules: Intuitively, the first rule of P 9 is the cardinality constraint 1 {a, b} 2 in the notation of Smodels.This program has four models: whose only answer set is M 1 .Thus, M 1 is an answer set of P 9 .
If we consider M 3 , the corresponding instance inst(P 9 , M 3 ) contains the rules whose only answer set is M 3 .This shows that M 3 is another answer set of P 9 .Similarly, one can show that M 2 is also an answer set of P 9 .
The instance inst(P 9 , M 4 ) is the program which has {a} as its only answer set.Hence, M 4 is not an answer set of P 9 .Thus, P 9 has three answer sets, M 1 , M 2 , and M 3 .In particular, observe that M 1 ⊂ M 3 .2 Observe that if P is a basic program then P is its unique instance.As such, the notion of answer sets for general programs is a generalization of the notion of answer sets for basic programs.It can be shown that Proposition 2 also holds for general programs.The relationship between the notion of answer set for general programs and the definition given in Marek and Remmel (2004) and other extensions to logic programming is discussed in the next section.

Related Work and Discussion
In this section, we relate our work to some recently proposed extensions of logic programming, and discuss a possible method for computing answer sets of programs with c-atoms using available answer set solvers.

Related Work
The concept of logic programs with c-atoms, as used in this paper, has been originally introduced in Marek and Remmel (2004) and in Marek and Truszczyński (2004)-in particular, programs with c-atoms have been named SC-programs in Marek and Remmel (2004). 9The Example 7 shows that our semantical characterization differs from the approach adopted in Marek and Remmel (2004).In particular, our approach guarantees that answer sets for basic programs are minimal, while that is not the case for the approach described in Marek and Remmel (2004).Consider another example: c, d}, {{a}, {a, c, d}}) According to our characterization, this program has only one answer set, M 1 = {a, c}.If we consider the approach described in Marek and Remmel (2004), then we can verify that M 2 = {a, c, d} is an answer set since the NSS-reduct of P 10 with respect to M 2 is ({a, c, d}, {{a}, {a, c}, {a, d}, {a, c, d}}) and the least fixpoint of the one-step provability operator is {a, c, d}. 2 In this type of examples, it seems hard to justify the presence of d in the answer set of the original program.We suspect that the replacement of a c-atom by its closure, used in the NSS-reduct, might be the reason for the acceptance of unintuitive answer sets in Marek and Remmel (2004).The following proposition states that our approach is more skeptical than the approach of Marek and Remmel (2004).
Proposition 7 Let P be a positive program.If a set of atoms M is an answer set of P w.r.t.Definition 11 then it is an answer set of P w.r.t.Marek and Remmel (2004).
The syntax of logic programs with c-atoms, as used in this paper, is also used in Liu and Truszczyński (2005b) and in Liu and Truszczyński (2005a).One of the main differences between our work and the work of Marek and Truszczyński (2004) is that we consider arbitrary c-atoms, while the proposal of Marek and Truszczyński (2004) focuses on monotone 9.Although naf-atoms are not allowed in the definition of SC-programs, the authors suggest that naf-atoms can be replaced by their complement.
(and convex) c-atoms.The framework introduced in this paper can be easily extended to disjunctive logic programs considered in Pelov and Truszczyński (2004).The immediate consequence operator T P proposed in this paper is different from the nondeterministic one-step provability operator, T nd P , adopted in Marek and Truszczyński (2004), in that T P is deterministic and it is applied only to basic positive programs.In Marek and Truszczyński (2004) and in Liu and Truszczyński (2005b), the researchers investigate how several properties of normal logic programs (e.g., strong equivalence) hold in the semantics of programs with monotone c-atoms of Marek and Truszczyński (2004).We have not directly studied such properties in the context of our semantical characterization; nevertheless, as we will see later, Proposition 8 implies that the results proved in Liu and Truszczyński (2005b) are immediately applicable to our semantic characterization for the class of monotone programs.We do, however, focus on the use of well-supported models and level mapping in studying answer sets for programs with c-atoms, an approach that has not been used before for programs with c-atoms.
We will next present a result that shows that our approach to define answer sets for monotone programs coincides with that of Marek and Truszczyński (2004).
Proposition 8 Let P be a monotone program.A set of atoms M is an answer set of P w.r.t.Definition 11 iff M is a stable model of P w.r.t.Marek and Truszczyński (2004).
As discussed earlier, c-atoms can be used to represent several extensions of logic programs, among them weight constraints and aggregates.Intuitively, an aggregate atom α (see, e.g., Elkabani et al., 2004;Faber et al., 2004) can be encoded as a c-atom (D, C), where D consists of all atoms occurring in the set expression of α and C ⊆ 2 D is such that every X ∈ C satisfies α (see Examples 3-4).As indicated in Marek and Truszczyński (2004), many of the previous proposals dealing with aggregates do not allow aggregates to occur in the head of rules.Here, instead, we consider programs with c-atoms in the head.
With regards to naf-atoms, some proposals (see, e.g., Elkabani et al., 2004) do not allow aggregates to occur in naf-atoms.The proposal in Faber et al. (2004) treats naf-atoms by complement, although a reduction is used in defining the semantics, while Ferraris (2005) argues that, under different logics, naf-atoms might require different treatments.
We will now present some propositions which relate our work to the recent works on aggregates.We can prove 10 : Proposition 9 For a program with monotone aggregates P , M is an answer set of P iff it is an answer set of P w.r.t.Faber et al. (2004) and Ferraris (2005).
The proposal presented in Pelov (2004) and in Denecker et al. (2001) deals with aggregates by using approximation theory and three-valued logic, building the semantics on the threevalued immediate consequence operator Φ aggr P , which maps three-valued interpretations into three-valued interpretations of the program.This operator can be viewed as an operator which maps pairs of set of atoms (R, S) where R ⊆ S into pairs of set of atoms (R , S ) with R ⊆ S .The authors show that the ultimate approximate aggregates provide the most precise semantics for logic programs with aggregates.Let us denote with Φ 1 (R, S) and Φ 2 (R, S)) the two components of Φ aggr P (R, S), i.e., Φ aggr P (R, M ) = (Φ 1 (R, M ), Φ 2 (R, M )).The next proposition relates T P to Φ aggr P .
10. Abusing the notation, we use a single symbol to denote a program in different notations.
Proposition 10 Let P be a positive program with aggregates and R and M be two set of atoms such that R ⊆ M .Then, T P (R, M ) = Φ 1 (R, M ).
The above proposition, together with the fact that the evaluation of the truth value of aggregate formulas in Denecker et al. (2001) treats naf-atoms by complement, allows us to conclude that, for a program with aggregates P , answer sets by complement of P (w.r.t.Definition 4) are ultimate stable models of P (Denecker et al., 2001) and vice versa.This result, together with the results in Son and Pontelli (2007), allows us to conclude that T P is a generalization of the immediate consequence operator for aggregates programs in Son and Pontelli (2007).
Before we conclude the discussion on related work, we would like to point out that Propositions 7-10 show that the different approaches to dealing with aggregates differ only for non-monotone programs.The main difference between our approach and others lies in the skepticism of the T P operator, caused by the notion of conditional satisfaction.We will illustrate this issue in the next two examples.
Example 20 Consider the program P 2 of Example 4. This program does not have an answer set w.r.t.Definition 4 but has M = {p(1), p(−1), p(2)} as an answer set according to Marek and Remmel (2004).The reason for the unacceptability of M as an answer set in our approach lies in that the truth value of the aggregate atom Sum({X | p(X)}) could be either true or false even when p( 1) is known to be true.This prevents the third rule to be applicable and hence the second rule as well.This makes p(1) the fixpoint of the T P 2 operator, given that M is considered as an answer set.In other words, we cannot regenerate M given the program-and the skepticism of T P 2 is the main reason.We observe that other approaches (see, e.g., Faber et al., 2004;Ferraris, 2005) do not accept M as an answer set of P 2 as well. 2 The following example shows the difference between our approach and those in Faber et al. (2004) as well as in Ferraris (2005).

Discussion
In this section, we briefly discuss a possible method for computing answer sets of programs with c-atoms, using off-the-shelf answer set solvers.The method makes use of a transformation similar to the unfolding transformation proposed in Elkabani et al. (2004) for dealing with aggregates, which has been further studied and implemented in Elkabani et al. (2005).We begin our discussion with basic positive programs.Given a basic positive program P and a c-atom A, if A c = ∅, an unfolding of A is an expression of the form p 1 , . . ., p n , not q 1 , . . ., not q m where {p 1 , . . ., p n } ∈ A c and {q 1 , . . ., q m } = A d \ {p 1 , . . ., p n }.If A c = ∅, then ⊥, denoting false, is the unique unfolding of A. Observe that if A = ({a}, {{a}}) then the only unfolding of A is a.An unfolding of a rule is a rule obtained by replacing each A i with one of its unfoldings.unf olding(r) denotes the set of all the unfoldings of a rule r.Let unf olding(P ) = r∈P unf olding(r).Clearly, unf olding(P ) is a normal logic program if P is a basic positive program.We can show that M is an answer set of P iff M is an answer set of unf olding(P ).This indicates that we can compute answer sets of basic positive programs with c-atoms by (i) computing its unfolding; and (ii) using available answer set solvers to compute the answer sets of the unfolded program.Following this approach, the main additional cost for computing answer sets of a basic positive program is the cost incurred during the unfolding process.Theoretically, this can be very costly as for each rule r, we have that |unf olding(r)| = Π A∈body(r) |A c |, where |.| denotes the cardinality of a set.This means that the size of the program unf olding(P ) might be exponential in the size of the original program P .Thus, the additional cost might be significant.In practice, we can expect that this number is more manageable, as a rule might contain only a few c-atoms whose set of solutions is reasonably small.Furthermore, certain techniques can be employed to reduce the size of the unfolding program (Son, Pontelli, & Elkabani, 2006).
The above method can be easily extended to deal with naf-atoms and general programs.If answer sets by complement need to be computed, we need to (i) compute the complement of the program; and (ii) use the above procedure to compute answer sets of the complement.On the other hand, if answer sets by reduct need to be computed, we will have at hand a tentative answer set M .The reduction of the program with respect to M can be computed, and the unfolding can then be applied to verify whether M is an answer set of the reduct.Observe that the complement or a reduct of a program can be easily computed, and it does not increase the size of the program.As such, the main cost for computing answer sets of general programs following this approach is still the cost of the unfolding.So far, in our study on programs with aggregates (a special type of c-atoms), we did not encounter unmanageable situations (Son, Pontelli, & Elkabani, 2006).
Observe that the specification of a c-atom requires the enumeration of its domain and solutions, whose size can be exponential in the size of the set of atoms of the program.This does not mean that an explicit representation of c-atoms needs to be used.In most cases, c-atoms can be replaced by aggregate literals.Because of this, several complexity results for programs with aggregates (see, e.g., Pelov, 2004;Son & Pontelli, 2007) can be extended to logic programs with c-atoms.For example, we can easily show that the problem of determining whether a logic program has an answer set or not is at least NP co-NP .However, for programs with c-atoms representable by standard aggregate functions, except those of the form Sum(.) = value and Avg(.) = value, the problem of determining whether or not a program has an answer set remains NP-complete.

Conclusions and Future Work
In this paper, we explored a general logic programming framework based on the use of arbitrary constraint atoms.The proposed approach provides a characterization which is more in line with existing semantics of logic programming with aggregates than the characterization proposed in Marek and Remmel (2004).We provided two alternative characterizations of answer set semantics for programs with arbitrary constraint atoms, the first based on a fixpoint operator, which generalizes the immediate consequence operator for traditional logic programs, and the second built on a generalization of the notion of well-supported models of Fages (1994).
Within each characterization of answer set, we investigated two methodologies for treating naf-atoms and we identified the class of naf-monotone programs, on which the two approaches for dealing with naf-atoms coincide.We also proved that the newly proposed semantics coincides with the semantics proposed in Marek and Truszczyński (2004) for monotone programs.Finally, we related our work to other proposals on logic programs with aggregates and discussed a possible method for computing answer sets of programs with abstract constraint atoms using available answer set solvers.
The proposal has some unexplored aspects.The proposed approach is rather "skeptical" in the identification of answer sets-while the approach in Marek and Remmel (2004) is overly "credulous".We believe that these two approaches represent the two extremes of a continuum that needs to be explored.In particular, we believe it is possible to identify "intermediate" approaches simply by modifying the notion of conditional satisfaction.Work is in progress to explore these alternatives.

Proof. S |=
Together with the fact S ⊆ U ⊆ M ⊆ M , we have that  Proof.
1. From Lemma 1, the assumption that S ⊆ U ⊆ M , and the definition of T P , we have that T P (S, M ) ⊆ T P (U, M ).
2. Let us now show that T P (U, M ) ⊆ M .Consider an atom a ∈ T P (U, M ).We need to show that a ∈ M .From the definition of the T P operator, there is a rule r such that head(r) = ({a}, {{a}}) and U |= M pos(r).But observe that, for each A ∈ pos(r), if U |= M A then we will have that M |= A (Definition 3).Thus, we can conclude that M |= pos(r).Since the program is positive and M is known to be a model of P , we must have that M |= head(r), thus a ∈ M .

2
Corollary 2 Let P be a positive basic program and M be an answer set of P .Then, M is a minimal model of P .
Proof.M is a model of P since it is an answer set of P (Definition 4).Thus, we need to prove that M is indeed a minimal model of P .Suppose that there exists M ⊂ M such that M is a model of P .Proposition 1 and Lemma 1 imply that T k (∅, M) ⊆ T k (∅, M ) ⊆ M for every k.Since M is an answer set, we have that M ⊆ M .This contradicts the assumption that M ⊂ M . 2 Proposition 2. Let P be a basic program.Each answer set by complement of P is an answer set by reduct of P .Furthermore, if P is naf-monotone, then each an answer set by reduct of P is also an answer set by complement of P .
Proof.Let us start by showing that answer sets by complement are also answer sets by reduct.Let M be a model and let us denote with P 1 = C(P ) and let P 2 = P M .Using the fact that if S |= M Ā then M |= A we can easily prove by induction that the following result holds: and if P is a naf-monotone program then If M is an answer set by complement then we have M = T ∞ P 1 (∅, M).Furthermore, T ∞ P 2 (∅, M) ⊆ M (Proposition 1).This implies that M is an answer set of P by reduct as well.
If P is naf-monotone, using Equation (3) and the fact that M is an answer set of P 2 we can conclude that M is an answer set by complement of P . 2 Proposition 3.For a normal logic program P , M is an answer set (by complement or by reduct) of c-atom(P ) iff M is an answer set of P (w.r.t.Definition in Gelfond and Lifschitz (1988)).
Proof.For convenience, in this proof, we will refer to answer sets defined in Gelfond and Lifschitz (1988) as GL-answer sets.Because of the monotonicity of c-atom(P ) and Proposition 2, it suffices to show that M is an answer set of P iff M is an answer set by reduct of c-atom(P ).
Let us consider the case where P is a positive program.It follows from Observation 1 and the fact that S |= M ({a}, {{a}}) iff a ∈ S that the operator T P (., .)for P (defined in Observation 1) coincides with the operator T P (., .)for c-atom(P ).Hence, M is an answer set of c-atom(P ) iff M is a GL-answer set of P .Now suppose that P is an arbitrary normal logic program.Let GL(P, M ) be the Gelfond-Lifschitz's reduct of P w.r.t.M .Since M |= ({a}, {{a}}) iff a ∈ M , we have that c-atom(P ) M = c-atom(GL(P, M )).Using the result for positive program, we have that M is a GL-answer set of P iff M is an answer set by reduct of c-atom(P ). 2 Proposition 4.
1. Every answer set by complement of a basic program P is a minimal model of P .
2. Every an answer set by reduct of a basic, naf-monotone program P is a minimal model of P .
3. Every answer set (by complement/reduct) of a basic program P supports each of its members.
Because M is an answer set of Q, by definition, we have To show that M is a stable model of P w.r.t.Marek and Truszczyński (2004), all we need to do is to prove that the sequence M i ∞ i=0 is a P −computation.We do so by proving that (i) M i ⊆ M i+1 and (ii) for every r ∈ P (M i ) 11 , M i+1 |= head(r), and (iii) M i+1 ⊆ hset(P (M i )).From ( 4) and ( 5), we have M i+1 ∩ head(r) d ∈ head(r) c , i.e., M i+1 |= head(r).
(iii) Let a be an atom in M i+1 .From the definition of M i+1 it is easy to see that Q must contain a rule r whose head is a and whose body is satisfied by M i .This implies that P (M i ) must contain a rule r such that a ∈ M ∩ head(r) d .It follows that a ∈ head(r) d ⊆ hset(P (M i )).Accordingly, we have M i+1 ⊆ hset(P (M i )).
2. "⇐": Let M be a stable model of P according to Marek and Truszczyński (2004) and let X i ∞ i=0 be the canonical computation for M , i.e., X 0 = ∅ 11.Recall that P (Mi) is the set of rules in P whose body is satisfied by Mi.
The above result can be easily extended for programs with negation-as-failure c-atoms.We omit the proof here.2 Proof of Proposition 9.
To prove this proposition, a brief review of the approach in Faber et al. ( 2004) is needed.The notion of answer set proposed in Faber et al. (2004) is based on a new notion of reduct, defined as follows.Given a program P and a set of atoms S, the reduct of P with respect to S, denoted by S P , is obtained by removing from P those rules whose body is not satisfied by S. In other words, F LP (P, M ) = {r | r ∈ ground(P ), S |= body(r)}.
The novelty of this reduct is that it does not remove aggregate atoms and negation-as-failure literals satisfied by S. For a program P , S is a FLP-answer set of P iff it is a minimal model of F LP (P, S).We will now continue with the proof of the proposition.It is easy to see that it is enough to consider programs without negation-as-failure c-atoms.
Proposition 9.For a program with monotone aggregates P , M is an answer set of P iff it is an answer set of P w.r.t.Faber et al. (2004) andFerraris (2005).
Proof.Due to the equivalent result in Ferraris (2005), it suffices to prove the equivalence between our approach and that of Faber et al. (2004).Notice that in this paper we are dealing with ground programs and therefore 1. "⇒": Let M be a FLP-answer set of P .We will show that M is an answer set of P (w.r.t.Definition 4).
Let Q = F LP (P, M ).From the definition of FLP-answer set, M is a minimal model of Q.Let M = T ∞ P (∅, M).As M is a model of Q, it is also a model of P .Corollary 1 implies that M ⊆ M .
Consider r ∈ Q such that M |= body(r) and head(r) = ({a}, {{a}}).From the definition of Q and the monotonicity of P , we have M |= body(r).It follows from Lemma 2 that M |= M body(r).Hence, a ∈ M (by the definition of the operator T P ).This implies that M is a model of Q.
Because of the minimality of M and M ⊆ M , we have M = M .Hence, M is an answer set of P .

An
abstract constraint atom (or c-atom) is an expression of the form (D, C), where D ⊆ A is a set of atoms (the domain of the c-atom), and C is a collection of sets of atoms belonging to D, i.e., C ⊆ 2 D (the solutions of the c-atom).Intuitively, a c-atom (D, C) is a constraint on the set of atoms D, and C represents its admissible solutions.Given a c-atom A = (D, C), we use A d and A c to denote D and C, respectively.
) = ({b}, {{b}}), M |= body(r), for each A ∈ pos(r), L(A, M ) is defined and (b) > L(A, M ), and for each A ∈ neg(r), L( Ā, M ) is defined and (b) > L( Ā, M ), Using Proposition 5 and Proposition 2, we can easily show that the following result holds.Proposition 6 A set of atoms M is an answer set by complement of a basic program P iff it is a strongly well-supported model of C(P ).

Proposition 1 .
e., S ∈ A c .Since A is monotone and S ⊆ M , we have that M |= A. This is a contradiction, since we initially assumed that M |= Ā.2 Let M be a model of P , and let S ⊆ U ⊆ M .Then T P (S, M ) ⊆ T P (U, M ) ⊆ M.
(i) Follows from Corollary 1.(ii) Consider a rule r ∈ P (M i ).By the definition of P (M i ), we have that M i |= body(r).Because P is monotone and M i ⊆ M , it follows that M |= body(r) andM i |= M body(r).Let X = M ∩ head(r) d .By the definition of inst(r, M ), we have thatinst(r, M ) = {b ← body(r) | b ∈ X} ⊆ Q As M i |= M body(r), for every r ∈ inst(r, M ), M i |= M body(r ).By the definition of M i+1 , it follows that head(r ) ∈ M i+1 .Hence, X ⊆ M i+1 .Since X ⊆ head(r) d , this implies that X ⊆ M i+1 ∩ head(r) dOn the other hand, because M i+1 ⊆ M , we haveM i+1 ∩ head(r) d ⊆ XAccordingly, we haveM ∩ head(r) d = X = M i+1 ∩ head(r) d (4)On the other hand, because M is a model of P and M |= body(r), we have M |= head(r).Therefore, M ∩ head(r) d ∈ head(r) c (5)

Definition 3 (Conditional Satisfaction)
Let M and S be sets of atoms.The set S conditionally satisfies a c-atom A w.r.t.M , denoted by S |= M A, if 1. S |= A and, Example 12 Let P 6 be the program b}, {∅, {a}, {b}})which has {a, c} as its only answer set.Thus, {a, c} is an answer set by complement of P 5 . 2 The next example shows that this approach can lead to different answer sets than the case of negation by complement (for non-monotone programs).One consequence of the negation by reduct approach is the fact that it might lead to nonminimal answer sets-in the presence of non-monotone atoms.For instance, if we replace the atom Count({X | p(X)}) > 2 in P 1 with not Count({X | p(X)}) ≤ 2, the new program is (by replacing the aggregate with a c-atom): t. M (P M ) is the set of rules obtained by 1. removing all rules containing not A s.t.M |= A; and 2. removing all not A from the remaining rules.The program P M is a positive basic program.Thus, we can define answer sets for P as follows: Definition 8 A set of atoms M is an answer set by reduct of P iff M is an answer set of P M (w.r.t.Definition 4).Example 13 Let us reconsider the program P 5 from Example 11 and let us consider M = {a, c}.If we perform a reduct, we are left with the rules a ← c ← whose minimal model is M itself.Thus, M is an answer set by reduct of the program P 5 .2whichhas M as its answer set, i.e., M is an answer set by reduct of P 6 .2 Intuitively, P 8 is the choice atom 1 {a, b} 1 in the notation of Smodels.This program has two models, {a} and {b}.The instance inst(P 8 , {a}) contains the single fact a ← whose only answer set is {a}.Similarly, the instance inst(P 8 , {b}) is the single fact b ← whose only answer set is {b}.Thus, P 8 has the two answer sets {a} and {b}. 2 t. M , denoted by inst(P, M ), is the programinst(P, M ) = r∈P inst(r, M )It is easy to see that the instance of P w.r.t.M is a basic program.This allows us to define answer sets of general programs as follows.Definition 11 Let P be a general program.M is an answer set of P iff M is a model of P and M is an answer set of inst(P, M ).
For two sets of atoms M ⊆ M and a monotone c-atomA, if M |= A (resp.M |= Ā) and M |= A (resp.M |= Ā) then M |= M A (resp.M |= M Ā). (Recall that Ā denotes the complement of A.) Let us assume that M |= A and M |= A. From the monotonicity of A, we can conclude that, for every S, if M ⊆ S ⊆ M , we have that S |= A. As a result, we have M |= M A.
2. Let us assume that M |= Ā and M |= Ā.Let us assume, by contradiction, thatM |= M Ā.Since we already know that M |= Ā, this implies that there exists S