Answer Set Programming with Default

Victor W. Marek Jeffrey B. Remmel Department of Computer Science Department of Mathematics University of Kentucky University of California Lexington, KY 40506, USA, La Jolla, CA 92093, USA [email protected] [email protected]

Abstract to be equivalent to Autoepistemic Logic of Moore (Moore 1985). See (Marek and Truszczynski´ 1993) for details. The We develop an Answer Set Programming formalism based basic complexity result for Default Logic was established by on Default Logic. We show that computing generating sets of Gottlob (Gottlob 1992) (see also Stillman (Stillman 1992). extensions in this formalism captures all ΣP search problems. 2 Gottlob found that the decision problems associated with the Default Logic are complete for the second level of polyno- I. Introduction mial hierarchy. Specifically, the existence problem for ex- P The main motivation for this paper comes from recent de- tensions is Σ2 complete, the membership problem for exten- sions (membership in some, membership in all) are com- velopments in knowledge representation theory. In partic- P P ular, a new generation of general solvers have been de- plete, respectively, for Σ2 and Π2 . veloped, (Niemela¨ and Simons 1996; Eiter et. al. 1998; A search problem ((Garey and Johnson 1979)) S has two Cholewinski´ et.al. 1999; Syrjanen 2001; Simons et. al. components. First, S specifies a set of finite instances 2002), based on the so-called Answer Set Programming (Garey and Johnson 1979). For example, the search prob- (ASP) paradigm (Niemela¨ 1998; Marek and Truszczynski´ lem may be to find Hamiltonian paths in a graph so that the 1999; Lifschitz 1999). The most popular ASP formalism is set of instances of the problem is the set of all finite graphs. based on the the stable semantics for logic programs (SLP) Second, for any given instance I ∈ S, S specifies a set SI (Gelfond and Lifschitz 1988). However, one can easily ex- of solutions to the search problems S for instance I. For tend the ideas of answer set programming to other nonmono- example, in our Hamiltonian path problem, given a finite tonic logic formalisms such as default logic (Reiter 1980). graph I, SI is the set of all Hamiltonian paths of I. An al- In each case, the first question one should ask is what ex- gorithm solves the search problem S if, given any instance I actly can these systems theoretically compute. In (Marek of S, the algorithm returns a solution s ∈ SI , whenever SI is non-empty, and returns the string “empty” otherwise. and Remmel 2001), the authors answered this question for P ASP systems built on SLP. Namely, answer set programs un- We say that a search problem S is in Σ2 if and only if there der SLP can solve the class of NP-search problems and no is a polynomial time coding procedure which maps each in- more. The main result of this paper is to prove a similar re- stance in I ∈ S to a string xI and there is a non-deterministic sult for ASP systems built on Default Logic (DL). That is, polynomial time oracle Turing machine M with an oracle X ∈ NP such that given a coding xI of an instance I ∈ S, we shall show that ASP systems built on DL can solve the X P the output of any terminating computation of M with in- class of Σ2 search problems and no more. put xI codes a solution s ∈ SI and there are no terminating Default Logic has been introduced by Raymond Reiter in X his seminal paper (Reiter 1980). The formalism of De- computations of M on input xI if SI = ∅. fault Logic has been, subsequently, extensively studied by The goal of this paper is first to investigate the ASP for- the Knowledge Representation community. In addition to malism based on Default Logic (DL) which has the same the original semantics of extensions, many additional struc- basic properties as SLP Answer Set Programming formal- ism. This formalism is closely related to both to (Niemela¨ tures associated with a given default theory hD, W i have been introduced. Those include weak extensions (Marek and and Simons 1996) and (East and Truszczynski´ 2001), but al- Truszczynski´ 1989), Łukaszewicz extensions (Łukaszewicz lows for more complex entities. By definition, extensions 1984), rational extensions (Mikitiuk and Truszczynski´ 1993) of default theories are always infinite since they are closed and other structures. For a detailed discussion of De- under . This is in contrast with stable fault Logic with extensions see (Marek and Truszczynski´ models of logic programs which are finite. Thus to have an 1993). Default Logic with extensions forms a direct gen- appropriate analogue for the result that ASP logic programs eralization of stable semantics of logic program (the latter capture NP search problems, we shall consider generating sets of extensions of default theories as opposed to exten- has been introduced by Gelfond and Lifschitz in (Gelfond P and Lifschitz 1988)), see (Marek and Truszczynski´ 1989a; sions themselves. Then we will show that any Σ2 search Bidoit and Froidevaux 1991). Weak extensions turned out problem can be reduced to the problem of finding generat- ing sets for extensions of DL programs and, vice versa, the query Q = h(B, D), {S1,...,Sm}i equals problem of finding generating sets of extensions of DL pro- m grams is itself a P search problem. That is, we shall show Σ2 {S |W } that for each n and each polynomial run time bound p(x), [ i n,p n,p i=1 there is a single ASP default theory hDTrg , WTrg i that is ca- pable of simulating any polynomial time nondeterministic where Si|W is the set of all ground li-tuples t over U Turing oracle machine with an oracle for 3-SAT on inputs such that Si(t) is in at least one extension of Q + W . It of size n in the sense that given any polynomial time non- is clear that this is analogous to the way that DATALOG deterministic oracle Turing machine M with an oracle for and DATALOG¬ (see (Ullman 1988)) treats queries to 3-SAT and any input σ of size n, there is a set of formu- databases. Then the main result of (Cadoli et. al. 1994; p las edbM,p,σ such that a certain class of generating sets of Cadoli et. al. 1997) is that a database query is Σ2- n,p n,p the extensions of hDTrg , WTrg ∪ edbM,p,σi codes accepting recognizable if and only if it is definable as DQL I/0 query. The outline of this paper is as follows. In section II, we shall computations of M3-SAT started with input σ that termi- describe specifying our formulation of an Answer Set Pro- nates in p(|σ|) or fewer steps and any such accepting com- gramming based on default logic. We shall also formally putation of M3-SAT is coded by the generating set of some n,p n,p describe our conventions for how a non-deterministic oracle extension of hDTrg , WTrg ∪ edbM,p,σi. machine relative to an oracle for 3-SAT operates. Then in Our results here are closely related to the work of Cadoli, section III, we shall describe a uniform coding our uniform Eiter and Gottlob (Cadoli et. al. 1994; Cadoli et. al. 1997) coding of nondeterministic Turing machines with an oracle who studied the use of Default Logic as a query language. for 3-SAT via our ASP default theories which is used to de- Recall that Reiter, from the very beginning, recognized that rive our main result that our ASP default theories capture all one can treat defaults with variables. Reiter called such de- p Σ2-search problems. faults open and realized that they can be viewed as reasoning patterns. That is, instantiating an open default rule creates II. Technical preliminaries a new propositional default rule. In (Cadoli et. al. 1994; In this section, we formally introduce several notions that Cadoli et. al. 1997), a DQL Input/Output query Q consists will be needed for the proof of our main results. First, we of a pair (B, D) where B is a set of first-order formulas and shall make a typographical departure from the original con- D is a set of open default rules, where the first order lan- vention of Reiter for writing defaults. Recall, that in Reiter’s guage is function-free and quantifier-free, plus a set of out- original paper and most of the literature on Default Logic, a put relation schemata S = {S ,...,Sm}. One assumes that 1 default is written as α:β1,...,βk . This is convenient for theo- the set of predicate symbols occurring in the defaults of Q γ retical considerations, but it is not typographically suitable contain all the names of the relation schemata {R1,...,Rn} of the database (the extensional relations) and possibly some when either α and/or some of the β’s are long. Gelfond and other symbols (the intensional relations). One assumes that Lifschitz (Gelfond and Lifschitz 1991) suggested that de- the output relations are intensional. The intuitive meaning fault logic should be treated as a natural extension of Logic of query is the following. We want to compute all tuples Programming. We will follow this suggestion and write a in the Si relations which can be inferred under the credulous default as a rule: semantics. More formally, suppose W is a database instance γ ← α : β1,...,βk. over the set of relation schemata {R1,...,Rn} over a finite universe U. If Ri is an li-ary relation, let Ri|W be the set of First, we introduce the set of propositional default logic li-tuples in W belonging to Ri. Let the completion of W , programs that we will study. Let Form(L) be the set COMP(W ) be of formulas for a propositional language L. Given T ⊆ Form(L), we let the theory of T , Th(T ), denote the set n of all logical consequences of T . We say that T is the- [{R(a1,...,ali ) : (a1,...,ali ) ∈ Ri|W }∪ ory if T = Th(T ). We let P(Form(L)) denote the set i=1 of all subsets of Form(L). A propositional default the- n ory hD, W i is a pair where D is a collection of default li [{¬R(a1,...,ali ) : (a1,...,ali ) ∈U \ Ri|W }. rules and W is a subset of Form(L). To each such de- i=1 fault theory hD, W i, we associate an operator, ΓhD,W i : COMP(W ) completely describes the finite relational sys- P(Form(L)) → P(Form(L)), called Reiter’s operator, tem hU,R1,...,Rni. by defining ΓhD,W i(S) = T if T is the least theory con- Let INST (B) denote the set of ground formulas that result tained in Form(L) such that (i) W ⊆ T and (ii) T by uniformly substituting constants from U for the free vari- satisfies the following condition: Whenever ψ ← α : ables in formulas of B and, similarly, let INST (D) denote β1,...,βm ∈ D, α ∈ T, ¬β1 ∈/ S,..., ¬βm ∈/ S, then ψ ∈ the set of ground default rules that result by uniformly sub- T. A theory S ⊆ Form(L) is called a default exten- stituting constants from U for the free variables in formu- sion of hD, W i if ΓhD,W i(S) = S. We say that G is las of the open defaults in D. Let Q + W denote the de- a generating set for hD, W i if W ⊆ G ⊆ W ∪ {φ : fault theory with defaults INST (D) and first-order formu- φ is the head of some rule r ∈ D} and Th(G) is an exten- las COMP(W ) + INST (B). Then the answer to the DLQ sion of hD, W i. In the spirit of answer set programming, we shall extend the the form notion of propositional default theories to predicate logic de- M = (Q, Σ, Γ,D,δ,s0,,sq, f). fault theories where there are no function symbols in the Here Q is a finite set of states and Σ is a finite alphabet of underlying predicate logic. These predicate logic default input symbols. We assume Q always contains three special theories are the analogue of ¬ program used in DAT ALOG states, s0, the start state, sq, the query state, and f, the final (Marek and Remmel 2001) or PS+ theories used in (East and state. We also assume that there is a special symbol B for Truszczynski´ 2001). That is, we consider a predicate logic L “blank” such that B∈ / Σ and Γ = Σ ∪ {B} is the set of tape where we allow predicate symbols of any arity but no func- symbols. The set D is the set of move directions consisting tion symbols. In particular, we allow predicate symbols of of the elements l, r, and λ where l is the “move left” symbol, arity 0 which are propositional letters. The only terms of the r is the “move right” symbol and λ is the “stay put” symbol. language are either constant symbols or individual variables. The function δ is the nondeterministic transition function of In particular both Herbrand universe and Herbrand base of the machine M. L are finite, since we will deal with finite default theories. We assume M operates on two one-way infinite tapes, a We let Form(L) denote the set all formulas of L and we let computation tape and a query tape, where the cells of the Sent(L) denote the set of sentences of L, i.e. the set of all tapes are labeled from left to right by 0, 1, 2,.... To visual- formulas of L with no free variables. We let QFForm(L) ize the behavior of the machine M, we shall talk about the denote the set all quantifier free formulas of Form(L) and two read-write heads of the machine, the c-read-write head QF Sent(L) denote the set of all quantifier free sentences on the computation tape and the q-read-write head on the of Sent(L). If X = (x1,...,xn) is a sequence of individ- query tape. At any given time in a computation, the read- ual variables, then for any given formula ϕ ∈ Form(L), we write heads of M are always in some state s ∈ Q and the shall write ϕ(X) to indicate that the free variables of ϕ are c-read-write head is reading some symbol pa ∈ Γ which among the variables in X. is in some cell a on the computation tape and the q-read- An ASP default theory is a pair hD, W i where D is a finite write head is reading some symbol pb ∈ Γ which is in collection of default rules, that is, rules of form some cell b on the query tape. If s 6= sq, then M picks an instruction (s1,p1, d1,p2, d2) ∈ δ(s,pa,pb) and then re- r(X) = ψ(X) ← α(X) : β1(X),...,βm(X), (1) places the symbol pa on the computation tape by p1, re- places the symbol pb on the query tape by p2, changes its where α(X), β1(X),...,βm(X), and ψ(X) are quantifier state to state s1, and moves on the computation tape ac- free formulas in L and W a finite subset of QFForm(L). cording to d1 and on the query tape according to d2. If Let c1, . . . , ck be the set of all constants that occur in s = sq, then M takes one of two actions depending on hD, W i. Suppose that X = (X1,...,Xn). Then ground in- the current state of the query tape and the oracle O. That stance of default rule r(X) as in (1) is the result of a simul- is, if the string of symbols consisting of all cells that are taneous substitution of constants d = (d1,...,dn), where weakly to the left of the right-most non-blank symbol on the di ∈ {c1, . . . , ck} for all i, for the variables X occurring in query tape is in O (not in O), then M picks an instruction r(X). Similarly a ground instance of a formula ϕ(X) ∈ W (s1,p1, d1,p2, d2) such that {yes} × (s1,p1, d1,p2, d2) ∈ is the result of a simultaneous substitution of constants d for δ(sq,pa,pb) ({no} × (s1,p1, d1,p2, d2) ∈ δ(sq,pa,pb)) the variables X occurring in ϕ. Given a ASP default theory and then replaces the symbol pa on the computation tape by hD, W i, hDg, Wgi is a propositional default theory where p1, replaces the symbol pb on the query tape by p2, changes Dg is the set of all ground instances of rules in D and Wg its state to state s1, and moves on the computation tape ac- of all ground instances of formulas in W . If no constant cording to d1 and on the query tape according to d2. symbol occurs in hD, W i, then we fix some new constant We assume that at the start of the computation of M on input of length , the cells of the computation tape symbol c1 and let hDg, Wgi be the result of substituting c1 σ n 0,...,n − 1 for every variable that occurs in hD, W i so that once again contain the symbols σ(0),...,σ(n − 1) respectively and all hDg, Wgi can be considered a propositional default theory. cells to the right of cell n − 1 are blank. We also assume We then say that E is an extension of hD, W i if and only if that all the symbols on the query tape are blank. We do not E is an extension of hDg, Wgi. impose (as it is often done) any special restrictions on the Our first result is that the problem of computing generating state of the tape and the position of the read-write heads at sets an ASP default theory is a ΣP -search problem. That is, the end of computation. However, we assume that at the start 2 of any computation, the read-write heads are in state and fix some set of variables X = {X1,...,Xk}. Then we con- s0 sider the set DF (X ) of all finite ASP predicate logic default the c-read-write head is reading the symbol in cell 0 on the theories hD, W i whose underlying set of variables is con- computation tape and the q-read-write head is reading the tained in X . Then we can define a search problem S(X ) by symbol in cell 0 of the query tape. saying that an instance I of S(X ) is a default theory hD, W i Suppose we are given a oracle Turing machine M with ora- in DF (X ) and the set of solutions of I is the set of generat- cle O whose runtimes are bounded by a polynomial p(x) = k ing sets of hDg, Wgi. It is then easy to prove the following. a0 + a1x + · · · + akx where each ai ∈ N = {0, 1, 2,...} and ak 6= 0. That is, on any input of size n, an accepting Theorem 1 For any set of variables X = {X1,...,Xk}, P computation terminates in at most p(n) steps. Then any ac- S(X ) is a Σ2 search problem. cepting computation on input σ can affect at most the first A nondeterministic Oracle Turing Machine is a 8-tuple of p(n) cells of the both the computation and the query tapes. Thus in such a situation, there is no loss in only consider- III. Uniform coding of Nondeterministic ing tapes of length p(n). Hence in what follows, one shall Oracel Turing Machines with a 3-SAT Oracle implicitly assume that the both the computation tape and the query tapes are finite. Moreover, it will be convenient to by a Default Logic Program modify the standard operation of M in the following ways. In this section, we shall prove our main result that computing 1. We shall assume δ(f, a, b) = {(f,a,λ,b,λ)} for all generating sets of extensions of DL programs captures all P a, b ∈ Γ. Σ2 search programs. 2. Given an input x of length n, instead of immediately halt- We define for each n and run time polynomial p, a de- n,p n,p ing when we first get to the final state f reading a symbol fault theory hDTrg, WTrgi, and for each input σ of length a on the computation tape and symbol b on the query tape, n and nondeterministic polynomial time oracle Turing ma- we just keep executing the instruction (f,a,λ,b,λ) until we chine M with an oracle for 3-SAT, an extensional database have completed p(n) steps. That is, we remain in state f, we edbM,p,σ which can be computed in polynomial time from never move, and we never change any symbols on the tapes M,p, and σ such that (a) for each accepting computation c after we get to state f. The main effect of these modifica- of M on input σ, there is a generating set Gc of a unique ex- tions is that all accepting computations will run for exactly n,p n,p tension Ec of hDTrg, WTrg ∪ edbM,p,σi which codes the p(n) steps on an input of size n. computation c in such a way that c can be recovered in Finally, we end this section by describing our conventions linear time from Gc and (b) for each extension E of the n,p n,p for the operation of Turing machines with an oracle for 3- hD , W ∪ edbM,p,σi, there is an accepting computa- SAT. First we need to discuss the coding of clauses with Trg Trg tion cE of M on input σ such that Th(GcE ) = E. three literals (3-clauses, for short). A 3-clause is an ex- First, we need to define the underlying language of the pression of the form ε A ∨ ε A ∨ ε A where each n,p n,p 1 i1 2 i2 3 i3 theory hD , W i. We also explain the use for each ε is either empty string or ¬, and A , j = 1, 2, 3 are Trg Trg i ij symbol. The set of predicates that will occur in our ex- propositional atoms. If we have n propositional atoms, tensional database are the following: time(X) for “X is A ,...,A then there is precisely 8 · n 3-clauses based 1 n 3 a time step”, c-cell(X) for “X is a cell number on the on A ,...,A . We order the 3-clauses so that the 3-clauses 1 n computation tape”, q-cell(X) for “X is a cell number on based on A ,...,A form an initial segment of the 3- 1 n the query tape”, symb(X) for “X is a symbol”, state(S) clauses based on A ,...,A . Thus when we write ϕ , we 1 n+1 i for “S is a state”, ci position(P ) for “P is the initial mean the th 3-clause in this fixed ordering. With this con- i position of the read-write head on the computation tape”, vention, the index i such that ε A ∨ ε A ∨ ε A = ϕ 1 i1 2 i2 3 i3 i qi position(P ) for “P is the initial position of the read- 8·(n) does not depend on the number n of atoms. There are 2 3 write head on the computation tape”, c-data(P, Q) for “Ini- propositional formulas of the form ϕ11 ∧ · · · ∧ ϕim where tially, the computation tape stores the symbol Q at the cell n 1 ≤ i1 < ... < im ≤ 8 · 3. These are the pos- P ”, q-data(P, Q) for “Initially, the query tape stores the sible elements of 3-SAT based on the propositional atoms symbol Q at the cell P ”, tapec(X,Y,T ) for “X is symbol in

A1,...,An. Our convention that ϕi1 ∧ · · · ∧ ϕim will be cell Y on the computation tape at time T ”, tapeq(X,Y,T ) coded on the query tape by a sequence of (e0,...,e n ) for “X is symbol in cell Y on the query tape at time 8·( − ) 3 1 T ”, delta(X,Y,Z,X1,Y 1,M1,Y 2,M2) for “the 5-tuple where ei = 1 if i + 1 ∈ {i1,...,im} and ei = B otherwise. In our coding of Turing machine via ASP default theories, (X1,Y 1,M1,Y 2,M2) is an executable instruction when we will be given a non-deterministic polynomial time oracle the read-write head is in state X ∈ Q − {sq} and is reading Turing machine with a 3-SAT oracle and we will be given the symbol Y on the computation tape and the symbol Z on a run time p(n). Thus on an input of size n, the oracle ma- the query tape”, deltayes(sq,Y,Z,X1,Y 1,M1,Y 2,M2) chine can visit at most p(n) cells on the both the compu- for “the 5-tuple (X1,Y 1,M1,Y 2,M2) is an executable in- tation and the query tape. By our coding of 3-clauses, any struction when the read-write head is in state sq and is read- ing the symbol Y on the computation tape and the sym- clause that contain the propositional letter At has index at t bol Z on the query tape and the oracle gives the answer most 8 · 3. Thus any query that we make of 3-SAT cer- tainly cannot contain an A where t>p(n). Thus, since yes”, deltano(sq,Y,Z,X1,Y 1,M1,Y 2,M2) for “the 5- t tuple (X1,Y 1,M1,Y 2,M2) is an executable instruction there are 8 · p(n) 3-clauses based on the propositional let- 3  when the read-write head is in state sq and is reading ters A1,...,Ap(n), we will assume that on an input of size the symbol Y on the computation tape and the symbol Z n, the input tape has exactly p(n) cells and the query tape on the query tape” and the oracle gives the answer no”, p(n) has exactly 8 · 3  cells. In that case, we are coding the neq(X,Y ) for “X is different from Y ” , eq(X,Y ) for “X n 1 8·(3) is equal to Y ”, succ(X,Y ) for “Y is equal to X + 1” 2 propositional formulas of the form ϕ11 ∧ · · · ∧ ϕim where 1 ≤ i < ... < i ≤ 8 · n by strings of 0’s content(A,X,T ) for the the predicate that A is the sym- 1 m 3 bol in cell X of the query tape at time T . and 1’s of length 8 · n . There are many such codings that 3 Now fix a polynomial time Turing machine M = are possible, but any such coding of such conjunctions of n (Q, Σ, Γ,D,δ,s0,sq, f) with a 3-SAT oracle, an input σ = 8· three clauses with strings of 0’s and 1’s still must use 2 (3) strings and hence cannot produce a significantly shorter set 1For the clarity of presentation we will use equality symbol =, of codes. inequality symbol, 6= and relation described by the successor func- tion +1, instead of eq, neq, and succ. (σ(0),...,σ(n−1)) of length n, and a run-time polynomial ext M,p,σ is designed to help us deal with the operation of p(x). This given, we now define the extensional database the Turing machine M when it is in the query state sq. extM,p,σ. First, extM,p,σ will contain the following the fol- Our idea is to use that fact that extensions are closed under lowing set of constant symbols: (1) 0, 1,..., 8 · p(n) , (2) logical consequences to help us give correct answers for the 3  oracle 3-SAT. Our idea is that we will employ a set of s, for each s ∈ S (Note three constants s0 (for initial state), p(n) sq (for query state) and f (for final state) will be present in propositional letters A1,...,Ap(n). Recall our coding of every extensional database), (3) (blank symbol) and for 3-clauses ϕ1, ϕ2,...,ϕ p(n) based on the propositional B x 8·( 3 ) each x ∈ Σ, and (4) r,l,λ. letters A1,...,Ap(n). In addition, we will employ one other Our extensional database edbM,σ,p will consist of two propositional letter D. groups. The first group of facts consists of the following Our second group of formulas in ext M,p,σ are : set of facts that describe the machine M, i.e. the basic (17) content(1,i,t) ↔ ¬ϕ for all 1 ≤ i ≤ 8 · p(n) and declarations for the predicates , , and , the i 3  state symb delta 0 ≤ t ≤ p(n). segment of integers 0,..., 8 · t , i.e. the basic declarations 3 (18) for all p(n) and for the predicates time, c-cell, q-cell, and predicates that content(B, i) ↔ D&¬D 1 ≤ i ≤ 8 · 3  describe the initial configuration the computation tape on 0 ≤ t ≤ p(n). input σ. To understand to role of the these sentences, we will (1) For each s ∈ Q, the clause state(s) belongs to briefly describe several of the predicates that will occur in ASP default theory hDn,p , W n,pi. First we will have ext M,p,σ. Trg Trg (2) For each x ∈ Γ, the clause symb(x) belongs to a predicate, tapeq(X,Y,T ) which is to mean that at time ext M,p,σ. T , symbol X is in cell Y of the query tape and a predicate (3) For every triple (s,x,y) ∈ Q − {sq} × Γ × Γ and every state(S,T ) which is to mean that M is in state S at time T . 5-tuple (s1,x1, d1,x2, d2) ∈ δ(s,x,y), We will also have two predicates no(T ) and yes(T ). The the clause delta(s,x,y,s1,x1, d1,x2, d2) belongs to main properties that we shall prove about these predicates is ext M,p,σ. that yes(T ) will hold if at time T if the read-write heads are (4) For every pair (x,y) ∈ Γ × Γ and every 5-tuple in state sq and the 3-SAT oracle gives the answer “yes” to (s1,x1, d1,x2, d2) such that (yes, (s1,x1, d1,x2, d2)) ∈ our query and no(T ) will hold if at time T , if the read-write δ(sq,x,y), the clause heads are in state S = sq and the 3-SAT oracle gives the deltayes(sq,x,y,s1,x1, d1,x2, d2) belongs to ext M,p,σ. answer “no” to our query. (5) For every pair (x,y) ∈ Γ × Γ and every 5-tuple The key to our proof that atoms yes(T ) and no(T ) correctly (s1,x1, d1,x2, d2) such that (no, (s1,x1, d1,x2, d2)) ∈ simulate the oracle is the fact that it will be the case that δ(s ,x,y), the clause none of the atoms content nor the atoms Ai occur in any q n,p n,p deltano(sq,x,y,s1,x1, d1,x2, d2) belongs to ext M,p,σ. conclusion of the rules of our default theory hDTrg , WTrg i. p(n) n (6) For 0 ≤ i < 8 · , the clause succ(i, i + 1) belongs They only occur in WTrg ∪ ext M,p,σ. That is, we can prove 3  the following proposition. to ext M,p,σ. (7) For 0 ≤ i ≤ p(n), the clause time(i) belongs to Proposition 1 Let ψ be any formula of the propositional ext M,p,σ. language based on atoms content(a, i, t), a ∈ {0, 1}, i ≤ (8) For 0 ≤ i ≤ p(n) − 1, the clause c-cell(i) belongs to n 8 · 3, 0 ≤ t ≤ p(n) and Ai, 1 ≤ i ≤ p(n). Let T be any ext M,p,σ. n,p consistent theory generated by WTrg ∪ ext M,p,σ and any set (9) For p(n) , the clause - belongs n,p 0 ≤ i ≤ 8 · 3  − 1 q cell(i) of conclusions of rules from D . Then ψ ∈ Th(T ) if and to ext . Trg M,p,σ only if ψ ∈ Th(W n,p ∪ ext ). (10) For 0 ≤ m ≤ |σ| − 1, the clause c-data(m,σ(m)) Trg M,p,σ n belongs to c-ext M,p,σ. Once we specify WTrg ∪ ext M,p,σ, we will be able to prove (11) For |σ| ≤ m ≤ p(n) − 1, the clause c-data(m,B) via induction on the length the sequence of configurations belongs to ext M,p,σ. that specify a partial computation of M3-SAT on input σ p(n) (12) For 0 ≤ m ≤ 8 · 3  − 1, the clause q-data(m,B) that the following proposition holds. belongs to ext M,p,σ. 8· n (13) The clauses , and belong to (3) dir(l) dir(r) dir(λ) Proposition 2 Let hxiii=1 be a binary sequence of length ext M,p,σ. n 8 · 3. Then if M started on input σ has an accept- (14) The clauses ci position(0) and qi position(0) ing computation, then for all 0 ≤ t ≤ n, the formula belong to ext . n M,p,σ 8·(3) n,p p n content(x ,i,t) belongs to Th(W ∪ ext ) if (15) For all ( ) with , Wi=1 i Trg M,p,σ a, b ∈ S ∪ Γ ∪ {0,..., 8 · 3 } a 6= b n and only if the set of formulas A = {¬ϕi : i < 8 · ,xi = the clause neq(a, b) belongs to ext M,p,σ. 3 p(n) 1} is unsatisfiable. (16) For all a ∈ S ∪ Γ ∪ {0,..., 8 · 3 }, the clause eq(a, a) belongs to ext M,p,σ. Note that Proposition 2 completely characterizes formulas of 8·(n) the form 3 content(x ,i,t) that belong to Th(W n ∪ The second group of facts in our extensional database Wi=1 i Trg ext M,p,σ). n,p n,p Next we specify the description of hDTrg , WTrg i The n,p n,p Group 1. Defaults describing how the position of the read- remaining predicates of hDTrg , WTrg i are the following: write head evolves. tapec(P,Q,T ) for “the computation tape stores symbol Q at cell P at time T ”, (1.1) (Initial position of the c-read-write head) tapeq(P,Q,T ) for “the query tape stores symbol Q at cell positionc(P, T ) ← time(T ), c-cell(P ), T = 0, P at time T ”, ci position(P ) : positionc(P,T ) for “the c-read-write head reads the content (1.2) (Initial position of the q-read-write head) cell P at time T ”, positionq(P, T ) ← time(T ), q-cell(P ), T = 0, positionq(P,T ) for “the q-read-write head reads the qi position(P ) : content cell P at time T ”, We have 6 rules that describe how read write heads move state(S,T ) for “the read-write heads are in state S at time depending of the values of D and D . For example, we T ” (notice that we have both a unary predicate state/1 with 1 2 would have the following two clauses when D equals l. the content consisting of states, and state/2 to describe the i evolution of the machine), (1.3) positionc(P 1, T 1) ← time(T ; T 1), c-cell(P ; P 1), yes(T ) for the oracle gives the answer “yes” at time T , state(S; S1), dir(D1; D2), symb(Q; R; Q1; Q2), no(T ) for the oracle gives the answer “yes” at time T T 1 = T + 1, P 1+1= P, positionc(P, T ), instr(S,Q,R,S1, Q1, D1, Q2, D2,T ) for “instruction state(S, T ), tapec(P,Q,T ), (S1, Q1, D1, Q2, D2) has been selected for execution at instr(S,Q,R,S1,Q1, D1,Q2, D2, T ), D1 = l, P 6= 0 : time T ”, (1.4) positionq(P 1, T 1) ← time(T ; T 1),q-cell(P ; P 1), otherInstr(S,Q,,R,S1, Q1, D1, Q2, D2,T ) for “in- state(S; S1), dir(D1; D2), symb(Q; R; Q1; Q2), struction other than (S1, Q1, D1, Q2, D2) has been T 1 = T + 1, P 1+1= P, positionq(P, T ), selected for execution at time T ”, state(S, T ), tapeq(P,R,T ), instr def (T ) for “there is an instruction to be executed at instr(S,Q,R,S1,Q1, D1,Q2, D2, T ), D2 = l, P 6= 0 : time T ”, Then we would include four more such clauses (1.5)-(1.8) completion for “computation successfully completed”, and to cover the cases when D equals r or λ. A, a propositional letter. 2. i

n,p n,p Group 2. Defaults describing how the contents of the The defaults in our theory hDTrg , WTrg i consists of tape change as instructions get executed. rules which describe how the Turing machine M operates with an oracle for 3-SAT. That is, we have to describe how (2.1) tapec(P,Q,T ) ← time(T ), c-cell(P ), symb(Q), the state and the contents of the computation and query T = 0, datac(P,Q) : tapes evolve in the course of a computation of M3-SAT(σ). (2.2) tapeq(P,Q,T ) ← time(T ), q-cell(P ), symb(Q), As we shall see, each individual rule is relatively simple, but T = 0, dataq(P,Q) : there has to be a large number of rules due to the inherent (2.3) tapec(P,Q1, T 1) ← time(T ; T 1), c-cell(P ), complexity of describing the way a nondeterministic Turing state(S; S1), dir(D1; D2), symb(Q; R; Q1; Q2), machine evolves. The only subtle rules are the rules in T 1 = T + 1, positionc(P, T ), state(S, T ), tapec(P,Q,T ), Group 6 below which rely on the interaction between the instr(S,Q,R,S1,Q1, D1,Q2, D2, T ) : predicates content(Xi,i,T ) described above. In the default (2.4) tapeq(P,Q2, T 1) ← time(T ; T 1), q-cell(P ), n,p n,p theory hDTrg , WTrg i, there should be no constants. That state(S; S1), dir(D1; D2), symb(Q; R; Q1; Q2), is, all constants should appear in the extensional database T 1 = T + 1, positionq(P, T ), state(S, T ), tapeq(P,R,T ), only. For notational convenience, we will not be strict in instr(S,Q,R,S1,Q1, D1,Q2, D2, T ) : this respect. That is, to simplify our presentation, we will (2.5) tapec(P,Q,T 1) ← time(T ; T 1), c-cell(P ; P 1), symb(Q), n,p n,p use the constants 0, f, and s0 in hDTrg , WTrg i. These T 1 = T + 1, tapec(P,Q,T ), positionc(P 1, T ), P 6= P 1 : can easily be eliminated by introducing appropriate unary (2.6) tapeq(P,Q,T 1) ← time(T ; T 1), q-cell(P ; P 1), symb(Q), predicates. Finally to simplify the clauses, we will follow T 1 = T + 1, tapeq(P,Q,T ), positionq(P 1, T ), P 6= P 1 : here the notation used in the smodels syntax. That is, we shall write Group 3. Defaults describing how the state of the read-write as Q(X) ← α1(X) ∧ · · · ∧ αn(X) : β1(X),...,βm(X) head evolves over time. Q(X) ← α1(X),...,αn(X) : β1(X),...,βm(X). (3.1) state(S, T ) ← time(T ), state(S), T = 0, S = s0 : Also, we will use p(X1; . . . ; Xk) as an abbreviation for p(X1),...,p(Xk). (3.2) state(S1, T 1) ← time(T ; T 1), c-cell(P 1), q-cell(P 2), state(S; S1), dir(D1; D2), symb(Q; R; Q1; Q2), T 1 = T + 1, positionc(P 1, T ), positionq(P 2, T ), 2The propositional letter A will be used whenever we write state(S, T ), tapec(P 1,Q,T ), tapeq(P 2,R,T ), clauses acting as constraints. That is, the symbol A will occur in instr(S,Q,R,S1,Q1, D1,Q2, D2, T ) : the following syntactical configuration. A will be the head of some clause, and A will also occur in the restraints of that same clause. In such situation an extension cannot satisfy the remaining atoms Group 4. Defaults describing the unique instruction to be in the body of that clause. executed at time T . (4.1) Selecting instruction at step 0. (6.1) no(T ) ← symbol(X1; . . . : X · p(n) ), 8 ( 3 ) instr(S,Q,R,S1,Q1, D1,Q2, D2, T ) ← state(S; S1), p(n) q-cell(1; . . . ; 8 · ), time(T ), state(sq, T ), symb(Q; R; Q1; Q2), dir(D1; D2), time(T ), T = 0, 3  8·(p(n)) 3 content c-cell(P 1), q-cell(P 2), S = s0, tapec(P 1,Q,T ) (Wi=1 ( (Xi, i, T )) & (Xi = 1 ∨ Xi = B), · p(n) ci position(P 1), tapeq(P 2,R,T ), qi position(P 2), 8 ( 3 ) ( (tape (Xi, i, T ) & (Xi = 1 ∨ Xi = B)) : delta(S,Q,R,S1,Q1, D1,Q2, D2) : Vi=1 q (6.2) yes(T ) ← symbol(X1; . . . : X · p(n) ), otherInstr((S,Q,R,S1,Q1, D1,Q2, D2, T ) 8 ( 3 ) p(n) (4.2) Defaults describing the selection the instruction to be im- q-cell(1; . . . ; 8 · 3 ), time(T ), state(sq, T ), · p(n) plemented at non-query steps. 8 ( 3 ) ( (tape (Xi, i, T ) & (Xi = 1 ∨ Xi = B)) : no(T ) instr(S,Q,R,S1,Q1, D1,Q2, D2, T ) ← state(S; S1), Vi=1 q symb(Q; R; Q1; Q2), dir(D1; D2), time(T ), T 6= 0, The idea of these clauses is as follows. For any given c-cell(P 1), q-cell(P 2), positionc(P 1, T ), positionq(P 2, T ), time t with 0 ≤ t ≤ p(n), cell i with 0 ≤ i ≤ 8 · S s , tape P ,Q,T , tape P ,R,T , p(n) 6= q c( 1 ) q( 2 ) 3  and symbol si,t ∈ {1,B}, the only way that we delta(S,Q,R,S1,Q1, D1,Q2, D2) : can derive tapeq(si,t,i,T ) is if there is partial computa- otherInstr(S,Q,R,S1,Q1, D1,Q2, D2, T ) 3-SAT tion of M (σ) such that si,t is in cell i at of the (4.3) Selecting instruction at query steps where the oracle an- query tape at time t. This means that to derive no(t), we swers yes. p(n) 8·( 3 ) instr(S,Q,R,S1,Q1, D1,Q2, D2, T ) ← state(S; S1), must be able to derive Θt = (Wi=1 (content(si,t,i,t)). But by Proposition 1 and the clauses in our extensional S = sq, dir(D1; D2), symb(Q; R; Q1; Q2), time(T ), database described in (17) and (18) , can be derived from T 6= 0, c-cell(P 1),q-cell(P 2), positionc(P 1, T ), Θt hDTrg , WTrg ∪ edbM,p,σi only if ¬φi is a tautol- positionq(P 2, T ), tapec(P 1,Q,T ), tapeq(P 2,R,T ), Wsi,t=1 yes(T ), deltayes(S,Q,R,S1,Q1, D1,Q2, D2) :, ogy where the disjunction runs for all cells i on the query tape. But ¬φi is equivalent to ¬( φi) which otherInstr(S,Q,R,S1,Q1, D1,Q2, D2, T ) Wsi,t=1 Vsi,t=1 (4.4) Selecting instruction at query steps where the oracle an- represents the negation of the query given to the 3-SAT ora- cle at time t. Since ¬( φi) is a tautology, it must be swers no. Vsi,t=1 instr(S,Q,R,S1,Q1, D1,Q2, D2, T ) ← state(S; S1), that φi is not satisfiable. Thus clause 6.1 can hold Vsi,t=1 S = sq, dir(D1; D2), symb(Q; R; Q1; Q2), time(T ), if and only if our 3-SAT oracle gives the answer no at time T 6= 0, c-cell(P 1), q-cell(P 2), positionc(P 1, T ), t. Clause 6.2 then says that if we do not get the answer no positionq(P 2, T ), tapec(P 1,Q,T ), tapeq(P 2,R,T ), from the 3-SAT oracle at time t, then we must get the answer no(T ), deltano(S,Q,R,S1,Q1, D1,Q2, D2) : yes from the 3-SAT oracle at time t. otherInstr(S,Q,R,S1,Q1, D1,Q2, D2, T ) Group 7. Defaults that ensure that extensions only corre- spond to accepting computations. Group 5. Defaults that define the otherInstr pred- (7.1) completion ← symb(Q), instr(f,Q,f,Q,λ,p(n)) :. icate. Rules (5.1)-(5.8) are designed to say that (7.2) A ←: ¬completion, ¬A a 9-tuple (S,Q,R,S1, Q1, D1, Q2, D2,T ) sat- isfies otherInstr if it differs from the 9-tuple Proposition 3 There is a polynomial q so that for every (S′, Q′,R′,S2, Q3, D3, , Q4, D4,T ) that satisfies instr. machine M, polynomial p, and an input σ, the size of Thus a typical rule would be the extensional database edbM,p,σ is less than or equal to q(|M|, |σ|,p(|σ|)). (5.1) otherInstr(S,Q,R,S1,Q1, D1,Q2, D2, T ) ← ′ ′ ′ state(S; S ; S1; S2), symb(Q; Q ; R; R ; Q1; Q2,Q3,Q4), We can prove that for any nondeterministic oracle Turing time(T ), dir(D1; D2, D3, D4), Machine M with oracle 3-SAT, runtime polynomial p(x), ′ ′ ′ ′ instr(S ,Q ,R ,S2,Q3, D3,,Q4, D4, T ),S 6= S : and input σ of length n, the generating sets of extensions of hD , W ∪ edb i encode the sequences of tapes Rules (5.2)-(5.8) are identical to rule (5.1) except that they Trg Trg M,p,σ ′ ′ of length p(n) which occur in the steps of an accepting end in Q 6= Q :, R 6= R :, S1 6= S2 :, Q1 6= Q3 :, 3-SAT D1 6= D3 :, Q2 6= Q4 :, D2 6= D4 : instead of S 6= S′ :. computation of M starting on σ and that any such sequence of steps can be used to produce an extension of Our next two clauses are designed to ensure that ex- hDTrg , WTrg ∪ edbM,p,σi. actly one instruction is selected for execution at any given The key idea is to consider valid runs of the oracle machine time T . M3-SAT started on input σ. A configuration relative to state S is a quintuple hi,U,V,u,vi where (5.9) instr def (T ) ← state(S; S1), symb(Q; Q1), dir(D), time(T ), instr(S,Q,S1,Q1,D,T ) : 1. i is an instruction hS,Q,R,S1, Q1, D1, Q2, D2i, (5.10) A ← time(T ), ¬instr def (T ) : ¬A 2. U is a state of the computation tape, 3. V is the state of the query tape, Group 6. Defaults that ensure that the predicates yes(T ) 4. u is an integer ≤ p(n) such that U(u) = Q ∈ Σ ∪ {B}, and no(T ) behave properly when M is in the query state sq and p(n) at time T . 5. v is an integer ≤ 8· 3  such that V (v) = R ∈ Σ∪{B} Informally, u is the index of the cell on which the read-write Since the problem of finding accepting computations for or- P head on the computation tape is pointing at the time the con- acle Turing machines with a 3-SAT oracle captures all Σ2 figuration is observed and Q = U(u) is the content of that search problems, it follows that computing generating sets P cell. Similarly, v is the index of the cell on which the read- of extensions of DL Answer Set programs captures all Σ2 - write head on the query tape is pointing at the time the con- search problems. Thus we have the following. figuration is observed and R = V (v) is the content of that P cell. Conditions (4) and (5) are coherence conditions which Theorem 3 The class of Σ2 search problems is precisely captured by the problem of computing generating sets for say that the instruction i is applicable in the configuration. extensions of DL Answer Set programs. A valid run C = hC0,...,Cp(n)i of the machine M, where for m, 0 ≤ m ≤ p(n), IV. Conclusions Cm = him,Um,Vm,um,vmi In this paper, we gave a formulation of an Answer Set Pro- gramming language based on Default Logic where the basic such that each transition Ci to Ci+1 is allowed by the tran- defaults are quantifier free and the underlying language has sitions of 3-SAT. We define the set of atoms which M NC no function symbols. We showed that our Default Logic consists of the union of sets of atoms N ∪ . . . ∪ N where: 1 14 ASP programs capture precisely the Σp search problems. p 2 N1 = edbM,p,σ That is, one can reduce any Σ2 search problem to the prob- N2 = {state(S, m) : im = hS,Q,R,S1,Q1, D1,Q2, D2i lem of finding generating sets for extensions of a Default & 0 ≤ m ≤ p(m)} Logic ASP program and vice versa, the problem of finding

N3 = {positionc(um, m) : 0 ≤ m ≤ p(n)} a generating set for an extension of a Default Logic ASP p N4 = {positionq(vm, m) : 0 ≤ m ≤ p(n)} program is a Σ2 search problem. We proved our result by showing that one could uniformly code the accepting com- N5 = {tapec(r, Um(r), m) : 0 ≤ m ≤ p(n), 0 ≤ r ≤ p(n) − 1} putations nondeterministic oracle Turing machines with an oracle for 3-SAT as generating sets of appropriate Default N = {tape (r, Vm(r), m) : 0 ≤ m ≤ p(n), 6 q Logic ASP programs. This proof provides a precise way 0 ≤ r ≤ 8 · p(n) − 1} 3  of explaining why questions about extensions of Default N7 = {yes(m) : im = hsq,Q,R,S1,Q1, D1,Q2, D2i & Logic theories naturally lie at the second level of polyno- the set if formulas {¬ϕi : Vm(i) = 1} is satisfiable} mial time hierarchy since it shows that there is a natural way N8 = {no(m) : im = hsq,Q,R,S1,Q1, D1,Q2, D2i & in which Default Logic theories can query an NP-complete the set if formulas {¬ϕi : Vm(i) = 1} is unsatisfiable} oracle. We note that there is an alternative way to derive the N9 = {instr(S,Q,R,S1,Q1, D1,Q2, D2, m) : same result by reducing the problem of finding generating im = hS,Q,R,S1,Q1, D1,Q2, D2i, 0 ≤ m ≤ p(n)} sets for extensions of Default Logic ASP programs to the ′ ′ ′ ′ ′ ′ ′ ′ N10 = {otherInstr(S ,Q ,R ,S1,Q1, D1,Q2, D2, m) : problem of answering queries of Default Logic query lan- ′ ′ ′ ′ ′ ′ ′ ′ ′ S 6= sq & (S1,Q1, D1,Q2, D2) ∈ δ(S ,Q ,R ), ′ ′ ′ ′ ′ ′ ′ ′ guage of Cardoli, Eiter, and Gottlob (Cadoli et. al. 1994; im 6= hS ,Q ,R ,S1,Q1, D1,Q2, D2i, Cadoli et. al. 1997). 0 ≤ m ≤ p(n)} ′ ′ ′ ′ ′ ′ ′ ′ N11 = {otherInstr(S ,Q ,R ,S1,Q1, D1,Q2, D2, m) : ′ ′ ′ ′ ′ ′ ′ ′ ′ References S = sq & yes × (S1,Q1, D1,Q2, D2) ∈ δ(S ,Q ,R ), ′ ′ ′ ′ ′ ′ ′ ′ im 6= hS ,Q ,R ,S1,Q1, D1,Q2, D2i, 0 ≤ m ≤ p(n)} N. Bidoit and Ch. Froidevaux. General Logic Databases ′ ′ ′ ′ ′ ′ ′ ′ N12 = {otherInstr(S ,Q ,R ,S1,Q1, D1,Q2, D2, m) : and Programs: Default Semantics and Stratification. Infor- ′ ′ ′ ′ ′ ′ ′ ′ ′ S 6= sq & no × (S1,Q1, D1,Q2, D2) ∈ δ(S ,Q ,R ), mation and Computation 19:15–54, 1991. ′ ′ ′ ′ ′ ′ ′ ′ im 6= hS ,Q ,R ,S1,Q1, D1,Q2, D2i, 0 ≤ m ≤ p(n)} M. Cadoli, T. Eiter and G. Gottlob. Default Logic as a N13 = {instr def (m) : 0 ≤ m ≤ p(n)} Query Language. Proceedings of the Fourth International

N14 = {completion} Conference on the Principles of Knowledge Representation and Reasoning (KR-94), pages 99–108, 1994. We can then show by induction that that if is valid run of C M. Cadoli, T. Eiter and G. Gottlob. Default Logic as a 3-SAT p,n n,p M , then Th(NC) is an extension of hDTrg, WTrg ∪ Query Language. IEEE Transactions on Knowledge and p,n n,p edbM,p,σi and for any extension E of hDTrg, WTrg ∪ Data Engineering 9:448-463, 1997. 3-SAT P. Cholewinski,´ W. Marek, A. Mikitiuk, and edbM,p,σi, there is a valid run C of M such that Th(N ) = E. Thus we have the following. M. Truszczynski.´ Programming with default logic. C Artificial Intelligence Journal 112:105–146, 1999. Theorem 2 The mapping of Turing machines to DL An- n,p n,p D. East and M. Truszczynski.´ Propositional satisfiabil- swer Set programs defined by hM,σ,pi 7→ hDTrg, WTrg ∪ ity in answer-set programming, Proceedings of Joint edbM,p,σi has the property that there is a 1-1 polynomial German/Austrian Conference on Artificial Intelligence, time correspondence between the set of generating sets NC KI’2001, Lecture Notes in Artificial Intelligence, Springer n,p n,p of extensions of hM,σ,pi 7→ hDTrg, WTrg ∪ edbM,p,σi and Verlag, 2001. the set of valid runs C of M with oracle 3-SAT of the length T. Eiter, N. Leone, C. Mateis, G. Pfeifer, and F. Scarcello. p(n), starting on the state σ of the tape, and ending in the A deductive system for non-monotonic reasoning. In Pro- state f. ceedings of the 4th International Conference on Logic Pro- gramming and Nonmonotonic Reasoning, Springer LN in implementing the . Artificial Intel- Computer Science 1265, pages 363–374, 1997. ligence Journal, 138:181–234, 2002. T. Eiter, N. Leone, C. Mateis, G. Pfeifer, and F. Scarcello. J. Stillman. The Complexity of Propositional Default The KR System dlv: Progress Report, Comparisons, and Logic. Proceedings of the 10th National Conference on Ar- Benchmarks. In Proceedings Sixth International Confer- tificial Intelligence, AAAI-92, pages 794-799, 1992. ence on Principles of Knowledge Representation and Rea- T. Syrjanen.¨ Manual of Lparse version 1.0, http:// soning (KR-98), pages 406–417, 1998. saturn.tcs.hut.fi/Software/smodels, 2001 M.R. Garey and D.S. Johnson. Computers and intractabil- J. Ullman. Principles of Database and Knowledge-Base ity; a guide to the theory of NP-completeness. W.H. Free- Systems, Computer Science Press, 1988. man, 1979. M. Gelfond and V. Lifschitz. The stable semantics for logic programs. In Proceedings of the 5th International Sympo- sium on Logic Programming, pages 1070–1080, 1988. M. Gelfond and V. Lifschitz. Classical negation in logic programs and disjunctive databases. New Generation Com- puting 9:365–385, 1991. G. Gottlob. Complexity Results for Nonmonotonic . Journal of Logic and Computation 2:397–425, 1992. V. Lifschitz. Answer set planning. In Logic program- ming and nonmonotonic reasoning, volume 1730 of Lec- ture Notes in Computer Science, pages 373–374. Springer- Verlag, 1999. W. Łukaszewicz. Considerations on default logic. In R. Re- iter, (ed.), Proceedings of the International Workshop on Non-Monotonic Logic, pages 165–193, 1984. On the Foundations of Answer Set Programming, Pro- ceedings of AAAI Symposium on Answer Set Programming, Stanford, CA. March 26-28, 2001. V.W. Marek and M. Truszczynski.´ Relating Autoepistemic and Default Logics. Proceedings of the First International Conference on Knowledge Representation and Reasoning, pages 276–288, 1989. V.W. Marek and M. Truszczynski.´ Stable Semantics for Logic Programs and Default Theories. In: Proceedings of North American Conference on Logic Programming, pages 243–257, 1989. V.W. Marek and M. Truszczynski.´ Nonmonotonic Logic: Context-Dependent Reasoning. Springer Verlag, 1993. V.W. Marek and M. Truszczynski.´ Stable Models and an Alternative Logic Programming Paradigm. The Logic Pro- gramming Paradigm, pages 375–398. Series Artificial In- telligence, Springer-Verlag, 1999. A. Mikitiuk and M. Truszczynski. Rational Default Logic and Disjunctive Logic Programming. In: A. Nerode and L. Pereira, (eds.), Logic Programming and Nonmonotonic Reasoning, pages 283–299, 1993. R. Moore. Semantical Considerations on Nonmonotonic Logic. Artificial Intelligence Journal, 25:75–94, 1985. I. Niemela.¨ Logic programs with stable model semantics as a constraint programming paradigm. In Proceedings of the Workshop on Computational Aspects of Nonmonotonic Reasoning, pages 72–79, 1998. I. Niemela¨ and P. Simons. Efficient implementation of the well-founded and stable model semantics. In Proceedings of JICSLP-96. MIT Press, 1996. R. Reiter. A logic for default reasoning. Artificial Intelli- gence, 13(1-2):81–132, 1980. P. Simons, I. Niemela,¨ and T. Soininen. Extending and