Complexity of Prioritized Default Logics

In default reasoning, usually not all possible ways of resolving conflicts between default rules are acceptable. Criteria expressing acceptable ways of resolving the conflicts may be hardwired in the inference mechanism, for example specificity in in…

Authors: J. Rintanen

Complexity of Prioritized Default Logics
Journal of Articial In telligence Researc h 9 (1998) 423-461 Submitted 8/98; published 12/98 Complexit y of Prioritized Default Logics Jussi Rin tanen rint anen@inf orma tik.uni-ulm.de Universit at Ulm F akult at f  ur Informatik A lb ert-Einstein-A l le e 89069 Ulm, GERMANY Abstract In default reasoning, usually not all p ossible w a ys of resolving conicts b et w een default rules are acceptable. Criteria expressing acceptable w a ys of resolving the conicts ma y b e hardwired in the inference mec hanism, for example sp ecicit y in inheritance reasoning can b e handled this w a y , or they ma y b e giv en abstractly as an ordering on the default rules. In this article w e in v estigate formalizations of the latter approac h in Reiter's default logic. Our goal is to analyze and compare the computational prop erties of three suc h formalizations in terms of their computational complexit y: the prioritized default logics of Baader and Hollunder, and Brewk a, and a prioritized default logic that is based on lexicographic comparison. The analysis lo cates the prop ositional v arian ts of these logics on the second and third lev els of the p olynomial hierarc h y , and iden ties the b oundary b et w een tractable and in tractable inference for restricted classes of prioritized default theories. 1. In tro duction Nonmonotonic logics and related systems for nonmonotonic and default reasoning (Reiter, 1980; Mo ore, 1985; McCarth y , 1980) w ere dev elop ed for represen ting kno wledge and forms of reasoning that are not con v enien tly expressible in monotonic logics, lik e the rst-order predicate logic or prop ositional logics. In nonmonotonic logics inferences can b e made on the basis of what cannot b e inferred from a set of facts. When extending this set, some of the inferences ma y b ecome in v alid, and hence the set of inferable facts do es not monotonically increase. F or example, in the kind of reasoning expressed as inheritance net w orks (Hort y , 1994), one net w ork link ma y sa y that priests im bib e non-alcoholic b ev erages only . This is, in the absence of con trary information, a sucien t reason to conclude that a certain priest will not drink v o dk a. Without con tradiction, information stating that the priest do es drink v o dk a can b e added, whic h retracts the previous conclusion. The need to incorp orate priorit y information to nonmonotonic logics (Lifsc hitz, 1985; Brewk a, 1989; Gener & P earl, 1992; Ry an, 1992; Brewk a, 1994; Baader & Hollunder, 1995) stems from the p ossibilit y that t w o default rules are in conict. One source of suc h priorit y information is the sp ecicit y of defaults. When one rule sa ys that priests usually do not drink and another sa ys that men usually do, inferences concerning male priests should b e based on the rst one b ecause it is more sp ecic, as male priests are a small subset of men. Sp ecicit y as a basis for resolving conicts b et w een defaults has b een in v estigated in the framew ork of path-based inheritance theories (Hort y , 1994). In general, ho w ev er, priorities ma y come from dieren t sources, and therefore it is justied to in v estigate non- monotonic reasoning with an abstract notion of priorities as orderings on defaults. In this c  1998 AI Access F oundation and Morgan Kaufmann Publishers. All righ ts reserv ed. Rint anen setting the problem is to dene what are the correct inferences in the presence of priorities. There ha v e b een man y prop osals of diering generalit y . Preferred subtheories (Brewk a, 1989) and ordered theory presen tations (Ry an, 1992) do not ha v e as general a notion of defaults as Reiter's default logic, and they can b oth b e translated to prerequisite-free nor- mal default theories of a prioritized default logic (Rin tanen, 1999). Also the denitions of mo del minimization in conditional en tailmen t (Gener & P earl, 1992) and in prioritized circumscription (Lifsc hitz, 1985) do not directly supp ort defaults with prerequisites. In this w ork w e concen trate on Brewk a's (1994) and Baader and Hollunder's (1995) prop osals for incorp orating priorities to default logic, as w ell as a prop osal that uses lexico- graphic comparison (Rin tanen, 1999). These three prop osals address default reasoning with defaults that ha v e prerequisites. Lik e earlier w ork on complexit y of nonmonotonic logics (Kautz & Selman, 1991; Stillman, 1990; Gottlob, 1992), the purp ose of our in v estigation is to p oin t out fundamen tal dierences and similarities b et w een these logics, c haracterized b y p olynomial time translatabilit y b et w een their decision problems, and to iden tify restricted classes of default theories where reasoning is tractable. The rst kind of results are useful for example when dev eloping theorem-pro ving tec hniques for the logics in question. The in- existence of p olynomial time translations b et w een t w o decision problems indicates that the tec hniques needed are lik ely to b e dieren t: it is not feasible to solv e one decision problem b y simply translating it to the other. Also, if p olynomial time translations exist and they turn out to b e simple, there is often no reason to treat the decision problems separately . The second kind of results, iden tication of tractable cases, directly giv e ecien t, that is p olynomial time, decision pro cedures for prioritized reasoning in sp ecial cases. The utilit y of these algorithms dep ends on the application at hand. In man y cases the restrictions that lead to p olynomial time decision pro cedures are to o sev ere to mak e the pro cedures practically useful. Ev en though nonmonotonic reasoning usually cannot b e p erformed in p olynomial time, new dev elopmen ts in implemen tation tec hniques ha v e made it p ossible to solv e problems that previously w ere to o dicult (Niemel a & Simons, 1996). Hence there are some prosp ects of making nonmonotonic reasoning practically useful, whic h mak es the problem of in tro ducing priorit y information in nonmonotonic reasoning more acute. This pap er can b e seen as giving guidelines in that direction. The decision problems of prop ositional default logic are lo cated on the second lev el of the p olynomial hierarc h y (Gottlob, 1992), and hence they do not b elong to the classes NP or co-NP unless the p olynomial hierarc h y collapses to its rst lev el. The pro of of this result suggests that reasoning in default logic cannot b e p erformed in p olynomial time simply b y restricting the form ulae in default theories to a tractable sub class of prop ositional logic lik e 2-literal clauses (Ev en, Itai, & Shamir, 1976) or Horn clauses (Do wling & Gallier, 1984). This fact can b e seen as a consequence of the p ossibilit y of conicting defaults. A conict b et w een defaults giv es rise to m ultiple extensions b ecause a case analysis on alternativ e w a ys of resolving the conict is required. F or a default theory of size n , the n um b er of conicts ma y b e prop ortional to n , and eac h conict ma y double the n um b er of extensions. Hence the n um b er of extensions can b e prop ortional to 2 n . Priorities in man y cases uniquely determine ho w a conict b et w een defaults is resolv ed, and hence the case analyses that lead to an exp onen tial n um b er of extensions can b e a v oided. This giv es rise to the question whether priorities w ould in some cases pro duce a computational adv an tage in the sense that the decision problems could b e solv ed more ecien tly than in the unprioritized case. 424 Complexity of Prioritized Def a ul t Logics T o in v estigate these questions w e consider three denitions of priorities in the framew ork of Reiter's default logic. First w e analyze the computational complexit y of t w o closely related prioritized default logics (Brewk a, 1994; Baader & Hollunder, 1995). These logics are based on the semicon- structiv e denition of extensions of default logic (Reiter, 1980): the priorities con trol the construction of extensions, ruling out those that do not resp ect the priorities. In the general case the complexit y of the decision problems of these logics equals the complexit y of those of Reiter's default logic, b eing complete for the second lev el of the p olynomial hierarc h y . When the priorities are a total ordering on the defaults, the complexit y decreases b y one lev el, leading to man y tractable cases when the prop ositional reasoning in v olv ed is tractable, for example with Horn clauses or 2-literal clauses. With arbitrary strict partial orders there is no similar decrease. W e con tin ue b y analyzing a prioritized default logic that is based on comparing the Reiter extensions of a default theory b y lexicographic comparison (Rin tanen, 1999). The decision problem of this logic is harder than the decision problems of Reiter's default logic, assuming that the p olynomial hierarc h y do es not collapse. F or default theories with a total priorit y relation some syn tactically restricted classes are easier than the corresp onding unprioritized ones, but in general ev en total priorities do not reduce the complexit y of the decision problems. F or partial priorities tractabilit y can b e ac hiev ed only with extreme syn tactic restrictions, the complexit y b eing the same as with the prioritized default logics b y Brewk a and b y Baader and Hollunder. 2. Preliminaries on Computational Complexit y In this section w e in tro duce some basic concepts in computational complexit y . F or details see (Balc azar, D  az, & Gabarr o, 1995). The complexit y class P consists of decision problems that are solv able in p olynomial time b y a deterministic T uring mac hine. NP is the class of decision problems that are solv able in p olynomial time b y a nondeterministic T uring mac hine. The class co-NP consists of problems the complemen ts of whic h are in NP . In general, the class co-C consists of problems the complemen ts of whic h are in the class C. The p olynomial hierarc h y PH is an innite hierarc h y of complexit y classes  p i ,  p i and  p i for all i  0 that is dened b y using oracle T uring mac hines as follo ws.  p 0 = P  p 0 = P  p 0 = P  p i +1 = NP  p i  p i +1 = co-  p i +1  p i +1 = P  p i C C 2 1 denotes the class of problems that is dened lik e the class C 1 except that oracle T uring mac hines that use an oracle for a problem in C 2 are used instead of T uring mac hines without suc h an oracle. Oracle T uring mac hines with an oracle for a problem B are lik e ordinary T uring mac hines except that they ma y p erform tests for mem b ership in B with constan t cost. A problem L is T uring r e ducible to a problem L 0 if there is an oracle T uring mac hine with an oracle for L 0 that solv es L . The problem is T uring reducible in p olynomial time if the oracle T uring mac hine solv es L with a p olynomial n um b er of execution steps. A problem L is C -har d for a complexit y class C if all problems in C are p olynomial time many-one r e ducible to it; that is, for all problems L 0 2 C there is a function f L 0 that can b e computed in p olynomial time on the size of its input and f L 0 ( x ) 2 L if and only if x 2 L 0 . W e sa y 425 Rint anen that the function f L 0 is a translation from L 0 to L . A problem is C -c omplete if it b elongs to the class C and is C -hard. 3. Preliminaries on Default Logic Default logic is one of the main formalizations of nonmonotonic reasoning (Reiter, 1980). A default the ory  = h D ; W i consists of a set of default rules  :  1 ; : : : ;  n = where  (the pr e c ondition ),  (the c onclusion ) and  i ; i 2 f 1 ; : : : ; n g (the justic ations ) are form ulae of the classical prop ositional logic, and a set W of obje ctive facts that also are form ulae of the classical prop ositional logic. A default rule  :  1 ; : : : ;  n = can b e used for inferring the fact  if  has b een deriv ed, and none of the form ulae :  1 ; : : : ; :  n can b e deriv ed. As deriv abilit y and underiv abilit y are m utually dep enden t, there is circularit y in the denition of what is deriv able in default logic. Unlik e in monotonic logics, where the consequences of a set of form ulae is dened as the form ulae that can b e deriv ed b y using the axioms of the logic and the inference rules, the conclusions of a default theory  = h D ; W i are dened as xp oin ts of a nonmonotonic op erator. The op erator ma y ha v e sev eral xp oin ts, none of whic h is the least xp oin t, and dieren t xp oin ts can b e seen as a result of applying dieren t m utually incompatible sets of default rules. The xp oin ts of the op erator for a default theory are the extensions of the default theory . Informally , the construction of eac h extension of a default theory starts from the ob- jectiv e facts W , and pro ceeds b y adding conclusions of default rules the preconditions of whic h ha v e already b een deriv ed, and the justications of whic h ha v e not b een and will not later b e con tradicted. The construction ends when no more defaults can b e applied. Example 3.1 Dene  = h D ; W i b y D =  priest : : drinks-vo dka : drinks-vo dka ; man : drinks-vo dka drinks-vo dka ; priest : man man  ; and W = f priest g : A default  :  = can b e in terpreted as sa ying that an individual who has prop ert y  , can b e assumed to also ha v e the prop ert y  if this is consisten t with what else is kno wn. The default theory  has t w o extensions, E = Cn ( f priest ; man ; : drinks-vo dka g ) and E 0 = Cn ( f priest ; man ; drinks-vo dka g ), that represen t the t w o p ossibilities of resolving the conict b et w een the rst t w o defaults in D . The extension E corresp onds to the c hoice to apply the rst default, and the extension E 0 to the c hoice to apply the second. 2 The xp oin t denition of extensions is giv en next. The language of the prop ositional logic is denoted b y L . The closure of a set of form ulae S under logical consequence is Cn ( S ) = f  2 Lj S j =  g . The set f  :  1 ; : : : ;  n = j n  0 ; f ;  1 ; : : : ;  n ;  g  Lg of default rules is denoted b y D . The size of a default theory h D ; W i is the sum of the lengths of the form ulae in W and in defaults in D . A default theory is nite if D and W are nite. Denition 3.1 (Reiter, 1980) L et  = h D ; W i b e a default the ory. F or any set of for- mulae S  L , let ( S ) b e the smal lest set such that W  ( S ) , Cn (( S )) = ( S ) , and if  :  1 ; : : : ;  n = 2 D and  2 ( S ) and f:  1 ; : : : ; :  n g \ S = ; , then  2 ( S ) . A set of formulae E  L is an extension for  if and only if ( E ) = E . 426 Complexity of Prioritized Def a ul t Logics More pro cedural is the semic onstructive denition, so called b ecause it suggests a non- deterministic pro cedure for computing extensions. Theorem 3.2 (Reiter, 1980) L et E  L b e a set of formulae, and let  = h D ; W i b e a default the ory. Dene E 0 = W and for al l i  0 , E i +1 = Cn ( E i ) [ f  j  :  1 ; : : : ;  n = 2 D ;  2 E i ; f:  1 ; : : : ; :  n g \ E = ;g . Then E is an extension of  if and only if E = S i  0 E i : The set of gener ating defaults of an extension iden ties the extension uniquely , and is of nite size whenev er the n um b er of defaults is nite. Denition 3.3 (Reiter, 1980) Supp ose  = h D ; W i is a default the ory and E is an extension of  . The set of generating defaults of E with r esp e ct to  is GD ( E ; ) =   :  1 ; : : : ;  n  2 D      2 E and f:  1 ; : : : ; :  n g \ E = ;  : Theorem 3.4 (Reiter, 1980) Supp ose E is an extension of a default the ory  = h D ; W i . Then E = Cn ( W [ f  j  :  1 ; : : : ;  n = 2 GD ( E ; ) g ) . The standard consequence relations of default logic are c autious r e asoning j = c and br ave r e asoning j = b . Denition 3.5 L et  = h D ; W i b e a default the ory and  2 L a formula. Then  j = c  if and only if  2 E for al l extensions E of  , and  j = b  if and only if  2 E for some extension E of  . The follo wing terminology is used in referring to default rules of certain syn tactic forms. Defaults of the form  :  = ,  :  ^  = , > :  1 ; : : : ;  n = are resp ectiv ely normal , seminormal , and pr er e quisite-fr e e . The sym b ol > denotes a v alid form ula. Prerequisite-free defaults are often written without prerequisites as :  1 ; : : : ;  n = . W e shall sometimes denote sequences  1 ; : : : ;  n of justications b y  ;  0 ;  1 and so on. Not all seminormal default theories ha v e extensions, but all or der e d default theories do. In some cases, a decision problem for a class of default theories is in tractable, but for the sub class in whic h the default theories are ordered, it is tractable (Kautz & Selman, 1991). In later sections w e analyze the complexit y of decision problems b oth with and without the orderedness condition. Denition 3.6 (Etherington, 1987) L et  = h D ; W i b e a seminormal default the ory. Without loss of gener ality assume that al l formulae ar e in clausal form. The r elations  and  ar e dene d as fol lows. 1. If  2 W , then  =  1 _    _  n for some n  1 . F or al l  i ;  j 2 f  1 ; : : : ;  n g such that  i 6 =  j , let :  i   j . 2. If  2 D , then  =  :  ^  = . L et A , B and G b e the sets of liter als of the clausal forms of  ,  and  , r esp e ctively. (a) If  i 2 A and  j 2 B , let  i   j . 427 Rint anen (b) If  i 2 G and  j 2 B , let :  i   j . (c) A lso,  =  1 ^  ^  m for some m  1 . F or e ach i  m ,  i =  i; 1 _   _  i;m i wher e m i  1 . Thus if  i;j ;  i;k 2 f  1 ; 1 ;    ;  m;m m g and  i;j 6 =  i;k , let :  i;j   i;k . 3. The fol lowing tr ansitivity r elations hold for  and  . (a) If    and    , then    . (b) If    and    , then    . (c) If    and    or    and    , then    . The default the ory  is ordered if and only if    for no  . According to Theorem 1 in (Etherington, 1987), ordered default theories, lik e normal default theories and unlik e seminormal default theories in general, ha v e at least one exten- sion. 4. Prioritized Default Logics b y Brewk a and b y Baader and Hollunder Priorities in default logic ha v e b een in v estigated b y Baader and Hollunder (1995) and Brewk a (1994). They view priorities as information that selects whic h defaults are ap- plied next when constructing an extension. Priorities are strict partial orders, that is, transitiv e and asymmetric relations P on the defaults. If  P  0 , then the application of  is more desirable than the application of  0 , and the default  is more signican t or has a higher priorit y . Brewk a, as w ell as Baader and Hollunder, giv e a denition of preferred extensions b y mo difying the semiconstructiv e denition of extensions (Theorem 3.2.) The construction of an extension starts from the set W of ob jectiv e facts, and pro ceeds in stages b y rep eatedly applying the highest priorit y applicable defaults. In this section w e analyze the complexit y of the asso ciated decision problems. Denition 4.1 A default  :  = is activ e in E  L if E j =  and E 6j = :  and E 6j =  . Denition 4.2 (Baader and Hollunder, 1995) L et h D ; W i b e a default the ory and P a strict p artial or der on D . L et E  L b e a set of formulae. Dene for al l i  0 , E 0 = W E i +1 = E i [        :   2 D ; E i j = ; E 6j = :  ; no  P  :   is active in E i  : Then E is a P -pr eferr e d BH extension of h D ; W i if and only if E = S i  0 Cn ( E i ) . Brewk a's denition is syn tactically similar. W e ha v e expressed it in a w a y that high- ligh ts the dierences to Baader and Hollunder's denition. The main dierence is that the construction of a preferred extension pro ceeds b y applying defaults in an order sp ecied b y some strict total order that extends the priorities. F urthermore, Brewk a giv es his denition for normal default theories only , and the consistency of justications is tested against the sets E i instead of the set E . 428 Complexity of Prioritized Def a ul t Logics Denition 4.3 (Brewk a, 1994) L et h D ; W i b e a normal default the ory and P a strict p artial or der on D . Then E  L is a P -pr eferr e d B extension of h D ; W i if ther e is a strict total or der T on D such that P  T and E = S i  0 Cn ( E i ) wher e for al l i  0 , E 0 = W E i +1 = E i [        :   2 D ; E i j = ; E i 6j = :  ; no  T  :   is active in E i  : We say that E is gener ate d by T . The purp ose of b oth of these denitions of preferred extensions is to in tro duce a mec h- anism for resolving conicts b et w een defaults on the basis of the priorities. Dieren t ex- tensions represen t dieren t w a ys of resolving the conicts. The preferred extensions are a subset of all extensions of a default theory . Example 4.1 Let  = h D ; W i b e a default theory and P a strict partial order on D , where D =  priest : : like-r o ck-n-r ol l : like-r o ck-n-r ol l ; man : like-r o ck-n-r ol l like-r o ck-n-r ol l ; priest : man man  ; W = f priest g ; and P =  priest : : like-r o ck-n-r ol l : like-r o ck-n-r ol l ; man : like-r o ck-n-r ol l like-r o ck-n-r ol l  : The priorities P state that when reasoning ab out male priests, information sp ecic to priests should o v erride information concerning men in general. Of the extensions E = Cn ( f priest ; man ; : like-r o ck-n-r ol l g ) and E 0 = Cn ( f priest ; man ; like-r o ck-n-r ol l g ) only E is P -preferred B and P -preferred BH . In the Baader and Hollunder denition it is obtained as E = S i  0 Cn ( E i ) where E 0 = f priest g ; E 1 = f priest ; man ; : like-r o ck-n-r ol l g and E i = E 1 for all i  2. In this extension, the conict b et w een the rst t w o defaults is resolv ed in fa v or of the rst one. 2 The denitions are not equiv alen t, as demonstrated b y the follo wing example giv en b y Baader and Hollunder (1995). Baader and Hollunder also sho w that some extensions are preferred BH but not preferred B . Example 4.2 Let D = f : a=a; : b=b; b : c=c; a : : c= : c g and P = fh b : c=c; a : : c= : c ig . The exten- sion E = Cn ( f a; b; : c g ) is P -preferred B but not P -preferred BH . The extension E cannot b e obtained with the Baader and Hollunder denition. F or E 0 = Cn ( f a; b; c g ) the Baader and Hollunder denition pro duces the sets E 0 0 = ; , E 0 1 = f a; b g , E 0 2 = f a; b; c g and E 0 i = E 0 2 for all i  3, and the unique P -preferred BH extension is E 0 = S i  0 E 0 i . In Brewk a's de- nition w e can b ypass the higher priorit y default b : c=c b y using a total ordering where : b=b follo ws : a=a and a : : c= : c . This w a y w e obtain the sets E 0 = ; , E 1 = f a g , E 2 = f a; : c g , E 3 = f a; : c; b g and E i = E 3 for all i  4. 2 Consequence relations that corresp ond to cautious reasoning in Reiter's default logic are dened as follo ws. 429 Rint anen Denition 4.4 The c onse quenc e r elations j = B and j = BH ar e dene d by  j = B P  if and only if the formula  is in al l P -pr eferr e d B extensions of  , and  j = BH P  if and only if the formula  is in al l P -pr eferr e d BH extensions of  . Lemma 4.5 L et h D ; W i b e a normal default the ory and T a strict total or der on D . Then for al l E  L , E is a T -pr eferr e d B extension of h D ; W i if and only if E is a T -pr eferr e d BH extension of h D ; W i . Pr o of: If W is inconsisten t, then the inconsisten t extension L is the unique T -preferred B and T -preferred BH extension of . So assume W is consisten t. ( ) ) Assume that E is a T -preferred B extension of h D ; W i . By denition E = S i  0 Cn ( E i ), where E i are as in Denition 4.3. Let E 0 i ; i  0 b e the sets E i in Denition 4.2. W e sho w that E i = E 0 i for all i  0, and hence E = S i  0 Cn ( E 0 i ) is a T -preferred BH extension of . Induction hyp othesis : E i = E 0 i . Base c ase i = 0: Immediate. Inductive c ase i  1: Assume that for  :  = 2 D , E i  1 j =  , E i  1 6j = :  and no  T  :  = is activ e in E i  1 . Hence  2 E i . By the induction h yp othesis E 0 i  1 j =  and no  T  :  = is activ e in E 0 i  1 . T o sho w  2 E 0 i it remains to sho w that E 6j = :  . Because E is consisten t and E i  E and  2 E i , E 6j = :  . Hence  2 E 0 i and E i  E 0 i . Pro of of E 0 i  E i is similar. It suces to p oin t out that E 6j = :  implies E i  1 6j = :  simply b ecause E i  1  E . ( ( ) Let E b e a T -preferred BH extension of h D ; W i . Hence E = S i  0 Cn ( E 0 i ), where E 0 i ; i  0 are the sets in Denition 4.2. Let E i ; i  0 b e the sets in Denition 4.3. W e sho w b y induction that E = S i  0 E i . Induction hyp othesis : E i = E 0 i . Base c ase i = 0: Immediate. Inductive c ase i  1: Assume that for  :  = 2 D , E 0 i  1 j =  , E 6j = :  and no  T  :  = is activ e in E 0 i  1 . Hence  2 E 0 i . By the induction h yp othesis E i  1 j =  and no  T  :  = is activ e in E i  1 . T o sho w  2 E i it remains to sho w that E i  1 6j = :  . Because E 0 i  1  E and E 6j = :  , E 0 i  1 6j = :  . By the induction h yp othesis E i  1 = E 0 i  1 . Hence E i  1 6j = :  . Therefore E 0 i  E i . Pro of of E i  E 0 i pro ceeds similarly . Assume that for  :  = 2 D , E i  1 j =  , E i  1 6j = :  and no  T  :  = is activ e in E i  1 . By the induction h yp othesis E 0 i  1 j =  and no  T  :  = is activ e in E 0 i  1 . It remains to sho w that E 6j = :  . So assume E j = :  . Because  :  = is the T -least activ e default and E j = :  , E 0 i = E 0 i  1 , and further E 0 j = E 0 i  1 for all j  i . Therefore E = Cn ( E 0 i  1 ). This leads to a con tradiction with the assumption E j = :  and the fact E 0 i  1 66j = :  obtained with the induction h yp othesis. Therefore the assumption is false, and E 6j = :  . Therefore  2 E 0 i and E i  E 0 i . 2 4.1 Complexit y in the General Case With no restrictions on the form of defaults, b oth the Brewk a and the Baader and Hollunder prioritized default logics are complete for the second lev el of the p olynomial hierarc h y . This means that there are p olynomial time translations b et w een cautious reasoning in Reiter's default logic and the prioritized v ersions of cautious reasoning in b oth of these logics. Theorem 4.6 T esting  j = B P  for normal default the ories  , strict p artial or ders P and formulae  is  p 2 -c omplete. Pr o of: The  p 2 -hardness is b ecause with an empt y priorit y relation Brewk a's logic coincides with Reiter's default logic (Prop osition 6 in (Brewk a, 1994)), whic h is  p 2 -hard ev en with 430 Complexity of Prioritized Def a ul t Logics class of default theories form of defaults 1 disjunction-free a 1 ^ ^ a l : b 1 ^ ^ b n ^ c 1 ^ ^ c m b 1 ^ ^ b n 2 unary p : q q p : q ^: r q p : : q : q 3 disjunction-free ordered a 1 ^ ^ a l : b 1 ^ ^ b n ^ c 1 ^ ^ c m b 1 ^ ^ b n 4 ordered unary p : q q p : q ^: r q p : : q : q 5 disjunction-free normal a 1 ^ ^ a l : b 1 ^ ^ b n b 1 ^ ^ b n 6 Horn p 1 ^ ^ p n : q q p 1 ^ ^ p n : : q : q 7 normal unary p : q q p : : q : q 8 prerequisite-free : b 1 ^ ^ b n ^ c 1 ^ ^ c m b 1 ^ ^ b n 9 prerequisite-free ordered : b 1 ^ ^ b n ^ c 1 ^ ^ c m b 1 ^ ^ b n 10 prerequisite-free unary : q q : q ^: r q : : q : q 11 prerequisite-free ordered unary : q q : q ^: r q : : q : q 12 prerequisite-free normal : b 1 ^ ^ b n b 1 ^ ^ b n 13 prerequisite-free normal unary : q q : : q : q 14 prerequisite-free p ositiv e normal unary : q q T able 1: F orm of defaults in a n um b er of classes of default theories the restriction to normal defaults (Gottlob, 1992). W e sho w that the complemen t of the problem is in  p 2 , whic h directly implies that the problem is in  p 2 . The complemen tary problem is the existence of a P -preferred B extension E suc h that  62 E . The guessing of a strict total order T that generates an extension E suc h that  62 E can b e done b y a nondeterministic T uring mac hine in a p olynomial n um b er of steps: guess T , and guess the conclusions of generating defaults of E . The v erication that E fullls Brewk a's denition tak es a p olynomial n um b er of steps with an NP oracle for prop ositional satisabilit y . 2 Theorem 4.7 T esting  j = BH P  for default the ories  , strict p artial or ders P and formulae  is  p 2 -c omplete. Pr o of: Lik e the pro of of the previous theorem except that no strict total orders need to b e guessed. 2 4.2 Complexit y in Syn tactically Restricted Cases In this section w e in v estigate the complexit y of the prioritized default logics in syn tactically restricted cases. This sub ject is related to the researc h on the b oundary b et w een tractabil- it y and in tractabilit y of default logic without priorities b y Kautz and Selman (1991) and Stillman (1990). First w e analyze the case in whic h the priorities are strict total orders. Then w e complete the complexit y analysis b y extending the results to arbitrary strict partial orders. Kautz and Selman analyze the complexit y of determining the existence of extensions, cautious reasoning, and bra v e reasoning for default theories with defaults of the form listed in T able 1 (excluding the prerequisite-free classes) and with ob jectiv e parts that are sets of literals. In T able 1, the letters a; b; c { p ossibly subscripted { denote literals, and the 431 Rint anen letters p; q ; r denote prop ositional v ariables. Stillman considers only the problem of bra v e reasoning, but considers a wider range of classes. He analyzes default theories the ob jectiv e parts of whic h are sets of Horn clauses or sets of 2-literal clauses, and also the case where defaults are prerequisite-free. 1 The most general tractable classes in default logic without priorities are the follo wing.  If the ob jectiv e part W ma y con tain Horn clauses, none of the restrictions on the form of default rules is sucien t for ac hieving tractabilit y in bra v e reasoning (Stillman, 1990). Cautious reasoning has not b een in v estigated.  If W consists of 2-literal clauses, bra v e reasoning for the prerequisite-free normal class is tractable (Stillman, 1990). Cautious reasoning has not b een in v estigated.  If W consists of literals, bra v e reasoning for the prerequisite-free normal class and the Horn class are tractable (Kautz & Selman, 1991; Stillman, 1990). Cautious reasoning is tractable for the normal unary class (Kautz & Selman, 1991). Cautious reasoning for the prerequisite-free classes has not b een in v estigated. W e presen t a similar analysis for the same classes of prioritized default logics starting with the case where priorities totally order the defaults. W e presen t for eac h class either a p olynomial time decision pro cedure, or an NP-hardness or a co-NP-hardness result. 4.2.1 Summar y Because of the constructiv e nature of the denitions of preferred extensions in the pri- oritized default logics b y Brewk a and b y Baader and Hollunder, constructing the unique preferred extensions of default theories with total priorities is tractable whenev er the log- ical consequence tests in prop ositional logic are tractable (Theorem 4.8.) This is b ecause there is alw a ys a unique default that is applied next, and this default cannot b e defeated b y an y default applied later. So with total priorities, these prioritized default logics are computationally m uc h easier than Reiter's default logic. F or unrestricted priorities, T able 2 summarizes the complexit y of j = B and j = BH with v arious syn tactic restrictions. As Brewk a do es not consider non-normal default theories, complexit y results on seminormal classes concern the consequence relation j = BH only . In cases where Reiter's default logic is tractable and a prioritized default logic is not, or vice v ersa, the complexit y c haracterization is set in b oldface. T able 3 giv es references to the theorems and corollaries where the results are stated. W e use the notation n  to indicate that the in tractabilit y of the class is directly implied b y the in tractabilit y of the sub class n in the same column, and the notation  n to indicate that the tractabilit y is implied b y the tractabilit y of the sup erclass n in the same column. When the complexit y is directly implied b y the complexit y of an unprioritized class of default theories in v estigated b y Kautz and Selman (1991) w e indicate this b y K&S. 1. Stillman's denition of prerequisite-free unary and prerequisite-free ordered unary classes includes only default rules of the forms : : q = : q and : p ^ : q =p . W e, ho w ev er, consider also default rules of the form : p=p in order to ha v e a closer corresp ondence with the Kautz and Selman denition of unary classes. This c hange do es not sacrice generalit y , as the default : p=p w orks lik e : p ^ : q =p whenev er q do es not o ccur elsewhere in the default theory . 432 Complexity of Prioritized Def a ul t Logics class of default theories complexit y when clauses in W are Horn 2-literal 1-literal 1 disjunction-free co-NP-hard co-NP-hard co-NP-hard 2 unary co-NP-hard co-NP-hard co-NP-hard 3 disjunction-free ordered co-NP-hard co-NP-hard co-NP-hard 4 ordered unary co-NP-hard co-NP-hard co-NP-hard 5 disjunction-free normal co-NP-hard co-NP-hard co-NP-hard 6 Horn co-NP-hard co-NP-hard co-NP-hard 7 normal unary co-NP-hard co-NP-hard co-NP-hard 8 prerequisite-free co-NP-hard co-NP-hard co-NP-hard 9 prerequisite-free ordered co-NP-hard co-NP-hard co-NP-hard 10 prerequisite-free unary co-NP-hard co-NP-hard co-NP-hard 11 prerequisite-free ordered unary co-NP-hard co-NP-hard co-NP-hard 12 prerequisite-free normal co-NP-hard co-NP-hard co-NP-hard 13 prerequisite-free normal unary co-NP-hard co-NP-hard PTIME 14 prerequisite-free p ositiv e normal unary co-NP-hard co-NP-hard PTIME T able 2: Complexit y of the consequence relations j = B and j = BH class of default theories reference Horn 2-literal 1-literal 1 disjunction-free K&S K&S K&S 2 unary K&S K&S K&S 3 disjunction-free ordered K&S K&S K&S 4 ordered unary K&S K&S K&S 5 disjunction-free normal K&S K&S K&S 6 Horn K&S K&S K&S 7 normal unary 14  14  T4.15 8 prerequisite-free 14  14  12  9 prerequisite-free ordered 14  14  12  10 prerequisite-free unary 14  14  11  11 prerequisite-free ordered unary 14  14  T4.14 12 prerequisite-free normal 14  14  T4.13 13 prerequisite-free normal unary 14  14  T4.11 14 prerequisite-free p ositiv e normal unary T4.12 T4.12  13 T able 3: References to theorems on the complexit y of j = B and j = BH When lo oking at T able 2 it is sligh tly surprising that the fa v orable computational prop- erties in the totally ordered case are in no w a y reected in the complexit y of reasoning with arbitrary priorities. With arbitrary priorities, for almost all classes of default theories in the Kautz-Selman-Stillman hierarc h y the complexit y is the same as the complexit y of Reiter's default logic and the lexicographic prioritized default logic that is discussed in Section 5. 433 Rint anen 4.2.2 Tra ct able Classes The follo wing theorem sho ws that with the restriction to priorities that totally order the defaults, b oth the Baader and Hollunder and the Brewk a denition of preferred extensions yield an ecien t decision pro cedure for the resp ectiv e prioritized default logic. Theorem 4.8 L et h D ; W i b e a nite default the ory and T a strict total or der on D . The unique T -pr eferr e d BH extension (if pr eferr e d BH extensions exist) of h D ; W i c an b e c ompute d in p olynomial time if al l the memb ership tests in Cn ( E i ) in the denition of E ar e for a p olynomial time subset of the pr op ositional lo gic. Pr o of: Unlik e the denition of preferred B extensions, the denition of preferred BH exten- sions do es not directly yield a p olynomial time decision pro cedure for total priorities and tractable classical reasoning. This is b ecause the test that the justications of defaults to b e applied do not b elong to the extension b eing constructed cannot b e p erformed b efore the extension is fully kno wn. Ho w ev er, if a simple test for justications of defaults is added, the algorithm that w orks with preferred B extensions w orks also with preferred BH extensions. Compute sets E 0 i as follo ws. E 0 0 = W E 0 i +1 = E 0 i [        :   2 D ; E 0 i j = ; E 0 i 6j = :  ; no  T  :   is activ e in E 0 i  If E 0 i j = :  for some  :  = 2 D suc h that for some j < i , E 0 j j = ; E 0 j 6j = :  and no  T  :  = is activ e in E 0 j , then the algorithm returns false . If E 0 i = E 0 i +1 for some i  0, then return Cn ( E 0 i ) = S j 2f 0 ;::: ;i g Cn ( E 0 j ) and dene E 0 j = E 0 i for all j > i . Let E b e a T -preferred BH extension of h D ; W i . Hence E = S i  0 Cn ( E i ), where E i ; i  0 are the sets in Denition 4.2. W e sho w b y induction that E = S i  0 E 0 i and that the v alue false is not returned. Induction hyp othesis : E 0 i = E i . Base c ase i = 0: Immediate. Inductive c ase i  1: W e rst sho w that E i  E 0 i . Assume that for  :  = 2 D , E i  1 j =  , E 6j = :  and no  T  :  = is activ e in E i  1 . Hence  2 E i . By the induction h yp othesis E 0 i  1 j =  and no  T  :  = is activ e in E 0 i  1 . T o sho w  2 E 0 i it remains to sho w that E 0 i  1 6j = :  . Because E i  1  E and E 6j = :  , E i  1 6j = :  . By the induction h yp othesis E 0 i  1 = E i  1 . Hence E 0 i  1 6j = :  . Therefore  2 E 0 i and E i  E 0 i . Pro of of E 0 i  E i pro ceeds similarly . Assume that for  :  = 2 D , E 0 i  1 j =  , E 0 i  1 6j = :  and no  T  :  = is activ e in E 0 i  1 . By the induction h yp othesis E i  1 j =  and no  T  :  = is activ e in E i  1 . It remains to sho w that E 6j = :  . So assume E j = :  . Because  :  = is the T -least default and E j = :  , E i = E i  1 , and further E j = E i  1 for all j  i . Therefore E = Cn ( E i  1 ). This leads to a con tradiction with the assumption E j = :  and the fact E i  1 66j = :  obtained with the induction h yp othesis. Therefore the assumption is false, and E 6j = :  . Therefore  2 E i and E 0 i  E i . That the algorithm do es not return false go es similarly . Assume that for some  :  = 2 D , E 0 i j = :  and for some j < i , E 0 j j =  and no  T  :  = is activ e in E 0 j . W e ha v e to sho w that E 0 j 6j = :  . This is implied b y the fact E 6j = :  sho wn ab o v e b ecause E 0 j  E . Assume that the algorithm yields E = S i  0 Cn ( E 0 i ). W e claim that E is a P -preferred BH extension of h D ; W i . Because the algorithm did not return false and E = S i  0 Cn ( E 0 i ), 434 Complexity of Prioritized Def a ul t Logics PR OCEDURE decide( l ; D ; W ) IF W j = l THEN RETURN true; IF l 2 W THEN RETURN false; IF : l =l 62 D THEN RETURN false; IF : l = l 62 D THEN RETURN true; IF : l =l P : l = l THEN RETURN true; RETURN false END Figure 1: A decision pro cedure for prioritized prerequisite-free normal unary theories E 6j = :  for all  :  = 2 D suc h that for some j , E 0 j j = ; E 0 j 6j = :  and no  T  :  = is activ e in E 0 j . It is straigh tforw ard to sho w that E 0 i = E i for all i  0, where E i are the sets in Denition 4.2. Therefore E is a T -preferred BH extension of h D ; W i . 2 This theorem indicates that with a restriction to total priorities T , testing the mem b er- ship of a literal in all T -preferred BH extensions of default theories in all the classes of the Kautz and Selman and Stillman hierarc h y is in P . Corollary 4.9 T esting h D ; W i j = BH P  for disjunction-fr e e default the ories h D ; W i , wher e W is a set of Horn clauses or 2-liter al clauses, P is a strict total or der on D , and  is a liter al, c an b e done in p olynomial time. Corollary 4.10 T esting h D ; W i j = B P  for disjunction-fr e e normal default the ories h D ; W i , wher e W is a set of Horn clauses or 2-liter al clauses, P is a strict total or der on D , and  is a liter al, c an b e done in p olynomial time. Pr o of: Brewk a giv es a denition of preferred extensions for normal default theories only . By Lemma 4.5 the preferred extensions in this case coincide with the Baader and Hollunder preferred extensions whenev er the priorities are a strict total order. 2 F or unrestricted priorities the class of prerequisite-free normal unary default theories is tractable. The remaining classes in the hierarc h y are in tractable. Theorem 4.11 F or liter als l and pr er e quisite-fr e e normal unary the ories h D ; W i wher e W is a set of liter als, testing h D ; W i j = BH P l and h D ; W i j = B P l c an b e done in p olynomial time. Pr o of: The algorithm in Figure 1 tests h D ; W i j = B P l and h D ; W i j = BH P l . The correctness of the algorithm for j = BH P is as follo ws. F or j = B P the pro of is similar. W e analyze the if - statemen ts in sequence. In eac h case w e ma y use the negations of the assumptions of the previous cases. 1. Assume that W j = l . No w l is in all P -preferred BH extensions E of  b ecause b y denition W  E . Hence it is correct to return true . 2. Assume that l 2 W . Because W is consisten t (as W 6j = l ), all extensions are consisten t, and no extension con tains l . Hence it is correct to return false . 3. Assume that : l =l 62 D . Because l 62 W and all extensions are consisten t, no extension con tains l . Hence it is correct to return false . 4. Assume that : l = l 62 D . Because l 62 W , no extension con tains l , and hence : l =l is applied in all extensions, 435 Rint anen and l is in all extensions. Hence it is correct to return true . 5. Assume that : l =l P : l = l . Assume that there is a preferred BH extension E suc h that l 2 E . No w l 2 E i n E i  1 for some i . Hence l 62 E i  1 and : l =l is not activ e in E i  1 . Hence : l 2 E i  1 , whic h ho w ev er con tradicts the fact that l 62 E i  1 . Hence l in no P -preferred BH extension of , and  j = BH P l . Hence it is correct to return true . 6. In the remaining case not : l =l P : l = l . If : l = l P : l =l , then b y an argumen t similar to the previous case all P -preferred BH extensions { b y assumption there is at least one { con tain l , and hence it is correct to return false . If neither : l = l P : l =l nor : l =l P : l = l , then b y symmetry there is an extension not con taining l , and hence it is correct to return false . Therefore the algorithm returns true if and only if l is in all P -preferred BH extensions of . The algorithm ob viously runs in p olynomial time. 2 4.2.3 Intra ct able Classes In tractabilit y of all remaining classes except the normal unary class is directly implied b y the in tractabilit y of the same classes in Reiter's default logic, as sho wn b y Kautz and Selman (1991) and Theorems 4.12, 4.13 and 4.14. Stillman (1990) analyzes the complexit y of prerequisite-free default theories, and claims that bra v e reasoning for the prerequisite-free normal class with 2-literal clauses is solv able in p olynomial time. Ho w ev er, he do es not analyze the complexit y of cautious reasoning. It turns out that ev en with the restriction to prerequisite-free normal defaults with prop osi- tional v ariables in justications and conclusions, reasoning is in tractable. Theorem 4.12 T esting h D ; W i j = c l for liter als l and pr er e quisite-fr e e p ositive normal unary default the ories with obje ctive p arts that c onsist of 2-liter al Horn clauses, is c o-NP- har d. Pr o of: W e giv e a man y-one reduction from prop ositional satisabilit y to the complemen t of the problem. Let C b e a set of clauses and P the set of prop ositional v ariables that o ccur in C . Let N b e an injectiv e function that maps eac h clause c 2 C to a prop ositional v ariable n = N ( c ) suc h that n 62 P . Let D =  : p 0 p 0     p 2 P  [  : p 00 p 00     p 2 P  [  : n n     c 2 C ; n = N ( c )  ; and W = f p 0 ! p j p 2 P g [ f p 00 ! : p j p 2 P g [f p ! : n j p 2 c 2 C ; n = N ( c ) g [ f: p ! : n j: p 2 c 2 C ; n = N ( c ) g [f n ! false j c 2 C ; n = N ( c ) g : W e claim that h D ; W i 6j = c false if and only if C is satisable. Assume that C is satisable; that is, there is a mo del M suc h that M j = C . W e sho w that there is an extension of h D ; W i that do es not con tain false . Let E = Cn ( f p 0 j p 2 P ; M j = p g [ f p 00 j p 2 P ; M 6j = p g [ W ). T o sho w that E is an extension of h D ; W i , it suces to sho w that E is consisten t and for all : = 2 D , :  2 E if and only if  62 E . Let M 0 b e a mo del suc h that for all p 2 P , M 0 j = p i M j = p , M 0 j = p 0 i M j = p , and M 0 j = p 00 i M 6j = p , and M 0 6j = n for all n suc h that n = N ( c ) for some c 2 C . It is straigh tforw ard to sho w that M 0 j = E , and E is therefore consisten t. T ak e an y : = 2 D . Assume that 436 Complexity of Prioritized Def a ul t Logics :  2 E . Because E is consisten t,  62 E . Assume that  62 E . If  = p 0 , then b y denition p 00 2 E , and as f p 00 ! : p; p 0 ! p g  E , : p 0 2 E . Similarly for  = p 00 . If  = n suc h that n = N ( c ) for some c 2 C , then b ecause M j = c , there is disjunct l 2 f p; : p g of c suc h that M j = l , and hence b y denition l 2 E , and as l ! : n 2 E , : n 2 E . Therefore E is an extension of h D ; W i . Assume that h D ; W i 6j = c false ; that is, there is an extension E of h D ; W i suc h that false 62 E . Let M b e a mo del suc h that for all p 2 P , M j = p i p 2 E . W e sho w that M j = C , and hence C is satisable. Because false 62 E and n ! false 2 E for all n suc h that n = N ( c ) for some c 2 C , n 2 E for no n suc h that n = N ( c ) for some c 2 C . Because : n=n 2 D for all suc h n , : n 2 E for all suc h n , whic h means that for ev ery clause in C , one of its disjuncts is in E . By denition this disjunct is true in M . Hence ev ery clause in C is true in M . 2 An alternativ e w a y of obtaining the in tractabilit y of cautious reasoning for all classes with a Horn ob jectiv e part is to apply Theorem 8.2 in (Kautz & Selman, 1991) { that reduces bra v e reasoning to cautious reasoning b y adding a default : l =l { and the in tractabilit y result for bra v e reasoning in Horn classes (Stillman, 1990). This is not applicable to the 2-literal case b ecause in it bra v e reasoning is tractable. Theorem 4.13 T esting h D ; ;i j = c l for liter als l and sets D of pr er e quisite-fr e e normal defaults with c onclusions that ar e c onjunctions of liter als, is c o-NP-har d. Pr o of: Let C b e a set of clauses. W e sho w that there is a default theory h D ; ;i suc h that h D ; ;i 6j = c false if and only if C is satisable. Let P b e the set of prop ositional v ariables that o ccur in C . Let N b e an injectiv e function that maps eac h clause c 2 C to a prop ositional v ariable n = N ( c ) suc h that n 62 P . Dene the set of defaults D as follo ws. D =  : l ^ n l ^ n     c 2 C ; l 2 c; n = N ( c )  [  : : n ^ false : n ^ false     c 2 C ; n = N ( c )  Assume that C is satisable. Let M b e a mo del suc h that M j = C . Let E 0 = Cn ( f l ^ n j c 2 C ; l 2 c; n = N ( c ) ; M j = l g ) : Ob viously E 0 is consisten t and it do es not con tain false . 2 Clearly E 0 is an extension of hf : l ^ n=l ^ n 2 D j c 2 C ; l 2 c; n = N ( c ) ; l ^ n 2 E 0 g ; ;i . By Theorem 3.2 in (Reiter, 1980) there is an extension E of h D ; ;i suc h that E 0  E . Because n 2 E 0  E for all n = N ( c ) with c 2 C , false 62 E . Assume that there is an extension E of h D ; ;i suc h that false 62 E . Let M b e a mo del suc h that for all prop ositional v ariables p , M j = p if and only if p 2 E . Because false 62 E , : : n ^ false = : n ^ false 2 GD ( E ; h D ; ;i ) for no n = N ( c ) ; c 2 C . T ak e an y c 2 C . No w n = N ( c ) 2 E and hence : l ^ n=l ^ n 2 GD ( E ; h D ; ;i ) for some l 2 c . Hence l ^ n 2 E and M j = c . Because this holds for all c 2 C , nally M j = C . 2 2. E 0 is not necessarily an extension of h D ; ;i . Consider the satisable form ula a _ b the clausal form of whic h is C = ff a; b gg , and the mo del M that assigns true to a and false to b . No w E 0 = Cn ( f a ^ n g ). Ho w ev er, there is the set E = Cn ( f a ^ n; b ^ n g ) that extends E 0 and is an extension of h D ; ;i . 437 Rint anen Theorem 4.14 T esting h D ; ;i j = c l for liter als l and sets D of pr er e quisite-fr e e or der e d unary defaults is c o-NP-har d. Pr o of: Pro of is b y man y-one reduction from prop ositional satisabilit y to testing h D ; ;i 6j = c l . Let C b e an y set of clauses, and let P b e the set of prop ositional v ariables o ccurring in C . Let N b e an injectiv e function that maps eac h clause c 2 C to a prop ositional v ariable n = N ( c ) suc h that n 62 P . Let D =  : p p     p 2 P  [  : : p : p     p 2 P  [  : p 0 ^ : p p 0     p 2 P  [  : n ^ : p n     c 2 C ; n = N ( c ) ; : p 2 c  [  : n ^ : p 0 n     c 2 C ; n = N ( c ) ; p 2 c  [  : false ^ : n false     c 2 C ; n = N ( c )  : The orderedness condition is fullled b ecause the relation  ( P  f N ( c ) j c 2 C g ) [ ( f p 0 j p 2 P g  f N ( c ) j c 2 C g ) [ ( f N ( c ) j c 2 C g  f false g ) [ ( P  f p 0 j p 2 P g ) is irreexiv e. W e claim that C is satisable if and only if h D ; ;i 6j = c false . Assume that C is satisable; that is, there is a mo del M suc h that M j = C . W e construct an extension E of h D ; ;i suc h that false 62 E . Let A =  : p p     p 2 P ; M j = p  [  : : p : p     p 2 P ; M 6j = p  [  : p 0 ^ : p p 0     p 2 P ; M 6j = p  [  : n ^ : p n     c 2 C ; n = N ( c ) ; : p 2 c; M 6j = p  [  : n ^ : p 0 n     c 2 C ; n = N ( c ) ; p 2 c; M j = p  : Dene E = Cn ( f  j : = 2 A g ). T o v erify that E is an extension of h D ; ;i it suces to c hec k that for ev ery : = 2 A , :  62 E , and for ev ery : = 2 D n A , :  2 E , and this is straigh tforw ard. Hence h D ; ;i 6j = c false . Assume that h D ; ;i 6j = c false ; that is, there is an extension E of h D ; ;i suc h that false 62 E . Let M b e a mo del suc h that for all prop ositional v ariables p , M j = p if and only if p 2 E . W e sho w that M j = C . Because false 62 E , : false ^ : n= false 62 GD ( E ; ) for all n suc h that n = N ( c ) for some c 2 C . Hence n 2 E for all suc h n . Hence for ev ery n , there is : n ^ : p=n 2 GD ( E ; ) or : n ^ : p 0 =n 2 GD ( E ; ). Hence for ev ery clause l 1 _    _ l n 2 C , p 62 E for some : p 2 f l 1 ; : : : ; l n g , or p 0 62 E for some p 2 f l 1 ; : : : ; l n g . In the rst case b y denition M j = : p . In the second case p 2 E and hence b y denition M j = p . Hence ev ery clause in C is true in M , and C is satisable. 2 Ben-Eliy ah u and Dec h ter (1996) sho w that testing j = c for a class of default theories that subsumes all classes in the Kautz and Selman and Stillman hierarc h y that ha v e a 2-literal ob jectiv e part is co-NP-complete. Hence the problems in Theorems 4.12, 4.13 and 4.14 are in co-NP , and consequen tly co-NP-complete. The Ben-Eliy ah u and Dec h ter result, ho w ev er, has no direct implications on the complexit y of the prioritized v ersions of these problems. 438 Complexity of Prioritized Def a ul t Logics false T p’ p’ 1 1 k k p p n n n n’ n’ 1 1 2 m m n’ 2 T T T T T T T T Figure 2: A translation from satisabilit y to prioritized default logic Theorem 4.15 Both testing  j = B P l and  j = BH P l for normal unary default the ories  , strict p artial or ders P and liter als l , is c o-NP-har d. Pr o of: W e giv e the pro of for preferred B extensions only . The pro of for preferred BH exten- sions is similar. The pro of is b y reduction from prop ositional satisabilit y to the complemen t of the problem. Let C = f c 1 ; : : : ; c m g b e a set of prop ositional clauses and P the set of prop ositional v ariables o ccurring in C . Let N b e an injectiv e function that maps eac h clause c 2 C to a prop ositional v ariable n = N ( c ) suc h that n 62 P . Dene the default theory  = h D ; ;i and priorities P on D as follo ws. D 1 =  : p p     p 2 P  [  : : p : p     p 2 P  D 2 =  : p 0 p 0     p 2 P  [  p : : p 0 : p 0     p 2 P  D 3 =  p : n n     p 2 c 2 C ; n = N ( c )  [  p 0 : n n     : p 2 c 2 C ; n = N ( c )  [  : n 0 n 0     c 2 C ; n = N ( c )  [  n : : n 0 : n 0     c 2 C ; n = N ( c )  [  n 0 : false false     c 2 C ; n = N ( c )  D = D 1 [ D 2 [ D 3 P =   p : : p 0 : p 0 ; : p 0 p 0      p 2 P  [ ( D 1  ( D 2 [ D 3 )) Priorities are needed to guaran tee that p 2 E if and only if p 0 62 E , and total priorities cannot b e used b ecause w e cannot restrict to those mo dels that corresp ond to preferred extensions (with resp ect to some ordering on the v ariables), as they are not necessarily mo dels of C ev en if C is satisable. The default theory is depicted in Figure 2. Defaults p : q =q are sho wn as arro ws p ! q , and defaults p : : q = : q as brok en arro ws p 6! q . Only some of defaults p : n=n and p 0 : n=n for prop ositions p 2 P and n; n = N ( c ) for c 2 C , are in D , 439 Rint anen and therefore they are sho wn as dashed arro ws. W e claim that C is satisable if and only if there is a P -preferred B extension of  that do es not con tain false . Assume that C is satisable; that is, there is a mo del M suc h that M j = C . W e sho w that there is a P -preferred B extension E of  suc h that false 62 E . Let E = Cn ( f p 2 P j M j = p g [ f p 0 j p 2 P ; M 6j = p g [ f: p j p 2 P ; M 6j = p g [ f: p 0 j p 2 P ; M j = p g [ f n j c 2 C ; n = N ( c ) g [ f: n 0 j c 2 C ; n = N ( c ) g ). Let T b e a strict total order on D suc h that P  T and for all p 2 P , : p=p T : : p= : p if M j = p and : : p= : p T : p=p otherwise, and n : : n 0 = : n 0 T : n=n for all c 2 C , n = N ( c ). It is straigh tforw ard to v erify that E is a P -preferred B extension of  generated b y T . Clearly false 62 E . Assume that E is a P -preferred B extension suc h that false 62 E . Let M b e a mo del suc h that for all p 2 P , M j = p if and only if p 2 E . Because false 62 E , no default n 0 : false = false is applied in E , where n = N ( c ) for some c 2 C . Therefore n 0 62 E for all n = N ( c ) suc h that c 2 C . Therefore : n 0 2 E and n 2 E for all suc h n . Hence a disjunct p is in E or p 0 is in E for a disjunct : p for ev ery c 2 C . In the rst case b y denition of M , M j = c . In the second case p 62 E , b ecause otherwise : p 0 w ould b e in E as p : : p 0 = : p 0 P : p 0 =p 0 . Hence M j = : p and M j = c . Because this holds for all c 2 C , nally M j = C . 2 5. Lexicographic Prioritized Default Logic A denition of prioritized default logic is used b y Rin tanen (1999). This denition is based on an earlier one for auto epistemic logic (Rin tanen, 1994). The priorit y mec hanism uses lexicographic comparison and the preferred extensions in this approac h do not in general coincide with the preferred extensions in the prioritized default logics discussed in Section 4. Lexicographic comparison has earlier b een used in the con text of nonmonotonic reasoning b y sev eral researc hers (Lifsc hitz, 1985; Gener & P earl, 1992; Ry an, 1992). Comparing t w o extensions is based on whether the defaults are generating defaults of the extensions, that is, whether their prerequisites b elong to the extension and the negations of the justications do not b elong to the extension. W e sa y that a generating default of an extension is applie d in the extension. Denition 5.1 (Application) A default  :  1 ; : : : ;  n = is applied in E  L if E j =  and f:  1 ; : : : ; :  n g \ Cn ( E ) = ; . This is denote d by appl (  :  1 ; : : : ;  n = ; E ) . W e abbreviate appl (  ; E ) and not appl (  ; E 0 ) b y the notation appl (  ; E ; E 0 ). Denition 5.2 (Preferredness) L et  = h D ; W i b e a default the ory and P a strict p ar- tial or der on D . L et E b e an extension of  . Then E is a P -preferred L extension of  if ther e is a strict total or der T on D such that P  T and for al l extensions E 0 of  and  2 D , appl (  ; E 0 ; E ) implies that for some  2 D ;  T  and appl ( ; E ; E 0 ) : Such a strict total or der is a  ; P -ordering for E . Our in v estigation on lexicographic prioritization in default reasoning w as motiv ated b y earlier w ork on the topic (T an & T reur, 1992; Baader & Hollunder, 1995). These denitions of priorities for default logic are pro cedural, as they are giv en as extensions of (nondeter- ministic) decision pro cedures for default logic. This pro cedural nature of prioritization is 440 Complexity of Prioritized Def a ul t Logics sensitiv e to the lengths of sequences of defaults in v olv ed in deriving certain facts: among t w o conicting defaults the one with the lo w er priorit y ma y b ecome applied solely b ecause the sequence of defaults needed for deriving its prerequisite is shorter (Brewk a & Eiter, 1998). Approac hes to prioritizing defaults that are based on lexicographic comparison (Lif- sc hitz, 1985; Brewk a, 1989; Gener & P earl, 1992; Ry an, 1992) do not exhibit that kind of b eha vior. Lexicographic comparison has prop erties that are fa v orable from the p oin t of view of kno wledge represen tation. Extensions of a default theory are p ossible in terpretations of the default theory , represen ting dieren t w a ys of resolving the conicts b et w een default rules. Priorities express the plausibilit y of dieren t w a ys of resolving the conicts, and consequen tly act as an implicit represen tation of preferences b et w een the extensions. One useful prop ert y of lexicographic comparison is that ev ery nite default theory has at least one preferred extension whenev er it has at least one Reiter extension. It do es not seem plausible that the priorities could con tain information that indicates that none of the extensions is a plausible meaning of the default theory . Another useful prop ert y is that ev ery extension of a default theory is a P -preferred L extension for a suitably c hosen P . In other w ords, the w a y priorities are used in ranking the extensions should not p er se rule out the p ossibilit y that a certain extension is preferred or that it is the unique preferred extension. A distinguishing dierence b et w een the lexicographic prioritized default logic and other w ork on priorities in default logic is that the highest priorit y default { if there is one { is applied in all preferred L extensions if there is an extension where it is applied. Preferred B and preferred BH extensions do not alw a ys apply the applicable highest priorit y defaults. Example 5.1 (Brewk a, 1994) Consider the default theory  = h D ; W i where W = f a g and D = f b : c=c; a : : c= : c; a : b=b g . Dene the relation P =  b : c c ; a : : c : c  ;  a : : c : c ; a : b b  ;  b : c c ; a : b b  : According to Denitions 4.2 and 4.3 the sets E i are as follo ws, and the unique P -preferred B and P -preferred BH extension of  is E = S i  1 Cn ( E i ). E 0 = f a g E 1 = f a; : c g E 2 = f a; : c; b g E i = E 2 for all i  3 In other w ords, initially the highest priorit y default b : c=c is not applicable, and hence the second default a : : c= : c is applied, and : c is obtained. The highest priorit y default is still not applicable, and hence the third default a : b=b is applied, and b is obtained. No w b : c=c w ere applicable if the con tradicting default a : : c= : c w ould not ha v e b een applied rst. 2 The application of the highest priorit y default { whenev er p ossible { w ould seem a useful declarativ e prop ert y for nonmonotonic reasoning with priorities. The satisfaction of this prop ert y leads to lexicographic prioritization. Also, the b eha vior of lexicographic prioritized default logic is more consisten t for default theories with normal defaults  :  = 441 Rint anen and closely related default theories with prerequisite-free normal defaults :  !  = !  . The latter defaults allo w reasoning b y con trap osition with the implications, and the former do not, but otherwise they represen t related patterns of reasoning. The logics b y Brewk a and b y Baader and Hollunder order extensions lexicographically for the latter kind of default theories, but not for the former. Denition 5.3 The c onse quenc e r elation j = L is dene d by  j = L P  if and only if the formula  is in al l P -pr eferr e d L extensions of  . Example 5.2 Let h D ; W i b e a default theory where D = f p : q =q ; p : : r = : r ; q : r =r g and W = f p g . Let P = fh p : : r = : r ; q : r =r ig b e a strict partial order on D . The default theory has t w o extensions, E 1 = Cn ( f p; q ; : r g ) where the defaults p : : r = : r and p : q =q are applied, and E 2 = Cn ( f p; q ; r g ) where p : q =q and q : r =r are applied. These extensions and all strict total orders T on D suc h that P  T are depicted b elo w. The most signican t defaults are the lo w est. The sym b ol  signies that the default is applied and  that it is not applied. E 1 E 2 p : q q   q : r r   p : : r : r   E 1 E 2 q : r r   p : q q   p : : r : r   E 1 E 2 q : r r   p : : r : r   p : q q   The extension E 1 is a P -preferred L extension b ecause the leftmost strict total order T 1 is a  ; P -ordering for E 1 : q : r =r is the only default  suc h that appl (  ; E 2 ; E 1 ), and appl ( p : : r = : r ; E 1 ; E 2 ) and p : : r = : r T 1 q : r =r . The extension E 2 is not a P -preferred L exten- sion b ecause none of the three strict total orders T 1 ; T 2 ; T 3 is a  ; P -ordering for E 2 : for all i 2 f 1 ; 2 ; 3 g , there is the default p : : r = : r suc h that appl ( p : : r = : r ; E 1 ; E 2 ) and there is no default  suc h that  T i p : : r = : r and appl (  ; E 2 ; E 1 ). 2 Lemma 5.4 L et  = h D ; W i b e a default the ory wher e D is nite, and let P b e a strict total or der on D . L et  have at le ast one extension. Then ther e is exactly one P -pr eferr e d L extension of  . Pr o of: W e sho w that there is an extension E of  suc h that P is the  ; P -ordering for E . Let  1 ; : : : ;  n b e the ordering P of D . Dene D i = f  1 ; : : : ;  i g for all i 2 f 0 ; : : : ; n g . Dene for all i 2 f 1 ; : : : ; n  1 g , X 0 = f E  Lj E is an extension of  g ; and X i +1 = ( f E 2 X i j appl (  i +1 ; E ) g if appl (  i +1 ; E ) for some E 2 X i ; X i otherwise. Induction hyp othesis : F or j 2 f 0 ; : : : ; i g , (1) the set X j is non-empt y , (2) for all E 2 X j and E 0 2 X j and  2 D j , appl (  ; E ) i appl (  ; E 0 ), and (3) for all E 2 X j and E 0 2 X 0 n X j there is  2 D j suc h that appl (  ; E ; E 0 ) and there is no  0 2 D suc h that  0 P  and appl (  0 ; E 0 ; E ). The pro ofs of b oth the base case and the inductiv e case are straigh tforw ard. The claim of the lemma is obtained from the facts established in the induction pro of as follo ws. By (1) the set X n is non-empt y . By (2) and Theorems 2.4 and 2.5 in (Reiter, 1980) 442 Complexity of Prioritized Def a ul t Logics PR OCEDURE extension( D ; W ; E ); E 0 := W ; REPEA T E 00 := E 0 ; F OR EA CH  :  1 ; : : : ;  n = 2 D DO IF h E 0 ;  i 2 CN and h E ; :  i 62 CN for all  2 f  1 ; : : : ;  n g THEN E 0 := E 0 [ f  g END UNTIL E 0 = E 00 ; IF h E ;  i 2 CN for all  2 E 0 and h E 0 ;  i 2 CN for all  2 E THEN RETURN true ELSE RETURN false END Figure 3: A pro cedure for recognizing extensions j X n j  1. Hence X n is a singleton f E g . Let E 0 b e an y extension of . Assume that there is  0 2 D suc h that appl (  0 ; E 0 ; E ). Hence E 0 6 = E and E 0 2 X 0 n X n . No w b y (3) there is  2 D n = D suc h that appl (  ; E ; E 0 ) and there is no  00 suc h that  00 P  and appl (  00 ; E 0 ; E ). Therefore not  0 P  , and b ecause P is a strict total order, it is the case that  P  0 . Because this holds for all  0 2 D and all extensions E 0 of , P is a  ; P -ordering for E . Therefore E is a P -preferred L extension of . Let E 0 b e an y extension suc h that E 6 = E 0 . No w E 2 X n and E 0 62 X n , and therefore b y (3) there is  2 D suc h that appl (  ; E ; E 0 ) and there is no  0 2 D suc h that  0 P  and appl (  0 ; E 0 ; E ). Hence E is the only P -preferred L extension of . 2 5.1 Complexit y in the General Case The language that corresp onds to the consequence relation j = of the classical prop ositional logic is denoted b y CN and is dened as the set of pairs h  ;  i 2 2 L  L suc h that  j =  . Some of the complexit y results use the pro cedure in Figure 3 that is directly based on the semiconstructiv e denition of extensions giv en in Theorem 3.2. Lemma 5.5 F or the pr o c e dur e in Figur e 3, the c al l extension( D ; W ; E ) r eturns true if and only if Cn ( E ) is an extension of the default the ory h D ; W i . Excluding the tests of memb ership in CN the pr o c e dur e runs in p olynomial time on the size of h D ; W i . Our decision pro cedure for the lexicographic prioritized default logic is based on a reduc- tion to the language ENC, whic h in turn is reducible to CN in nondeterministic p olynomial time. There are three kinds of questions ENC can answ er: is the logical closure of a set of form ulae an extension of a default theory , is a strict total order a  ; P -ordering for an extension, and is a form ula a logical consequence of a set of form ulae. The language ENC  f 0 ; 1 ; 2 g  2 D  2 L  2 L  (2 D D [ L ) is dened as the set of quin tuples  h 0 ; D ; W ; E ; T i where D is a set of defaults, W  L is a set of form ulae, and Cn ( E ) is an extension of h D ; W i , 443 Rint anen PR OCEDURE ENC( n; D ; W ; E ; T ); CASE n OF 0: IF extension( D ; W ; E ) THEN accept ELSE reject 1: guess nondeterministically a subset E 0 of conclusions of D ; E 0 := E 0 [ W ; IF not extension( D ; W ; E 0 ) or not extension( D ; W ; E ) THEN reject ELSE IF compare( E ; E 0 ; T ) = true THEN reject ELSE accept 2: IF h E ; T i 2 CN THEN accept ELSE reject otherwise: reject END PR OCEDURE applied(  :  1 ; : : : ;  n = ; E ); IF h E ;  i 2 CN and h E ; :  i 62 CN for all  2 f  1 ; : : : ;  n g THEN RETURN true ELSE RETURN false END PR OCEDURE compare( E ; E 0 ; T ); let T b e the ordering  0 T  1 T    T  n ; F OR i := 0 TO n DO IF not applied(  i ; E ) and applied(  i ; E 0 ) THEN RETURN false; IF applied(  i ; E ) and not applied(  i ; E 0 ) THEN RETURN true END RETURN true END Figure 4: A decision pro cedure for ENC  h 1 ; D ; W ; E ; T i where D is a set of defaults, W  L is a set of form ulae, E is a set of form ulae, T is a strict total order on D , and T is not a h D ; W i ; T -ordering for Cn ( E ), and  h 2 ; D ; W ; E ;  i where h E ;  i 2 CN. Lemma 5.6 ENC is T uring r e ducible to CN in nondeterministic p olynomial time. Pr o of: The language ENC is accepted b y a nondeterministic T uring mac hine giv en as the pro cedure in Figure 4. The executions of the pro cedure ha v e a p olynomial length. 2 Theorem 5.7 The c omplement of the pr oblem of testing whether a formula b elongs to al l pr eferr e d L extensions of a default the ory is T uring r e ducible to ENC in nondeterministic p olynomial time. 444 Complexity of Prioritized Def a ul t Logics PR OCEDURE co-cautious( D ; W ; P ;  ); guess nondeterministically a subset E of conclusions of D ; guess nondeterministically a strict total order T on D ; IF P 6 T THEN reject; IF h 0 ; D ; W ; E [ W ; ;i 2 ENC AND h 1 ; D ; W ; E [ W ; T i 62 ENC AND h 2 ; ; ; ; ; E [ W ;  i 62 ENC THEN accept ELSE reject END Figure 5: A decision pro cedure for prioritized cautious reasoning Pr o of: The question is answ ered b y a T uring mac hine describ ed b y the pro cedure in Figure 5. The T uring mac hine uses an oracle for the language ENC. First the mac hine guesses a candidate extension Cn ( E [ W ) of h D ; W i and a strict total order T on D that extends the relation P . Then the mac hine v eries that Cn ( E [ W ) is in fact an extension (the rst consultation of the oracle for ENC), that T is a h D ; W i ; P -ordering for Cn ( E [ W ) (the second consultation), and that  62 Cn ( E [ W ) (the third consultation.) If all these v erications succeed, the T uring mac hine accepts. Because the guesses of E and T are nondeterministic, the mac hine accepts whenev er there is an extension that con tains  and has a h D ; W i ; P -ordering. The only parts of the pro cedure that do not run in constan t time are the nondeterministic guessing of the set E , guessing of a strict total order T , and v erifying that it extends P . Because the sizes of E and T are p olynomial in h D ; W i , the n um b er of steps needed to guess them is p olynomial in h D ; W i . V erication of P  T tak es p olynomial time. 2 W e giv e an upp er and a lo w er b ound for the lo cation of the decision problem in the p oly- nomial hierarc h y . Because ENC is T uring reducible to CN in nondeterministic p olynomial time, the follo wing lemma is immediate. Lemma 5.8 The language ENC is in  p 2 . By Theorem 5.7 w e get an upp er b ound for the lo cation of the decision problem in the p olynomial hierarc h y . The result is immediate b y the denition of the p olynomial hierarc h y . Theorem 5.9 The pr oblem of whether a formula b elongs to al l pr eferr e d L extensions of a default the ory is in  p 3 . Next w e sho w that the decision problem is  p 3 -hard, thereb y obtaining a lo w er b ound on the lo cation in the p olynomial hierarc h y . This result is based on a theorem b y Kren tel (1992) that iden ties  p k -complete problems for k  1. The theorem concerns lexicographically maximal v aluations of quan tied Bo olean form ulae, and for the prex 98 it is as follo ws. Theorem 5.10 (Kren tel, 1992) The pr oblem of c omputing a given c omp onent of X 1 is  p 3 -c omplete, wher e X 1 is dene d as fol lows. 445 Rint anen Maximum 2 -quantified f ormula Instance: Bo ole an formula C [ X 1 ; X 2 ] wher e X i is an abbr eviation for an n -tuple of Bo ole an variables that c orr esp onds to a valuation of x i 1 ; : : : ; x i n . Output: L exic o gr aphic al ly maximal X 1 2 f 0 ; 1 g n that satises 9 X 1 8 X 2 ( C [ X 1 ; X 2 ] = 1) : The follo wing lemma p oin ts out a connection b et w een quan tied Bo olean form ulae with a univ ersal quan tier as the outermost quan tier and the logical consequence relation in prop ositional logic. Lemma 5.11 L et X b e a set c ontaining exactly one of x and : x for every x 2 f x 1 1 ; : : : ; x 1 n g . L et X 1 = h x 0 1 1 ; : : : ; x 0 1 n i wher e x 0 1 i = 1 if x 1 i 2 X and x 0 1 i = 0 otherwise. Then X 1 satises 8 X 2 ( C [ X 1 ; X 2 ]) if and only if X j = C [ X 1 ; X 2 ] . Pr o of: Assume that X 1 satises 8 X 2 ( C [ X 1 ; X 2 ]). Hence for the c hoice of truth v alues for x 1 1 ; : : : ; x 1 n indicated b y X 1 and an y c hoice of truth v alues for x 2 1 ; : : : ; x 2 n , C [ X 1 ; X 2 ] is true. No w let M b e an y mo del suc h that M j = X . Hence M assigns the same truth v alues to x 1 1 ; : : : ; x 1 n as X 1 . No w M j = C [ X 1 ; X 2 ], and b y the denition of logical consequence X j = C [ X 1 ; X 2 ]. Assume that X j = C [ X 1 ; X 2 ]. Hence for all mo dels M suc h that M j = X and M assigns an y truth-v alues to x 2 1 ; : : : ; x 2 n , M j = C [ X 1 ; X 2 ]. By denition of quan tied Bo olean form u- lae, for X 1 and an y X 2 the form ula C [ X 1 ; X 2 ] is true, that is, X 1 satises 8 X 2 ( C [ X 1 ; X 2 ]). 2 The pro of of the next lemma uses the same translation of quan tied Bo olean form ulae to default theories as Gottlob's pro of of  p 2 -hardness of cautious reasoning in Reiter's default logic (Gottlob, 1992). Lemma 5.12 Computing a given c omp onent of X 1 in Maximum 2 -quantified f ormula is p olynomial time many-one r e ducible to the pr oblem of testing whether a formula b elongs to al l T -pr eferr e d L extensions of a default the ory for strict total or ders T . Pr o of: W e construct a default theory  = h D ; ;i and dene a strict partial order P on D so that the k th comp onen t of X 1 is 1 if and only if  j = L P x 1 k . The v alue of a giv en comp onen t of X 1 in Maximum 2-quantified f ormula is dened only if 9 X 1 8 X 2 ( C [ X 1 ; X 2 ]) is satis- able, so assume it is. Let a b e a prop ositional v ariable that is not in f x 1 1 ; : : : ; x 1 n ; x 2 1 ; : : : ; x 2 n g . Dene D = ( : x 1 1 x 1 1 ; : : x 1 1 : x 1 1 ; : : : ; : x 1 n x 1 n ; : : x 1 n : x 1 n ; C [ X 1 ; X 2 ] : a a ) ; and P = ( C [ X 1 ; X 2 ] : a a )  D n ( C [ X 1 ; X 2 ] : a a ) ! [ ( * : x 1 i x 1 i ; : x 1 j x 1 j +      1  i < j  n ) [ ( : x 1 1 x 1 1 ; : : : ; : x 1 n x 1 n )  ( : : x 1 1 : x 1 1 ; : : : ; : : x 1 n : x 1 n ) : 446 Complexity of Prioritized Def a ul t Logics Let T b e an y strict total order on D that extends P . The sizes of the default theory h D ; ;i and the strict total order T are linearly prop ortional to the size of C [ X 1 ; X 2 ], and they can b e constructed in p olynomial time. First w e sho w that for eac h extension E of h D ; ;i that con tains a there is X 1 suc h that X 1 satises 8 X 2 ( C [ X 1 ; X 2 ]) and for all i 2 f 1 ; : : : ; n g , p i ( X 1 ) = 1 i x 1 i 2 E (the function p i selects the i th elemen t of an n -tuple.) Let E b e an extension of h D ; ;i and a 2 E . Because defaults in D are normal, E is consisten t. Hence appl ( C [ X 1 ; X 2 ]: a=a; E ) b ecause the only default where a o ccurs in the conclusion is C [ X 1 ; X 2 ]: a=a . Hence C [ X 1 ; X 2 ] 2 E ; that is, C [ X 1 ; X 2 ] is a logical consequence of the conclusions of generating defaults of E . Because a do es not o ccur in C [ X 1 ; X 2 ], X j = C [ X 1 ; X 2 ] for X = E \ f x 1 1 ; : x 1 1 ; : : : ; x 1 n ; : x 1 n g . By Lemma 5.11 X 1 , dened as p i ( X 1 ) = 1 if x 1 i 2 X and p i ( X 1 ) = 0 otherwise, satises 8 X 2 ( C [ X 1 ; X 2 ]). Then w e sho w that for eac h X 1 that satises 8 X 2 ( C [ X 1 ; X 2 ]), there is an extension E of h D ; ;i suc h that a 2 E and p i ( X 1 ) = 1 i x 1 i 2 E . Assume that X 1 satises 8 X 2 ( C [ X 1 ; X 2 ]). Let X = f x 1 i j p i ( X 1 ) = 1 ; 1  i  n g [ f: x 1 i j p i ( X 1 ) = 0 ; 1  i  n g . It is straigh tforw ard to v erify that E is an extension of h D ; ;i . Because the extension E is consisten t, appl ( C [ X 1 ; X 2 ]: a=a; E ). Because C [ X 1 ; X 2 ]: a=a is the P -least default in D , all T -preferred L extensions apply C [ X 1 ; X 2 ]: a=a . The coun terpart of the T -preferred L extension is the lexicographically maximal X 1 , and vice v ersa. This is b y the construction of T , where the defaults : x 1 1 =x 1 1 ; : : : ; : x 1 n =x 1 n are ordered as : x 1 i =x 1 i T : x 1 j =x 1 j whenev er i < j . Therefore p i ( X 1 ) = 1 for the maximal X 1 satisfying 8 X 2 ( C [ X 1 ; X 2 ]) i x 1 i b elongs to the T -preferred L extension of h D ; ;i . 2 Notice that Lemma 5.12 cannot b e reconstructed in the prioritized default logics b y Brewk a and b y Baader and Hollunder b ecause the construction is based on a highest priorit y default that b ecomes applicable only after a n um b er of lo w er priorit y defaults ha v e b een applied, and in these cases those logics do not w ork lik e the lexicographic prioritized default logic. While testing j = L T for strict total orders T is higher in the p olynomial hierarc h y than cautious reasoning in unprioritized default logic, testing j = B T and j = BH T is one lev el lo w er. Theorem 5.13 F or default the ories  = h D ; W i , strict total or ders T on D , and formulae  , the pr oblem of testing  j = L T  is  p 3 -har d. Pr o of: All problems in  p 3 are p olynomial time man y-one reducible to Maximum 2- quantified f ormula , whic h b y Lemma 5.12 is p olynomial time man y-one reducible to our problem. 2 T esting j = L T for strict total orders T is in  p 3 . The pro of of this fact is based on computing the unique preferred extensions step b y step, at eac h step determining whether there is an extension in whic h one of the defaults is applied in addition to those defaults whic h w e ha v e already committed to. Lemma 5.14 F or the pr o c e dur e in Figur e 6, the c al l exists( D ; W ; A ) r eturns true if and only if ther e is an extension E of h D ; W i such that appl (  ; E ) for al l  2 A . The pr o c e dur e runs in nondeterministic p olynomial time given an NP or acle for CN. Pr o of: First the pro cedure guesses a set of conclusions G that p ossibly are the conclusions of the generating defaults of the p ossible extension Cn ( G [ W ). The call to extension( D ; W ; E ) 447 Rint anen PR OCEDURE exists( D , W , A ); guess a subset G of conclusions of defaults in D ; E := G [ W ; IF not extension( D ; W ; E ) THEN RETURN false; F OR EA CH  :  1 ; : : : ;  n = 2 A DO IF h E ;  i 62 CN or h E ; :  i 2 CN for some  2 f  1 ; : : : ;  n g THEN RETURN false END ; RETURN true END Figure 6: A pro cedure that tests for the existence of extensions PR OCEDURE decide( D , W , T ,  ); IF not exists( D ; W ; ; ) THEN RETURN true; A := ; ; let  1 ; : : : ;  n b e the ordering T ; F OR i := 1 TO n DO IF exists( D ; W ; A [ f  i g ) THEN A := A [ f  i g END E := W [ f  j  :  = 2 A g ; IF E j =  THEN RETURN true ELSE RETURN false END Figure 7: A decision pro cedure for total priorities with E = G [ W tests if this is indeed the case (Lemma 5.5.) Next the pro cedure tests whether defaults in A are applied in Cn ( G [ W ), and returns true if and only if this is the case. Because the pro cedure represen ts a nondeterministic T uring mac hine, the pro cedure returns true if and only if it is p ossible to guess G so that Cn ( G [ W ) is an extension where mem b ers of A is applied. Hence exists ( D ; W ; A ) returns true if and only if there is an extension E of h D ; W i suc h that appl (  ; E ) for all  2 A . The pro cedure runs in non-deterministic p olynomial time and uses an NP oracle for prop ositional satisabilit y . Hence the problem solv ed b y it is in  p 2 . 2 Theorem 5.15 F or default the ories  = h D ; W i , formulae  , and strict total or ders T on D , the pr oblem of testing  j = L T  is in  p 3 . Pr o of: W e giv e a decision pro cedure for the problem that runs in deterministic p olynomial time and uses an oracle for a problem that b elongs to  p 2 . This demonstrates that the problem is in  p 3 . The pro cedure de cide is giv en in Figure 7 and the  p 2 oracle pro cedure exists is giv en in Figure 6 and its correctness is stated in Lemma 5.14. The correctness of the pro cedure de cide is as follo ws. Let h D ; W i b e a nite default theory with j D j = n , T a strict total order on D , and  a form ula. Assume that h D ; W i has no extensions. In this case the rst statemen t in the pro cedure de cide returns true whic h is correct b ecause  trivially b elongs to all extensions of h D ; W i . Assume that h D ; W i has at least one extension. The 448 Complexity of Prioritized Def a ul t Logics correctness pro of in this case pro ceeds b y induction on i 2 f 1 ; : : : ; n g . The v alue of the program v ariable A after the i th iteration is denoted b y A i . Let  1 ; : : : ;  n b e the ordering T . Because T is a strict total order on D , b y Lemma 5.4 there is exactly one T -preferred L extension E of h D ; W i . Induction hyp othesis : for all j 2 f 1 ; : : : ; i g , appl (  j ; E ) if and only if  j 2 A i . Base c ase i = 0: No w A 0 = ; and f 1 ; : : : ; i g = ; . Hence the h yp othesis is true. Inductive c ase i  1: W e analyze the v alue b returned b y exists( D ; W ; A i  1 [ f  i g ) b y cases. Assume that b = true. Hence A i = A i  1 [ f  i g . By the correctness of the pro cedure exists , there is an extension E 0 suc h that appl (  ; E 0 ) for all  2 A i  1 [ f  i g . Assume that E is not suc h an extension. Hence appl (  i ; E 0 ; E ). By induction h yp othesis appl (  j ; E ) i  j 2 A i  1 for all j 2 f 1 ; : : : ; i  1 g . No w b ecause appl (  ; E ) implies appl (  ; E 0 ) for all  T  i there are no  00 T  i suc h that appl (  00 ; E ; E 0 ). Hence E could not b e T -preferred L , and the assumption that not appl (  i ; E ) w as wrong. Assume that b = false. As there is no extension E 0 suc h that appl (  ; E 0 ) for all  2 A i  1 [ f  i g , and appl (  ; E ) for all  2 A i  1 , not appl (  i ; E ). No w A i = A i  1 , and the induction h yp othesis is fullled. This nishes the induction pro of. No w A n is the set of generating defaults of the unique T -preferred L extension E of h D ; W i . The execution of the program con tin ues at the last statemen t of the pro cedure. By Theorem 3.4 E = Cn ( W [ f  j  :  = 2 A n g ). Hence  2 E if and only if W [ f  j  :  = 2 A n g j =  . 2 Corollary 5.16 F or default the ories  = h D ; W i , strict total or ders P on D , and formulae  , the pr oblem of testing  j = L P  is  p 3 -c omplete. Pr o of: Directly b y Theorems 5.13 and 5.15. 2 F or the problem of mem b ership of form ulae all preferred extensions of a default theory without the restriction to total priorities, the mem b ership in  p 3 as w ell as its  p 3 -hardness remain op en. 5.2 Complexit y in Syn tactically Restricted Cases As in Section 4.2, w e analyze the complexit y of the consequence relation of the lexicographic prioritized default logic under syn tactic restrictions. 5.2.1 Summar y The results on the b oundary b et w een tractabilit y and in tractabilit y for j = L P with strict total orders P are summarized in T able 4. In cases where the complexit y of the lexicographic prioritized default logic diers from Reiter's default logic, the complexit y is set in b oldface. T able 5 indicates where the pro ofs of the complexit y results can b e found. The impact of priorities on the complexit y of the decision problems is strongest in the prerequisite-free normal classes. When the default rules in these classes are totally ordered, the unique preferred extensions can b e easily found b y applying the default rules in the giv en order. A more complicated p olynomial time decision pro cedure exists for Horn defaults with 1-literal ob jectiv e facts (Theorem 5.22). F or this class, the existence of an extension that applies a giv en set of defaults can b e determined in p olynomial time, and this together with the 449 Rint anen class of default theories complexit y when clauses in W are Horn 2-literal 1-literal 1 disjunction-free NP-hard NP-hard NP-hard 2 unary NP-hard NP-hard NP-hard 3 disjunction-free ordered NP-hard NP-hard NP-hard 4 ordered unary NP-hard NP-hard NP-hard 5 disjunction-free normal NP-hard NP-hard NP-hard 6 Horn NP-hard NP-hard PTIME 7 normal unary NP-hard NP-hard PTIME 8 prerequisite-free NP-hard NP-hard NP-hard 9 prerequisite-free ordered NP-hard NP-hard NP-hard 10 prerequisite-free unary NP-hard NP-hard NP-hard 11 prerequisite-free ordered unary NP-hard NP-hard NP-hard 12 prerequisite-free normal PTIME PTIME PTIME 13 prerequisite-free normal unary PTIME PTIME PTIME 14 prerequisite-free p ositiv e normal unary PTIME PTIME PTIME T able 4: Complexit y of the consequence relation j = L with total priorities class of default theories reference Horn 2-literal 1-literal 1 disjunction-free 4  4  4  2 unary 4  4  4  3 disjunction-free ordered 5  5  5  4 ordered unary C5.20 C5.20 C5.20 5 disjunction-free normal C5.18 C5.18 C5.18 6 Horn 7  7  T5.22 7 normal unary C5.20 C5.20  6 8 prerequisite-free 11  11  11  9 prerequisite-free ordered 11  11  11  10 prerequisite-free unary 11  11  11  11 prerequisite-free ordered unary C5.20 C5.20 C5.20 12 prerequisite-free normal T5.21 T5.21 T5.21 13 prerequisite-free normal unary  12  12  12 14 prerequisite-free p ositiv e normal unary  12  12  12 T able 5: References to theorems on the complexit y of j = L with total priorities step wise construction of preferred extensions giv en as the pro cedure in Figure 7 yields a fast decision pro cedure. 450 Complexity of Prioritized Def a ul t Logics 5.2.2 Intra ct able Classes with Tot al Priorities The next theorems are based on reductions from in tractable problems of bra v e reasoning in Reiter's default logic to prioritized default logic with total priorities. Theorem 5.17 L et F b e a class of formulae and C a class of nite default the ories such that  if h D ; W i 2 C , then h D [ f  : p=p g ; W i 2 C wher e  2 F and p is a pr op ositional variable that do es not o c cur in D or W , and  e ach memb er of C has at le ast one extension. The pr oblem of testing  j = b  for  2 C and  2 F is p olynomial time many-one r e ducible to the pr oblem of testing  0 j = L P p wher e  0 2 C , p is a pr op ositional variable, and P is a strict total or der on defaults in  0 . Pr o of: Let h D ; W i 2 C b e a default theory ,  2 F a form ula, and k a prop ositional v ariable that do es not o ccur in h D ; W i or  . Let P b e an y strict partial order on D [ f  : k =k g suc h that  : k =k is the P -least elemen t. W e claim that h D ; W i j = b  if and only if h D [ f  : k =k g ; W i j = L P k . This is directly b ecause the highest priorit y default is applied in all preferred L extensions if it is p ossible to apply it, and k b elongs to those extensions if and only if  b elongs to them. 2 As a corollary , together with a theorem that sho ws the in tractabilit y of bra v e reasoning of the class in Reiter's default logic (Kautz & Selman, 1991), w e obtain the follo wing result. Corollary 5.18 T esting h D ; W i j = L P l for strict total or ders P , liter als l , and disjunction- fr e e normal default the ories h D ; W i wher e W is a set of liter als, is NP-har d. Theorem 5.19 L et C b e a class of nite default the ories such that the c onclusion of e ach default is a liter al and e ach memb er of C has at le ast one extension. The pr oblem of testing  j = b l for  2 C and liter als l is p olynomial time many-one r e ducible to the pr oblem of testing  j = L T l wher e T is a strict total or der on defaults in  . Pr o of: Let  = h D ; W i b e a default theory in C . W e reduce testing  j = b l to  j = L T l as follo ws. Let D 0 b e the set of defaults with l as the conclusion. Let T b e a strict total order on D suc h that D 0  ( D n D 0 )  T . W e claim that  j = b l if and only if  j = L T l . Assume that  6j = b l . Because b y assumption there is at least one extension of , b y Lemma 5.4 there is exactly one T -preferred L extension E of . Clearly l 62 E . Therefore  6j = L T l . Assume that  j = b l . Then there is an extension E of  suc h that l 2 E . If W j = l , then clearly  j = L T l . Assume that W 6j = l . No w appl (  ; E ) for some  2 D 0 . Assume that E 0 is an extension of  suc h that l 62 E . No w appl (  ; E ; E 0 ). As  0 2 D 0 for all  0 T  and not appl (  0 ; E 0 ) for all  0 2 D 0 , there is no  0 T  suc h that appl (  0 ; E 0 ; E ). Hence E 0 is not T -preferred L . Therefore l b elongs to all T -preferred L extensions of  and  j = L T l . 2 The follo wing corollary is obtained with the in tractabilit y results of bra v e reasoning b y Kautz and Selman (1991) and Stillman (1990) for the classes men tioned. 451 Rint anen Corollary 5.20 T esting h D ; W i j = L P l for strict total or ders P and liter als l in any of the classes of default the ories b elow is NP-har d. D W normal unary Horn clauses normal unary 2-liter al clauses or der e d unary liter als pr er e quisite-fr e e or der e d unary liter als 5.2.3 Tra ct able Classes Next w e giv e a restricted tractable class of prioritized default theories for whic h the unique P -preferred L extensions can b e computed b y using P as the order in whic h the application of defaults is attempted. Exhaustiv e searc h is a v oided b ecause there is no need to retract a decision to apply a default. The theorem is giv en in a general form for an y tractable subset of classical prop ositional logic, lik e Horn clauses, 2-literal clauses, or 1-literal clauses. The theorem and the algorithm are part of the folklore of nonmonotonic reasoning. Theorem 5.21 L et F b e a class of formulae such that satisability testing for S  F takes p olynomial time in the size of S . L et C b e a class of default the ories h D ; W i such that D = f : = j  2 F g for some nite set F  F and W  F is nite. Then for  2 C ,  2 F , and strict total or ders P on the defaults in  , the pr oblem of testing  j = L P :  is solvable in p olynomial time on the size of D [ W [ f:  g . Pr o of: By Lemma 5.4 there is at most one P -preferred L extension for eac h mem b er of C , and b ecause the defaults in mem b ers of C are normal, there is at least one extension for eac h mem b er of C b y Theorem 3.1 in (Reiter, 1980). Therefore there is exactly one P -preferred L extension for eac h mem b er of C . A decision pro cedure for the class of default theories stated in the theorem is giv en in Figure 8. The pro cedure computes a set E that consists of W and the conclusions of the generating defaults of the extension Cn ( E ) of h D ; W i , and returns true if and only if E j =  . Let :  1 = 1 ; : : : ; :  n = n b e the ordering P of defaults in D . If W is inconsisten t the pro cedure returns true . In this case Cn ( W ) = L is the only extension of h D ; W i whic h agrees with the statemen t of the lemma. Otherwise extensions of h D ; W i are consisten t. Dene D i = f :  1 = 1 ; : : : ; :  i = i g and  i = f  1 ; : : : ;  i g for all i 2 f 0 ; : : : ; n g . The correctness pro of is b y induction on i and w e obtain the P -preferredness L of Cn ( E ) as the case i = n . Induction hyp othesis : for all j 2 f 0 ; : : : ; i g , if W is consisten t, E j is a maximal consisten t subset of  j [ W suc h that W  E j , and Cn ( E i ) is a P \ ( D i  D i )-preferred L extension of h D i ; W i . The induction pro of is straigh tforw ard. That the pro cedure runs in p olynomial time on the size of h D ; W i is also ob vious. Th us an y p olynomial time subset C of classical prop ositional logic pro duces a tractable class of default theories. 2 Without priorities reasoning with prerequisite-free normal default rules and Horn clauses is NP-complete (Stillman, 1990). F or normal defaults, tractabilit y can b e obtained also for defaults with prerequisites if suitable restrictions are imp osed on the prerequisites, conclu- sions, and the ob jectiv e parts of the default theories. Next w e presen t suc h a class that is neither subsumed b y nor subsumes the tractable prerequisite-free classes. The idea b ehind 452 Complexity of Prioritized Def a ul t Logics PR OCEDURE decide( D ; W ; P ;  ) LET :  1 = 1 ; :  2 = 2 ; : : : ; :  n = n b e the ordering P on D ; E 0 := W ; F OR i := 1 TO n DO IF E i  1 [ f  i g is consisten t (equiv alen tly , E i  1 6j = :  i ) THEN E i := E i  1 [ f  i g END ; E := E n ; IF E j =  THEN RETURN true ELSE RETURN false END Figure 8: A decision pro cedure for a class of prerequisite-free normal default theories the result is the same as the one used in the pro of of Theorem 5.15. Corollary 5.18 indicates that the result cannot b e generalized (assuming P 6 =NP) to an y of the classes higher in the Kautz and Selman hierarc h y . Theorem 5.22 L et C b e the class of Horn default the ories h D ; W i wher e W is a nite set of liter als and defaults in D ar e of the form p 1 ^    ^ p n : l =l wher e l is a liter al and p 1 ; : : : ; p n ar e pr op ositional variables. F or  2 C , ne gate d Horn clauses  , and strict total or ders P on the defaults in  , the pr oblem of testing  j = L P :  is solvable in p olynomial time on the size of D [ W [ f:  g . Pr o of: The b o dy of the decision pro cedure is giv en in Figure 7 and its correctness pro of is included in the pro of of Theorem 5.15. Here w e use the subpro cedure exists in Figure 9. The pro cedure exists runs in p olynomial time on the size of D [ W [ A b ecause the n um b er of iterations in the rep eat-un til lo op is at most j D 0 j  j D j and logical consequence tests with prop ositional Horn clauses can b e p erformed in p olynomial time. Next w e pro v e that the pro cedure exists called with argumen ts ( D ; W ; A ) returns true if and only if there is an extension E of  = h D ; W i suc h that A  GD ( E ; ). The correctness pro of and the algorithm are based on the idea that to deriv e the prerequisites of defaults in A , defaults in D n A with a negativ e conclusion are not needed. First w e sho w that exists returns true if and only if there is an extension E 0 of  0 = h D 0 ; W i suc h that A  GD ( E 0 ;  0 ), where D 0 = A [ f  : p=p 2 D j: p 62 W ;  0 : : p= : p 62 A; p is atomic g . If W [ f  j  :  = 2 A g is inconsisten t and A 6 = ; , then there are no extensions that apply A , and hence it is correct to return false . So assume W [ f  j  :  = 2 A g is consisten t. No w the set U = W [ f  j  :  = 2 D 0 g is consisten t b y denition of D 0 . An y extension E 0 of  0 satises E 0  Cn ( U ), and b ecause all defaults in D 0 are normal, no negation of a justication of a default in D 0 is in Cn ( U ). Therefore exactly those defaults are applied in extensions of  0 for whic h the prerequisite is deriv able. It is straigh tforw ard to sho w that the pro cedure computes the union E of W and the set of conclusions of the unique suc h set of defaults, and hence Cn ( E ) is the unique extension of  0 . Finally , the pro cedure returns false if and only if  62 E for some  :  = 2 A . This is equiv alen t to the fact that  62 GD ( E ;  0 ) for some  2 A , and hence A 6 GD ( E ;  0 ). 453 Rint anen PR OCEDURE exists( D ; W ; A ) IF A 6 = ; and W [ f  j  :  = 2 A g j = ? THEN RETURN false; D 0 := A [ f  : p=p 2 D j: p 62 W ;  0 : : p= : p 62 A; p is atomic g ; E := W ; REPEA T E 0 := E ; F OR EA CH  :  = 2 D 0 DO IF E 0 j =  THEN E := E [ f  g END UNTIL E = E 0 ; IF E 6j =  for some  :  = 2 A THEN RETURN false ELSE RETURN true END Figure 9: A subpro cedure of a decision pro cedure Then w e sho w that there is an extension E 0 of  0 suc h that A  GD ( E 0 ;  0 ) if and only if there is an extension E of  suc h that A  GD ( E ; ). The \only if " direction directly follo ws from Theorem 3.2 in (Reiter, 1980) b ecause D 0  D and D is normal. Assume that there is an extension E of  suc h that A  GD ( E ; ). It is straigh tforw ard to sho w that E is an extension of h GD ( E ; ) ; W i . Next w e remo v e defaults with negativ e conclusions that are in D but not in A : an induction pro of with Theorem 3.2 and the induction h yp othesis E 00 i = Cn ( E i \ ( f  j  :  = 2 A g [ f p j  : p=p 2 GD( E ; ) ; p is atomic g [ W )) sho ws that E 00 = Cn ( f  j  :  = 2 A g [ f p 2 E j  : p=p 2 D ; p is atomic g [ W ) is an extension of h GD ( E ; ) \ D 0 ; W i and A  GD( E 00 ; h GD ( E ; ) \ D 0 ; W i ). By Theorem 3.2 in (Reiter, 1980), there is an extension E 0 of  0 suc h that A  GD ( E 0 ;  0 ). Therefore the pro cedure returns true if and only if there is an extension E of h D ; W i suc h that A  GD ( E ; ). 2 The tractabilit y result is related to the tractabilit y of bra v e reasoning of the same class as sho wn b y Lemma 6.4 in (Kautz & Selman, 1991). 5.2.4 Resul ts f or Arbitrar y Priorities The previous section restricts to the sp ecial case where priorities are a strict total or- dering on the defaults. Ho w ev er, for instance in represen ting inheritance net w orks, t w o defaults sometimes need to ha v e an equal (or incomparable) priorit y . Hence the p ossibilit y of tractable inference with less restricted priorities is of in terest. The complexit y results for unrestricted priorities are summarized in T able 6. Lik e in earlier sections, references to theorems are giv en in T able 7. The results in the previous sections as w ell as results on the complexit y of cautious reasoning (Kautz & Selman, 1991) directly imply the in tractabilit y of man y classes of reasoning with arbitrary priorities, b ecause the former t w o are a sp ecial case of the latter. Classes of default theories for whic h the tractabilit y question remains op en are the prerequisite-free normal classes and the normal unary class with literals. F or prerequisite-free normal unary theories with 1-literal clauses reasoning is tractable, but the remaining classes are sucien tly expressiv e to enco de prop ositional satisabilit y . It 454 Complexity of Prioritized Def a ul t Logics class of default theories complexit y when clauses in W are Horn 2-literal 1-literal 1 disjunction-free co-NP-hard co-NP-hard co-NP-hard 2 unary co-NP-hard co-NP-hard co-NP-hard 3 disjunction-free ordered co-NP-hard co-NP-hard co-NP-hard 4 ordered unary co-NP-hard co-NP-hard co-NP-hard 5 disjunction-free normal co-NP-hard co-NP-hard co-NP-hard 6 Horn co-NP-hard co-NP-hard co-NP-hard 7 normal unary co-NP-hard co-NP-hard co-NP-hard 8 prerequisite-free co-NP-hard co-NP-hard co-NP-hard 9 prerequisite-free ordered co-NP-hard co-NP-hard co-NP-hard 10 prerequisite-free unary co-NP-hard co-NP-hard co-NP-hard 11 prerequisite-free ordered unary co-NP-hard co-NP-hard co-NP-hard 12 prerequisite-free normal co-NP-hard co-NP-hard co-NP-hard 13 prerequisite-free normal unary co-NP-hard co-NP-hard PTIME 14 prerequisite-free p ositiv e normal unary co-NP-hard co-NP-hard PTIME T able 6: Complexit y of the consequence relation j = L with arbitrary priorities class of default theories reference Horn 2-literal 1-literal 1 disjunction-free K&S K&S K&S 2 unary K&S K&S K&S 3 disjunction-free ordered K&S K&S K&S 4 ordered unary K&S K&S K&S 5 disjunction-free normal K&S K&S K&S 6 Horn K&S K&S K&S 7 normal unary 14  14  T5.24 8 prerequisite-free 14  14  11  9 prerequisite-free ordered 14  14  11  10 prerequisite-free unary 14  14  11  11 prerequisite-free ordered unary 14  14  T4.14 12 prerequisite-free normal 14  14  T4.13 13 prerequisite-free normal unary 14  14  T5.23 14 prerequisite-free p ositiv e normal unary T4.12 T4.12  13 T able 7: References to theorems on the complexit y of j = L with arbitrary priorities turns out that the tractabilit y of lexicographic prioritized default logic coincides with the tractabilit y of Reiter's default logic for all but one class. There ma y still b e dierences in the complexit y of the in tractable classes, for example Reiter's default logic could b e in co-NP and lexicographic prioritized default logic could b e  p 2 -hard. W e ha v e not analyzed the in tractable classes in more detail. 455 Rint anen Theorem 5.23 L et C b e the class of default the ories  = h D ; W i wher e W is a set of liter als and D c onsists of defaults of the form : l =l wher e l is a liter al. L et P b e a strict p artial or der on D and let l b e a liter al. T esting  j = L P l c an b e done in p olynomial time on the size of  and P and l . Pr o of: The algorithm in Figure 1 tests h D ; W i j = L P l . The correctness of the algorithm is as follo ws. W e analyze the if -statemen ts in sequence. In eac h case w e ma y use the negations of the assumptions of the previous cases. F or the rst four statemen ts the pro of is lik e the pro of of Theorem 4.11 as no priorities are in v olv ed. 5. Assume that : l =l P : l = l . No w : l =l T : l = l for all strict total orders T suc h that P  T . W e obtain the unique extension with the  ; P -ordering T b y the algorithm giv en in Figure 8 and pro v en correct in Theorem 5.21. Ob viously , l is in that extension, and consequen tly in all P -preferred L extensions. Hence it is correct to return true . 6. In the remaining case not : l =l P : l = l . Hence there is a strict total ordering on D suc h that P  T and : l = l T : l =l . An argumen t similar to the one in the previous case sho ws that there is a P -preferred L extension with the  ; P -ordering T that con tains l and therefore do es not con tain l . Hence it is correct to return false . Therefore the algorithm returns true if and only if l is in all P -preferred L extensions of . Clearly , the algorithm runs in p olynomial time. 2 Without priorities, cautious and bra v e reasoning for normal unary theories and 1-literal clauses is tractable (Kautz & Selman, 1991). W e sho w that priorities increase the expres- sivit y sucien tly to mak e this class in tractable. Theorem 5.24 The pr oblem of testing whether a liter al l b elongs to al l P -pr eferr e d L ex- tensions of  , wher e  is a normal unary default the ory and P is a strict p artial or der on defaults in  , is c o-NP-har d. Pr o of: The pro of is b y reduction from prop ositional satisabilit y to the complemen t of the problem. Let C = f c 1 ; : : : ; c m g b e a set of prop ositional clauses and P the set of prop ositional v ariables o ccurring in C . Let N b e an injectiv e function that maps eac h clause c 2 C to a prop ositional v ariable n = N ( c ) suc h that n 62 P . Dene the default theory  = h D ; ;i and priorities on D as in the pro of of Theorem 4.15. W e claim that the set of clauses C is satisable if and only if  6j = L P false ; that is, there is a P -preferred L extension of  that do es not con tain false . In the pro of w e refer to the consistency of extensions of h D ; W i whic h is b y the consistency of W and the fact that defaults in D ha v e justications (Corollary 2.2 b y Reiter (1980)). ( ) ) Assume that there is a mo del M suc h that M j = C . W e sho w that there is a P -preferred L extension E of  suc h that false 62 E . Let E = Cn ( f p 2 P j M j = p g [ f p 0 j p 2 P ; M 6j = p g [ f: p j p 2 P ; M 6j = p g [ f: p 0 j p 2 P ; M j = p g [ f n j c 2 C ; n = N ( c ) g [ f: n 0 j c 2 C ; n = N ( c ) g ). It is straigh tforw ard to v erify that E is an extension of h D ; ;i . Let T b e an y strict total order on D suc h that P  T and for all f  ;  0 g  D 1 and all f  ;  0 g  D 3 ,  T  0 if appl (  ; E ) and not appl (  0 ; E ). W e sho w that T is a h D ; ;i ; P -ordering for E . Let E 0 b e an y extension of h D ; ;i suc h that there is  2 D suc h that appl (  ; E 0 ; E ). W e sho w that there is  0 2 D suc h that appl (  0 ; E ; E 0 ). Assume that  2 D 1 . No w  = : l =l for some literal l and l 2 E 0 and l 2 E . Because E 0 is consisten t, l 62 E 0 . Hence appl (: l = l ; E ; E 0 ). By denition : l = l T : l =l . 456 Complexity of Prioritized Def a ul t Logics Assume that  2 D 2 and  = : p 0 =p 0 for some p 2 P . No w b y denition p 2 E and appl ( p : : p 0 = : p 0 ; E ). Because E 0 is consisten t, : p 0 62 E 0 and hence appl ( p : : p 0 = : p 0 ; E ; E 0 ). By denition p : : p 0 = : p 0 P : p 0 =p 0 . Assume that  2 D 2 and  = p : : p 0 = : p 0 for some p 2 P . Because p 2 E 0 , appl (: p=p; E 0 ). Because not appl ( p : : p 0 = : p 0 ; E ) b y denition p 62 E , and hence not appl (: p=p; E ). Hence : p 2 E and appl (: : p= : p; E ). Because E is consisten t, : p 62 E and appl (: : p= : p; E ; E 0 ). By denition : : p= : p P p : : p 0 = : p 0 . Assume that  = p : n=n . Clearly p 62 E , appl (: : p= : p; E ; E 0 ) and : : p= : p T p : n=n . Pro of for  = p 0 : n=n is similar. Assume that  = : n 0 =n 0 . Hence appl ( n : : n 0 = : n 0 ; E ; E 0 ). By denition n : : n 0 = : n 0 T : n 0 =n 0 . Pro of for  = n : : n 0 = : n 0 is similar. Assume that  = n 0 : false = false . Hence appl (: n 0 =n 0 ; E 0 ; E ) and appl (: : n 0 = : n 0 ; E ; E 0 ). By denition : : n 0 = : n 0 T n : false = false . This exhausts all  2 D . Therefore T is a h D ; ;i ; P -ordering for E and E is a P - preferred L extension of h D ; ;i . ( ( ) Assume that E is a P -preferred L extension of  suc h that false 62 E . W e sho w that there is a mo del M suc h that M j = C . Dene the mo del as M j = p i p 2 E , for all p 2 P . Let c = f l 1 ; : : : ; l n g b e an y clause in C . W e sho w that M j = c . Let n = N ( c ). Because false 62 E , not appl ( n 0 : false = false ; E ). Because : false is not in an y conclusion of a default in D , n 0 62 E . Because not appl (: n 0 =n 0 ; E ), : n 0 2 E . Hence appl ( n : : n 0 = : n 0 ; E ). Hence n 2 E . Because E is consisten t, appl ( q : n=n; E ) for some q 2 f p; p 0 g where p 2 c or : p 2 c . If q = p , then p 0 62 E b ecause of the follo wing. Assume that p 0 2 E . Let E 12 = Cn ( E \ ( P [ f: p j p 2 P g [ f p 0 j p 2 P g [ f: p 0 j p 2 P g ) nf p 0 g [ f: p 0 g ). It is easy to sho w that E 12 is an extension of h D 1 [ D 2 ; ;i . By Theorem 3.2 in (Reiter, 1980) there is an extension E 0 of h D ; ;i suc h that GD( E 12 ; h D 1 [ D 2 ; ;i )  GD ( E 0 ; h D ; ;i ). No w appl ( p : : p 0 = : p 0 ; E 0 ; E ) and there is no  2 D suc h that appl (  ; E ; E 0 ) and  T p : : p 0 = : p 0 for some strict total order T suc h that P  T . This con tradicts the P -preferredness L of E , and hence it m ust b e the case that p 0 62 E . Hence b y denition M j = p . If q = p 0 , then clearly p 0 2 E . Hence b y denition M j = : p . Therefore M j = c . Because this holds for an y clause c 2 C , M j = C . 2 6. Related W ork on Prioritized Default Reasoning Marek and T ruszczy  nski (1993) in tro duce a prioritized default logic that is similar to Brewk a's (1994) logic. The existence of preferred extensions is not guaran teed in general, but for normal defaults it is. W e b eliev e that for normal default theories, the complex- it y of the Marek and T ruszczy  nski logic coincides with the complexit y of Brewk a's logic. Delgrande and Sc haub (1997) presen t a translation from prioritized default theories to unpri- oritized default theories, so that the extensions of the resulting theories ob ey the priorities. Their translation can b e p erformed in p olynomial time. Buccafurri et al. (1998) presen t a kno wledge represen tation language that extends logic programs with priorities, classical negation, and disjunction. They claim that bra v e reasoning for their language is in general  p 2 -complete and without disjunction and classical negation it is p olynomial time. Brewk a and Eiter (1998) presen t the notion of pr eferr e d answer sets for extended logic programs. Their denition div erges from earlier w ork in that ev en with a total ordering on the rules there ma y b e more than one preferred answ er set, and preferred answ er sets 457 Rint anen do not alw a ys exists for a giv en program ev en if answ er sets do. Brewk a and Eiter sho w that testing the mem b ership of a literal in all preferred answ er sets of a program is co- NP-hard when the rules are totally ordered. Their motiv ation for in tro ducing preferred answ er sets is that earlier accoun ts of priorities in logic programs and in default logic do not fulll t w o principles iden tied b y them. Principle I is violated b y the prioritized default logics that are based on the semiconstructiv e denition of extensions (Baader & Hollunder, 1995; Brewk a, 1994; Marek & T ruszczy  nski, 1993), but not b y the lexicographic prioritized default logic discussed in Section 5. Principle I I can b e paraphrased as follo ws. Let E b e a P -preferred extension of h D ; W i and  :  = a default suc h that  62 E . Then E is a P 0 -preferred extension of h D [ f  :  = g ; W i for all P 0 suc h that P 0 \ ( D  D ) = P . Brewk a and Eiter sho w that the prioritized default logic in v estigated in Section 5 violates this principle. Ho w ev er, Principle I I is not violated b y a closely related prioritized default logic that replaces application with non-defeat (Rin tanen, 1999). A default  :  = is defe ate d in E if E j =  ^ :  . Therefore it is not in general the case that lexicographic denitions of preferredness w ould violate Principle I I. Ho w ev er, w e b eliev e that Brewk a and Eiter w ould nev ertheless nd this denition of preferred extensions coun terin tuitiv e. Example 6.1 Let D = f a : b=b; : a=a; : : a= : a g and W = f: b g . Let T b e a strict total order on D suc h that a : b=b T : a=a and : a=a T : : a= : a . The default theory h D ; W i has t w o extensions, E 1 = Cn ( f a; : b g ) and E 2 = Cn ( f: a; : b g ). The extension E 1 defeats a : b=b and : : a= : a , and E 2 defeats : a=a . Because E 1 defeats the highest priorit y default a : b=b and E 2 do es not, only E 2 is a T -preferred extension of h D ; W i . 2 W e b eliev e that in this example, Brewk a and Eiter w ould w an t E 1 to b e the only T - preferred extension b ecause the only conict is b et w een : a=a and : : a= : a , and the priorit y of : a=a is higher. It seems that the question at hand is the meaning of priorities in cases where defaults that are less directly deriv able ha v e a higher or equal priorit y . Lexicographic comparison giv es one meaning, a v ery natural one in our opinion, but Brewk a and Eiter seem to w an t to ignore the higher priorit y . Instead of addressing Brewk a and Eiter's concern b y devising new denitions of preferred extensions, it could b e addressed b y not using priorities that pro duce unin tended results. If a restriction to defaults with literal prerequisites and conclusions is made, this could b e done simply b y requiring that l : m=n P l 0 : m 0 =n 0 whenev er n = l 0 . Priorities used in translating inheritance net w orks to prioritized default logic fulll this requiremen t (Rin tanen, 1999). 7. Conclusions W e ha v e presen ted a thorough analysis of the complexit y of three v ersions of prioritized default logic, giving results that place these logics in the p olynomial hierarc h y , and analyzing the question of in tractabilit y v ersus tractabilit y for syn tactically restricted classes of default theories. The main results place the prop ositional v arian ts of three general formalizations of pri- oritized default reasoning, the logics b y Brewk a (1994) and Baader and Hollunder (1995) that are based on the semiconstructiv e denition of extensions, and a formalization that is based on lexicographic comparison, on the lo w er lev els of the p olynomial hierarc h y . As the rst t w o formalizations closely resem ble eac h other, it is not surprising that p olynomial time 458 Complexity of Prioritized Def a ul t Logics translations b et w een the decision problems of these t w o formalizations exist. There are also p olynomial time translations to and from Reiter's default logic. The third formalization, that uses lexicographic comparison to select the preferred extensions, is not reducible to Reiter's default logic in p olynomial time (under the standard complexit y-theoretic assump- tions.) An analysis of the complexit y of the decision problems in syn tactically restricted cases, follo wing earlier w ork b y Kautz and Selman (1991) and Stillman (1990), iden ties the eect of priorities on the b oundary b et w een tractabilit y and in tractabilit y in the prioritized v er- sions of the decision problems. With priorities that totally order the defaults and classical prop ositional reasoning that is tractable, for example with Horn clauses or 2-literal clauses, reasoning in Brewk a's and in Baader and Hollunder's logics is p olynomial time. F or the formalization of prioritized default reasoning that uses lexicographic comparison, the same assumptions yield tractable reasoning only for the so-called Horn defaults and bac kground theories without disjunction, as w ell as normal defaults without prerequisites and disjunc- tion. When arbitrary priorities are allo w ed, in all three logics reasoning is tractable only when defaults are of the form : l =l for literals l and the bac kground theories are sets of literals. Ac kno wledgemen ts This researc h w as mainly carried out at the Helsinki Univ ersit y of T ec hnology and nished at the Univ ersit y of Ulm while funded b y the SFB 527 of the Deutsc he F orsc h ungsgemeinsc haft. W e gratefully ac kno wledge the generous supp ort of the Finnish Cultural F oundation and the Finnish Academ y of Science and Letters that help ed completing this w ork. W e thank the four anon ymous review ers for p oin ting out some errors and for advice on restructuring the article and on including references to related w ork in Section 6. Holger Pfeifer pro vided v aluable assistance in pro of-reading. References Baader, F., & Hollunder, B. (1995). Priorities on defaults with prerequisites, and their application in treating sp ecicit y in terminological default logic. Journal of A utomate d R e asoning , 15 (1), 41{68. Balc azar, J. L., D  az, I., & Gabarr o, J. (1995). Structur al Complexity I . Springer-V erlag, Berlin. Ben-Eliy ah u, R., & Dec h ter, R. (1996). Default reasoning using classical logic. A rticial Intel ligenc e , 84 (1-2), 113{150. Brewk a, G. (1989). Preferred subtheories: an extended logical framew ork for default rea- soning. In Pr o c e e dings of the 11th International Joint Confer enc e on A rticial Intel- ligenc e , pp. 1043{1048 Detroit. Morgan Kaufmann Publishers. Brewk a, G. (1994). Adding priorities and sp ecicit y to default logic. In MacNish, C., P earce, D., & Moniz P ereira, L. (Eds.), L o gic in A rticial Intel ligenc e: Pr o c e e dings of the 4th 459 Rint anen Eur op e an Workshop JELIA'94 , No. 838 in Lecture Notes in Articial In telligence, pp. 247{260 Y ork, England. Springer-V erlag. Brewk a, G., & Eiter, T. (1998). Preferred answ er sets for extended logic programs. In Cohn, A. G., Sc h ub ert, L. K., & Shapiro, S. C. (Eds.), Principles of Know le dge R epr esentation and R e asoning: Pr o c e e dings of the Sixth International Confer enc e (KR '98) , pp. 86{97 T ren to, Italy . Morgan Kaufmann Publishers. Buccafurri, F., Leone, N., & Rullo, P . (1998). Disjunctiv e ordered logic: seman tics and expressiv eness. In Cohn, A. G., Sc h ub ert, L. K., & Shapiro, S. C. (Eds.), Principles of Know le dge R epr esentation and R e asoning: Pr o c e e dings of the Sixth International Confer enc e (KR '98) , pp. 418{429 T ren to, Italy . Morgan Kaufmann Publishers. Delgrande, J. P ., & Sc haub, T. H. (1997). Compiling reasoning with and ab out prefer- ences in to default logic. In Pr o c e e dings of the 15th International Joint Confer enc e on A rticial Intel ligenc e , pp. 168{174 Nago y a, Japan. Morgan Kaufmann Publishers. Do wling, W. F., & Gallier, J. H. (1984). Linear-time algorithms for testing the satisabilit y of prop ositional Horn form ulae. Journal of L o gic Pr o gr amming , 1 (3), 267{284. Etherington, D. W. (1987). F ormalizing nonmonotonic reasoning systems. A rticial Intel- ligenc e , 31 (1), 41{85. Errata in v olume 34 (3), page 395. Ev en, S., Itai, A., & Shamir, A. (1976). On the complexit y of timetable and m ulti- commo dit y o w problems. SIAM Journal of Computing , 5 (4), 691{703. Gener, H., & P earl, J. (1992). Conditional en tailmen t: bridging t w o approac hes to default reasoning. A rticial Intel ligenc e , 53 (2-3), 209{244. Gottlob, G. (1992). Complexit y results for nonmonotonic logics. Journal of L o gic and Computation , 2 (3), 397{425. Hort y , J. F. (1994). Some direct theories of nonmonotonic inheritance. In Gabba y , D. M., Hogger, C. J., & Robinson, J. A. (Eds.), Handb o ok of L o gic in A rticial Intel ligenc e and L o gic Pr o gr amming: Nonmonotonic R e asoning and Unc ertain R e asoning , V ol. 3, pp. 111{187. Clarendon Press, Oxford. Kautz, H., & Selman, B. (1991). Hard problems for simple default theories. A rticial Intel ligenc e , 49 (1-3), 243{279. Kren tel, M. W. (1992). Generalizations of Opt P to the p olynomial hierarc h y . The or etic al Computer Scienc e , 97 (2), 183{198. Lifsc hitz, V. (1985). Computing circumscription. In Joshi, A. (Ed.), Pr o c e e dings of the 9th International Joint Confer enc e on A rticial Intel ligenc e , pp. 121{127 Los Angeles. Morgan Kaufmann Publishers. Marek, V. W., & T ruszczy  nski, M. (1993). Nonmonotonic L o gic: Context-Dep endent R e a- soning . Springer-V erlag, Berlin. 460 Complexity of Prioritized Def a ul t Logics McCarth y , J. (1980). Circumscription { a form of non-monotonic reasoning. A rticial Intel ligenc e , 13 (1-2), 27{39. Mo ore, R. C. (1985). Seman tical considerations on nonmonotonic logic. A rticial Intel li- genc e , 25 (1), 75{94. Niemel a, I., & Simons, P . (1996). Ecien t implemen tation of the w ell-founded and stable mo del seman tics. In Maher, M. (Ed.), Pr o c e e dings of the 1996 Joint International Confer enc e and Symp osium on L o gic Pr o gr amming , pp. 289{303 Bonn, German y . The MIT Press. Reiter, R. (1980). A logic for default reasoning. A rticial Intel ligenc e , 13 (1-2), 81{132. Rin tanen, J. (1994). Prioritized auto epistemic logic. In MacNish, C., P earce, D., & Mo- niz P ereira, L. (Eds.), L o gic in A rticial Intel ligenc e: Pr o c e e dings of the 4th Eur op e an Workshop JELIA'94 , No. 838 in Lecture Notes in Articial In telligence, pp. 232{246 Y ork, England. Springer-V erlag. Rin tanen, J. (1999). Lexicographic priorities in default logic. A rticial Intel ligenc e , 106 (2), 221{265. Ry an, M. (1992). Represen ting defaults as sen tences with reduced priorit y . In Neb el, B., Ric h, C., & Sw artout, W. (Eds.), Pr o c e e dings of the 3r d International Confer enc e on Principles of Know le dge R epr esentation and R e asoning , pp. 649{660 Cam bridge, Massac h usetts. Morgan Kaufmann Publishers. Stillman, J. (1990). It is not m y default: the complexit y of reasoning in default logic. In Pr o c e e dings of the 8th National Confer enc e on A rticial Intel ligenc e , pp. 571{578 Boston, Massac h usetts. Morgan Kaufmann Publishers. T an, Y. H., & T reur, J. (1992). Constructiv e default logic and the con trol of defeasible reasoning. In Neumann, B. (Ed.), Pr o c e e dings of the 10th Eur op e an Confer enc e on A rticial Intel ligenc e , pp. 299{303 Vienna. John Wiley & Sons. 461

Original Paper

Loading high-quality paper...

Comments & Academic Discussion

Loading comments...

Leave a Comment