Answer Set Programming with Default Logic
Total Page:16
File Type:pdf, Size:1020Kb
Answer Set Programming with Default Logic 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 logical consequence. 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.