Guarded resolution for answer set programming

We describe a variant of resolution rule of proof and show that it is complete for stable semantics of logic programs. We show applications of this result.

Authors: V. W. Marek, J. B. Remmel

Under c onsider ation for public ation in The ory and Pr actic e of Lo gic Pr o gr amming 1 Guar de d r esolution for A nswer Set Pr o gr amming V.W. Marek Dep artment of Computer Scienc e, University of Kentucky, L exington, KY 40506 ( e-mail: marek@cs.uky .edu ) J.B. Remmel Dep artments of M athematics and Computer Scienc e, University of California at San Die go, L a Jol la, CA 92903 ( e-mail: jremmel@uc sd.edu ) ∗ submitte d 24 April 2009 ; r evise d 15 Novemb er 2009; ac c epte d 1 January 2010 Abstract W e in vestigate a pro of system based on a guar de d r esolution rule and sho w its adequ acy for stable seman tics of normal logic programs. As a consequence, we show that Gelfond- Lifsc hitz op erator can b e viewe d as a p roof-theoretic concept. As an application, w e find a propositional theory E P whose models are precisely stable mod els of programs. W e also fi nd a class of prop ositional th eories C P with t h e follo wing prop erties. Prop ositional mod els of theories in C P are precisely stable models of P , and the th eories in C T are of the size linear in the size of P . KEYWORDS : Guarded Resolution, Proof-theory for An swer Set Programming 1 In tro duction In this note, we introduce a rule of pro of, called guar de d unit r esolution . Guarded unit resolution is a genera lization of a sp ecial case of the resolution r ule of pro of, namely , p ositive unit re solut ion . In po sitive unit reso lution, one of the inputs is a n atom unit clause. Positive unit r esolution is co mplete for Hor n cla us es, sp ecifically , given a consistent Horn theory T and an atom p , the atom p be longs to the lea st mo del of T , lm ( T ) , if and only if there is a p ositive unit resolution pro of of p fro m T (Dowling and Gallier 198 4). The mo dification we intro duce in this note conce r ns guar de d atoms and guar de d Horn clauses . Guarded atoms a re str ing s of the for m: p : { r 1 , . . . , r m } where p, r 1 , . . . , r m are pr op ositional a toms. Guar de d Hor n clauses are str ings of the form p ← q 1 , . . . , q n : { r 1 , . . . , r m } aga in with p, q 1 , . . . , q n , r 1 , . . . , r m prop ositiona l atoms. These gua rded ato ms and guarded rules will b e used to obtain a c har acterizatio n ∗ Partially supported by NSF gr an t DMS 0654060. 2 V.W. Mar ek and J .B. R emmel of stable mo dels of norma l logic progra ms. There are many c hara cterizations of sta- ble models of logic programs. In fact, in (Lifsc hitz 2 008), Lifschitz lists t welve differ- ent characterizations of stable mo dels of logic pro grams. The c har acteriza tion of sta- ble mo dels that w e present in this pap er has a distinctly pro o f-theo retic flav or and makes easy to prov e some basic r esults on Answ er Set Pro gramming such a s F ages’ Theorem (F ages 1 994), E rdem-Lifschitz Theorem (Erdem and Lifschitz 2003), and Dung’s Theorem (Dung and Kanchansut 19 89). It should b e observed that in (Dung and Kanchansut 1 989) Dung a nd K anchan- sut cons ider so- called quas i-interpretations whic h, in the formalism of our pap er, can b e viewed as collections of gua rded a toms. The difference be t ween our appro ach and that of (Dung a nd Ka nchansut 1989) is that w e elucidate the pro of theoretic conten t of the Gelfond-Lifsch itz o p erator and show ho w this technique allows for uniform pro of of v arious results in the theory of stable mo dels of pr ogra ms . The outline of this paper is as follows. Fir st, w e int r o duce the definition of the guarded reso lution rule of pro of and then derive its connections with the Gelfond- Lifschitz op erator (Gelfond and Lifschitz 19 88). Once we do this, w e will obtain the desired lifting of the cla ssical re s ult on the co mpleteness o f p ositive unit reso lution for Hor n theories (Dowling and Gallier 198 4) to the context o f the stable semantics of logic progr a ms. In Se c tion 3, we s how how gua r ded resolution pro ofs c a n b e used to prov e v ario us standard results in the theory of stable mo dels o f prop ositiona l progra ms. Finally , in Sectio n 4, we show how the theory develop ed in this paper can be used to o btain an algo rithm fo r computation of s ta ble mo dels that do es not use lo op formulas and runs in p olynomia l space in the size of the prog ram. 2 Guarded resolution and Stable Semantics By a lo gic pr o gr am clause , we mean a string of the form C = p ← q 1 , . . . , , q n , not r 1 , . . . , not r m . (1) A progra m P is a set of logic progr am cla us es. W e will interpret prog ram clause C given in (1) as a gua r ded Horn clause: g ( C ) = p ← q 1 , . . . , , q n : { r 1 , . . . , r m } . W e define g ( P ) = { g ( C ) : C ∈ P } . Observe that when we interpret a logic pro gram clause as a guarded Horn cla use, the p olar ity o f atoms app earing negatively in the bo dy of the pr ogra mming cla use changes in its repres ent a tio n as the g uarded Horn clause. That is , they o ccurr ed ne gatively in the bo dy of cla us e and they now app ear p ositively in the g uard. By conv ent ion, we think of a pr op ositional atom as a guarded atom with an empty gua rd. W e now in tro duce our guarded resolutio n rule a s follows. It has t wo a rguments: the first is a guarde d Hor n clause a nd the seco nd is a guarded atom q : { r 1 , . . . , r n } . The guar ded atom q m ust o ccur in the b o dy of the gua rded Horn clause. The result of the applicatio n of the rule is a g uarded Hor n cla use w ho se b o dy is the b o dy of the orig inal guar ded Hor n cla us e minus the atom q . The guard of the r esulting guarded Horn clause is the unio n of the guar d of the guarded atom a nd the guar d Guar de d r esolution fo r Answer Set Pr o gr amming 3 of the o riginal guar ded Horn clause. F ormally , our guarded resolution rule has the following form: p ← q 1 , . . . , , q n : { r 1 , . . . , r m } q j : { s 1 , . . . , s h } p ← q 1 , . . . , q j − 1 , q j +1 , . . . , q n : { r 1 , . . . , r m , s 1 , . . . , s h } . Next, we dis cuss the Gelfond-Lifschitz oper ator asso ciated with a normal pro p o- sitional pro gram. Given a set of atoms M and a normal lo g ic prog ram P , w e fir st define the Gelfond-Lifsc hitz reduct P M of P . P M is constructed according to the following tw o step pro cess. First, if C = p ← q 1 , . . . , , q n , not r 1 , . . . , not r m is a clause in P and r j ∈ M for some 1 ≤ j ≤ m , then w e e limina te C . Second, if C is not eliminated after step 1, then we replace C b y p ← q 1 , . . . , q n . Clearly , P M is a Horn progra m. Thus P M has a least model N M . The Ge lfo nd- Lifschitz op erator assig ns to M the set of atoms N M . Our guarded unit resolution rule natura lly leads to the no tio n of a g uarded re s - olution pro of P o f a gua rded atom p : S from the prog ram P . Here S is a, p os s ibly empt y , set of atoms. That is, a gua rded resolution pro o f of p : S is a lab eled tree such that every node tha t is not a leaf has t wo par ents, one lab eled with a guarded Horn clause and the other la b ele d with a guar ded ato m, where the lab el of the no de is the result of executing the g ua rded unit resolution r ule on the lab els of the par- ent s. Eac h lea f is either a guarded Hor n clause p ← q 1 , . . . , , q n : { r 1 , . . . , r m } s uch that p ← q 1 , . . . , , q n , not r 1 , . . . , not r m is in P or a guar ded atom q : { r 1 , . . . , r m } such that q ← not r 1 , . . . , not r m is in P . In the sp ecial case where the tree con- sist o f a single no de, we ass ume that the no de is la be le d with a guarded atom q : { r 1 , . . . , r m } where q ← not r 1 , . . . , not r m is in P . Note that in a guarded resolution pr o of, gua rds only gr ow as we pro ceed down the tree. That is , as we resolve, the guards a r e summed up. F or this r eason, the guard of the ro ot of the pro of contains the guar ds of every la b el in the tre e. W e sa y that a set of atoms M admits a guarded a tom p : S , if M ∩ S = ∅ and that M admits a guarded resolution pro of P if it admits the lab el o f the ro ot of P . The following statement follows fr om the co ntainmen t prop er ties of guards in a guarded resolution pro of. L emma 2.1 If M admits the gua r ded r esolution pro of P , then M admits every guarded atom o ccurring as a la b e l in P and M is disjoint from the guard o f every guarded clause in P . W e then hav e the following prop osition. Pr op osition 2.1 Let P be a pro p ositional logic pro gram a nd let M b e a set of a toms. Then GL P ( M ) consists exactly of atoms p such that there exists a set of a to ms Z where the guarded 4 V.W. Mar ek and J .B. R emmel atom p : Z is the conclusion of a g uarded resolution proo f P from g ( P ) admitted by M . Pro of: Let Q = P M and assume that p ∈ GL P ( M ). Then by definition, p ∈ T ω Q where T Q is the s tandard one-step prov ability op erator for Q . W e cla im that we can prove by induction on n ∈ N that whenever p ∈ T n Q , then there exists a set of atoms Z such that p : Z pos sesses a guarded reso lutio n pro of fro m g ( P ) admitted by M . If n = 1, then it must b e the case that the p ← b elong s to Q . B ut then, for some r 1 , . . . , r m , p ← n ot r 1 , . . . , not r m belo ngs to P and { r 1 , . . . , r m } ∩ M = ∅ . Therefore the guarded atom p : { r 1 , . . . , r m } is admitted by M and it poss e s ses a gua r ded r esolution proo f from g ( P ), namely , the one that co nsists of the ro ot la b eled by p : { r 1 , . . . , r m } . Now, let us a ssume p ∈ T n +1 Q . Then ther e is a c lause C = p ← q 1 , . . . , q s in Q suc h that q i ∈ T n Q for i = 1 , . . . , s . Thus b y induction, there are sets of atoms S i , 1 ≤ i ≤ n , such that q i : S i po ssesses a guarded resolution pro of from g ( P ) a dmitted by M . As p ← q 1 , . . . , q n belo ngs to Q , there must exis t atoms r 1 , . . . , r m / ∈ M such that p ← q 1 , . . . , q n , not r 1 , . . . , not r m is a clause in P . It is ea s y to com bine the guarded r esolution pro o fs of q i : S i , 1 ≤ i ≤ n and the guarded clause p ← q 1 , . . . , q n : { r 1 , . . . , r m } to obtain a guarded resolution pro of from g ( P ) of the fo llowing guarded atom: p : S 1 ∪ . . . ∪ S n ∪ { r 1 , . . . , r m } . As all the sets o ccurr ing in the guard of this guarded ato m are disjoint from M , the resulting guarde d resolution pro o f is a dmitted by M . This shows the inclusion ⊆ . Conv ersely , suppo s e p : S has a guarded r esolution pr o of P fro m g ( P ) admitted by M . By the lemma, all the guards occur ring in P are disjoin t from M . W e can then prov e by induction on the height of the tree P that p ∈ GL P ( M ). If the height of P is 0, then it m ust b e the cas e that p ← n ot r 1 , . . . , not r m belo ngs to P where S = { r 1 , . . . , r m } . But since M ∩ S = ∅ , the c lause p ← be lo ngs to Q . Hence p ∈ GL P ( M ). Now, for the inductive step, a ssume that whenever q : S has a gua rded re s olution pro of from g ( P ) that is admitted by M of height less than or equa l to n , then q ∈ GL P ( M ). W e now sho w that the same prop er t y holds for all gua rded atoms p : U which hav e a guarded reso lution pr o of from G ( P ) that is admitted by M of the height n + 1. What do es such a guarded res olution pro of lo ok lik e? Firs t the ro ot m ust b e the r esult of a guarded unit reso lution of the f o r m p ← q : Z 1 q : S 0 p : Z 1 ∪ S 0 . As ( Z 1 ∪ S 0 ) ∩ M = ∅ , Z 1 ∩ M = ∅ and S 0 ∩ M = ∅ . No w, q : S 0 has a guarded Guar de d r esolution fo r Answer Set Pr o gr amming 5 resolution pro of from g ( P ) that is admitted by M of height at most n and, hence, q ∈ GL P ( M ) b y our inductive as sumption. Since as we pro gress do wn the pro of tree, the b o dy of g uarded clauses only get smaller and the gua rds of guarded cla uses only get bigger, there must exist a path s tarting at the guarded clause p ← q : Z 1 which consists of guarded clauses of the form p ← q , q 1 , . . . , q t : Z t +1 . . . p ← q , q 1 : Z 2 p ← q : Z 1 where Z t +1 ⊆ Z t ⊆ · · · ⊆ Z 1 and for each i , there is a no de in the tree of the form q i : S i such that the resolution of p ← q , q 1 , . . . , q i : Z i +1 and q i : S i results in the clause p ← q , q 1 , . . . , q i − 1 : Z i . Now each q i : S i is the roo t of a guarded resolutio n pro of from g ( P ) that is admitted by M of heig ht less than or equal to n and, hence, q i is in GL P ( M ) for i = 1 , . . . , t . Since p ← q , q 1 , . . . , q p : Z t +1 is a leaf, there must b e a clause p ← q , q 1 , . . . , q t , not r 1 , . . . , not r m in P where Z t +1 = { r 1 , . . . , r m } . Since M admits the pr o of tree, it must b e the case that { r 1 , . . . , r m } ∩ M = ∅ and, hence , p ← q , q 1 , . . . , q t is in Q . But then, since q , q 1 , . . . , q t are in GL P ( M ), it follows that p ∈ GL P ( M ).  Prop os itio n 2.1 tells us that the Gelfond- Lifschitz op er ator GL is, essentially , a pro of-theor etic cons tr uct. Here is one cons equence, this time a semantic one. Cor ol lary 2.1 Let P b e a prop ositio nal logic progr am and let M b e a set o f atoms. Then M is a stable mo del of P if and only if 1. for every p ∈ M , there is a set of atoms S such that there is a g uarded resolution pro o f o f p : S from g ( P ) admitted by M and 2. for every p / ∈ M , there is no set o f ato ms S such that there is a gua r ded resolution pro o f o f p : S from g ( P ) admitted by M . When P is a Horn pr ogra m Co rollar y 2 .1 r educes to the cla ssical fact (Dowling and Ga llier 1 984) that the elements of the le a st mo del of the Horn pr o grams ar e precis ely thos e that can be pro ved out of clausal repr esentation o f P using p o sitive unit reso lution. Given a finite set of atoms S , w e wr ite ¬ S for the conjunction V q ∈ S ¬ q . Nex t, let us call S suc h that p : S has a guar ded resolution pro of from g ( P ) a supp ort o f p w ith resp ect to P . W e can then form an e quation for p with resp ect to P , e q P ( p ), as follows: p ⇔ ( ¬ S 1 ∨ ¬ S 2 ∨ . . . ) where S 1 , S 2 , . . . is the list of a ll supp orts of p with resp ect to P . If the only supp o rt of p is the empt y set, then we let e q P ( p ) = p a nd if there are no supp or ts for p , then we let e q P ( p ) = ¬ p . Next, let E P be the pr o p ositional theory consisting of e q P ( p ) for all p ∈ At . W e then hav e the follo wing theorem resembling Clark’s completion theorem, except we get it for stable mo dels, no t supp orted mo dels. 6 V.W. Mar ek and J .B. R emmel Pr op osition 2.2 Let P b e a prop o sitional progr am and let M be a set of ato ms. Then M is a stable mo del of P if and only if M | = E P . Pro of: Fir s t, ass ume tha t M is a stable mo del of P . Then if p ∈ M , it follows from Corollar y 2.1 that there is a n S s uch that p : S has a g uarded reso lution pro of admitted by M . Hence M ∩ S = ∅ and M | = ¬ S . Th us M sa tisfies bo th p and one of the disjuncts on the right-hand side of e q P ( p ). Hence M | = e q P ( p ). Next assume that p / ∈ M . Then there is no Z suc h that p : Z has a guarded resolution pro of admitted b y M . It follows tha t either e q P ( p ) e quals ¬ p or M satisfies b oth negatio n of p and of the negatio n of ev ery disjunct o n the right-hand-side of e q P ( p ). Thus again M | = e q P ( p ). This shows “if ” part of the theor em. F or the other dir ection, suppos e that M | = e q P ( p ). Then if p ∈ M , either e q P ( p ) = p o r e q P ( p ) = p ⇔ ( ¬ S 1 ∨ ¬ S 2 ∨ . . . ). In the former case, this means that the tr e e co nsisting of a s ingle node p : ∅ is a guarded resolution pro of and, hence, p ← is a c lause in P . Thus p must b e in M . In the latter case, there must b e some S i such that M | = ¬ S i . But b y definition, p : S i is the roo t of s ome g uarded resolution pro o f P for g ( P ) and since every g uard in such a guarded r esolution pro of is contained in S i , it must b e the case that M admits P . But then we hav e shown that p ∈ GL P ( M ). Thu s M ⊆ GL P ( M ). On the other hand, if p / ∈ M , then either e q P ( p ) = ¬ p o r e q P ( p ) = p ⇔ ( ¬ S 1 ∨ ¬ S 2 ∨ . . . ). In the former c a se, there must b e be no guar ded resolution pro ofs o f p and, hence, p is not in M . In the latter ca se, it m ust b e that M do es not satisfy any ¬ S i . This means that there is no guarded res olution pro of fro m g ( P ) who s e ro ot is of the form p : S such that M a dmits p and, hence, p / ∈ GL M ( P ). This implies GL P ( M ) ⊆ M and, hence, GL p ( M ) = M . Thus M is a stable mo del of P .  If we lo ok carefully at the structure o f any resolution pro of tree of a guarded atom p : S , w e see that S collects a set a toms which guarantee that p ∈ N M whenever M ∩ S = ∅ . Th us in defining e q P ( p ), w e essen tially unfold the atoms in S to conjunctions of negated atoms ¬ S (cf. (Brass and Dix 1999)). W e observe that, in princ iple, when the progr am P is infinite, the theory E P may be infinitary . Sp ecifically , the formulas e q P ( p ) may b e infinitar y formulas, since the disjunction on the right-hand-side of the equiv alence may b e over an infinite set of finite conjunctions. But the seman tics for infinite pro p ositional logic is well- known (K arp 1964) and can b e a pplied here. The author s studied the nec e ssary and sufficient conditions for E P to b e finitary in (Mar ek and Remmel 20 10). 3 Some applications In this s e c tion w e will use the r e sults of Section 2 to derive the result of Erdem and Lifschitz (Er dem and Lifschitz 20 03). This result gener alizes a theorem by F age s (F ages 1994) which is us e ful a s a prepro cess ing step for the co mputation o f stable mo dels o f prog rams. W e w ill also prov e a result of Dung (Dung and Kanchansut 1989) on stable mode ls of purely nega tive programs . W e say that a set of atoms M has level s with r esp ect to a progr am P if Guar de d r esolution fo r Answer Set Pr o gr amming 7 1. M is a mo del of P , and 2. Ther e is a function rk : M → Or d such that, for every p ∈ M , there is a clause C suc h that (a) p = he ad ( C ), (b) M | = b o dy ( C ), and (c) F or all q ∈ p osBo dy ( C ), rk ( q ) < rk ( p ). Clearly , the least mo del of a Horn program has levels since the function which assigns to an atom p ∈ M , the lea st in teger n such that p ∈ T n P ( ∅ ) is the desired rank function for condition (2). W e now prov e the following prop osition. Pr op osition 3.1 Let P b e a prop ositional logic program a nd M ⊆ At . Then M is a sta ble mo del of P if a nd only if M has levels with r esp ect to P . Pro of: Clearly , when M is a stable mo del o f P , then M has levels with r esp ect to P . Namely , the rank function whose existence is po stulated in (2) is the rank function inherited from the Horn prog ram P M . Conv erse implication can b e prov ed in a v ar iety of wa ys. O ur pro of, in the spirit of the pro of-theoretic approach of this pape r , uses guarded resolution. That is, assume that M ha s levels with resp ect to P where rk is the ra nk function in condition (2). Our goal is to prove that M = GL P ( M ). First, let us observe that since M | = P , GL P ( M ) ⊆ M . Thus, a ll we need to show is that M ⊆ GL P ( M ). By Corollar y 2.1, we need o nly show that for given a ny p ∈ M , there is a Z such that p : Z p osses ses a guarded resolution proo f from g ( P ) that is admitted b y M . W e construct the desired set Z and guarded re solution pro of by using the r ank function rk . Let S = { rk ( p ) : p ∈ M } , i.e. S is the range of rank function. W e pr o ceed b y transfinite induction on the elemen ts of S . Let p b e an atom in M s uch that rk ( p ) is the least element of S . By assumption, ther e m ust exist a cla use C in P such that M | = b o dy ( C ), p = he ad ( C ) and for all q ∈ p osBo dy ( C ), rk ( q ) < rk ( p ). Since M | = b o dy ( C ), there can be no q ’s in p o sitive part of the b o dy of C b eca use an y such q m ust b e in M a nd hav e r ank strictly less tha n p . Th us the clause C has the following form: p ← n ot r 1 , . . . not r m . As M | = b o dy ( C ), r 1 , . . . , r m / ∈ M . But then p : { r 1 , . . . , r m } is a g uarded atom admitted b y M and so p : { r 1 , . . . , r m } has a guarded r esolution pro of from g ( P ) which consists of a single no de lab eled with p : { r 1 , . . . , r m } . Now, assume that whenever β ∈ S , β < α , a nd rk ( q ) = β , then ther e is a gua rded resolution pr o of of q : S fr o m g ( P ) admitted b y M for some set S . Let us assume that p ∈ M a nd rk ( p ) = α . By our ass umption, ther e is a clause C p ← q 1 , . . . , q n , not r 1 , . . . not r m with M | = b o dy ( C ) and rk ( q 1 ) < rk ( p ) , . . . , rk ( q n ) < rk ( p ). By inductiv e assump- tion, for every q i , 1 ≤ i ≤ n , there is a finite s et of atoms Z i such that there is 8 V.W. Mar ek and J .B. R emmel guarded r esolution pro o f D i from g ( P ) of q i : Z i admitted by M . In pa r ticular Z i ∩ M = ∅ . W e can then easily com bine the guarded resolution pr o ofs for q i : Z i with n applications of guarded unit reso lutio n starting with the lea f p ← q 1 , . . . , q n : { r 1 , . . . , r m } to pro duce a guarded resolutio n pro of of p : Z from g ( P ) where Z = Z 1 ∪ . . . ∪ Z n ∪ { r 1 , . . . , r n } . Since all Z i s are disjoint from M and M ∩ { r 1 , . . . , r m } = ∅ , it follows tha t M ∩ Z = ∅ . Thus the resulting r esolution pro of is admitted by M . This completes the inductive arg ument and thus the pr o of of the Prop ositio n.  W e observe that, in fact, it is sufficient to limit the functions rk in the definition of M having levels resp ect to P to those ra nk functions that tak e v alues in N , the set of natural num ber s. W e g e t, as promised, several coro llaries. O ne of these is the r esult of Erdem and Lifsc hitz (Erdem and Lifsc hitz 20 03). F ollowing (Erdem and Lifschitz 2 003), we say that a program P is t ight on a set of atoms M if there is a rank func- tion rk defined on M suc h that whenever C is a cla use in P a nd he ad ( C ) ∈ M , then for all q ∈ p osBo dy ( C ), rk ( q ) < rk ( he ad ( C )) . Here is the result of E rdem a nd Lifschitz. Cor ol lary 3.1 ( Er dem and Lifschitz ) If P is tigh t o n M and M is a supported mo del of P , then M is a sta ble mo del of P . Pro of: Indeed, tightness on M r equires that for any p ∈ M , there is a suppo r t for p and that al l clauses C that pr ovide the supp ort for the presence of p in M hav e the prop erty that the ato ms in the positive part of the bo dy of C have smaller rank. In Pr o p osition 3.1, we show ed that it is enough to hav e just o ne such clause. Since tightn ess on M implies exis tence of such a supp orted cla use, the corollar y follows.  Since all stable mo dels are s uppo rted (Gelfond and Lifschit z 1988), one can ex- press Erdem-Lifschitz Theor e m in a more succinct wa y . Cor ol lary 3.2 ( Er dem-Lifschitz ) If for every suppor ted model M of a program P , P is tight on M , then the classes of suppor ted and stable mo dels of P coincide. F ag es Theorem (F age s 1 994) is a weak er version of Cor ollary 3.1 (but with assump- tions that a re e a sier to test). Specifica lly , w e say that a pr o gram P is tight if there is a rank function rk such that for every clause C o f P , the ra nks of the atoms o ccurring in the p ositive par t of the bo dy of C ar e smaller than the ra nk o f the head of C . Clearly , if P is tight, then P is tight on an y of its models M since r k will also witness that P is tigh t o n M . Th us one has the following coro llary . Cor ol lary 3.3 ( F ages ) If P is tigh t, then the class e s of s uppo rted and stable mo dels of P coincide. Guar de d r esolution fo r Answer Set Pr o gr amming 9 Tightness is a syntactic prop er t y that can be chec ked in p oly no mial time by insp e c - tion of the p ositive call-gr aph of P . This is no t the case for the strong er assumptions of Prop osition 3.1 and Corolla ry 3.2. Let Stab ( P ) b e the se t of a ll sta ble mo dels o f P . W e say that pro grams P , P ′ are e quivalent if Stab ( P ) = St ab ( P ′ ). This notion and its strengthenings were stud- ied by ASP c ommunit y (Lifschitz, Pearce and V alverde 2 0 01), (T ruszcz y nski 2006). W e have the following fact. L emma 3.1 If P, P ′ prov e the same guarded atoms, then P and P ′ are equiv alent. As a corollar y we g e t the following r esult due to Dung (Dung and Ka nchansut 1989) Cor ol lary 3.4 ( Dung ) F or every progr a m P , ther e is purely negative pr ogra m P ′ such that P , P ′ are equiv a lent. The program P ′ is quite easy to construct. That is, for each ato m p , if e q P ( p ) = p ⇔ ( ¬ S 1 ∨ ¬ S 2 ∨ . . . ) , then we add to P ′ , all clauses of the form p ← n ot r i, 1 , . . . , not r i,m i where S i = { r i, 1 , . . . , r i,m i } . If e q P ( p ) = p , then we add p ← to P ′ . Finally , if e q P ( p ) = ¬ p , then we add no thing to P ′ . I t is then ea sy to see tha t E P = E P ′ and hence P and P ′ are equiv alent.  4 Com puting stable mo dels via satisfiabil it y , but without lo op form ulas or defining equations Prop os itio n 2.2 characterized the stable mo dels of a prop os itional pr ogra m in terms of the collection o f all prop os itional v aluatio ns of the underlying set of atoms. In this section, w e giv e an alter native characterization in terms o f the mo dels of suitably chosen propositio nal theories. The pro of of this characteriz a tion uses Prop os ition 2.2, but relates s ta ble mo dels of finite propo sitional progr ams P to mo dels of the- ories of size O ( | P | ). This is in contrast to P rop ositio n 2.2 since the set of defining equations is, in genera l, of siz e exp o nent ial in | P | . A sub e quation for a n atom p is either a formula ¬ p or a formula p ⇔ ¬ S where S is a supp ort o f a guarded resolution pro of of p fro m P . Here if S = ∅ , then by conv ention we interpret p ⇔ ¬ S to b e simply the atom p . T he idea is that a sub e quation either asserts a bs ence of the atom p in the putativ e s ta ble mo del or provides the reaso n for the pres ence of p in the putative stable mo del. A c andidate the ory for pr o gram P is the union of P and a set of sub equations, one for each p ∈ At . By C P we denote the set of candida te theor ies for P . 10 V.W. Mar ek and J .B. R emmel Pr op osition 4.1 1. Let T b e a candidate theo ry for P (i.e. T ∈ C P ). If T is consistent, then every prop ositiona l mo del o f T is a stable mo del for P . 2. F or every stable mo del M of P , there is theo r y T ∈ C P such that M is a mo del for T . Pro of: (1 ) Let T be a candidate theory for P and suppo se that M | = T . W e need to show that M is a stable mo del for P . In other words, we need to show that GL P ( M ) = M . The inclus ion GL P ( M ) ⊆ M follows fr o m the fa c t that M is a model of P . Tha t is, since M is a mo del of P , it immediately follows that M is a model of the Gelfond- Lifschitz trans form of P , P M . Since GL P ( M ) is the unique minimal mo del of P M , it automatically follows that GL P ( M ) ⊆ M . T o show that M ⊆ GL P ( M ), suppose that p ∈ M . Then the sub eq ua tion for p that is in T ca n not b e ¬ p . There fore it is of the form p ⇔ ¬ U p where there is some guar de d resolution pro o f P of p : U p from g ( P ). Since M | = T and p ∈ M , M | = ¬ U p . But then M ∩ U p = ∅ s o tha t M admits P . Hence by Corollar y 2.1, p ∈ GL P ( M ). (2) Let M b e a s table mo del of P . W e constr uct a c andidate theory T s o tha t M is a mo del of T . T o this end, for each p / ∈ M , we sele c t ¬ p as a sub equatio n for p . F or each p ∈ M , we selec t a guar ded reso lution pro of of some p : U p from g ( P ) that a dmitted by M . W e then add to T the formula p ⇔ ¬ U p . Clearly , T is a candidate theory , and M | = T , as desir ed.  Next we give an example of our approach to reducing the computation o f of sta ble mo dels to satisfiability of prop ositio na l theor ies. It will b e clear from this example that our a pproach av oids having to compute the completion of the program and th us significa nt ly reduces the siz e of the input theories. Example 4.1 Let P be a pro p ositional progra m as follows: p ← t, ¬ q p ← ¬ r q ← ¬ s t ← Let us observe that the atom p has tw o inclusion-minimal supp or ts, namely { q } and { r } . The atom q ha s just one s uppo rt, namely { s } , a nd the atom t also ha s just one suppo rt, namely ∅ . The atoms r and s ha ve no supp ort at all. Guar de d r esolution fo r Answer Set Pr o gr amming 11 Thu s there ar e thr e e sub equatio ns for p : p ⇔ ¬ q p ⇔ ¬ r ¬ p Now, q has only t wo sub equations: q ⇔ ¬ s , and ¬ q . Similarly , t has only t wo sub e quations, t and ¬ t , but the second one a utomatically le a ds to co ntradiction whenever it is chosen. Finally e ach of r and s have just one defining equation, ¬ r , and ¬ s , resp ectively . First let us choose for p , the sub equation ¬ p , and fo r q , the sub equation q ⇔ ¬ s . The re ma ining sub equations are forced to t , ¬ r , and ¬ s . The resulting theory has nine c lauses, when we write o ur pr ogra m in pro p o sitional form: S = {¬ p, ¬ r, ¬ s, t, q ⇔ ¬ s } ∪ {¬ t ∨ p ∨ q , r ∨ p, s ∨ q , t } . It is quite obvious that this theo r y is inconsistent. How ever, if we choo se for p , the sub e quation p ⇔ ¬ r and fo r q , the sub equation q ⇔ ¬ s , then the resulting theo ry written out in prop ositio nal for m is S = { p ⇔ ¬ r , ¬ r, ¬ s, t, q ⇔ ¬ s } ∪ {¬ t ∨ p ∨ q , r ∨ p, s ∨ q , t } . In this case, { p, q , t } is a mo del o f S and hence, { p, q , t } is a stable mo del of P .  It should be clea r that Prop osition 4.1 implies an a lgorithm for computation of stable mo dels . Namely , w e generate candidate theories and find their pr op ositional mo dels. Let us observe that the algo rithm describ ed above can b e implemen ted as a two-tier b acktr acking se ar ch , with the on-line computation of suppo rts of guarded resolution pr o ofs, and the usual bac ktracking scheme of DPLL. This second bac k- tracking can b e implemented using any DPLL-based SA T-solver. Pr op osition 4.1 implies that the alg o rithm we outlined is b oth sound and complete. Indeed, if the SA T solver returns a mo del M of theor y T , then, by Prop o sition 4.1(1), M is a sta- ble mo del for P . Otherwise w e gener ate another ca ndidate theory a nd lo op thro ugh this pro cess until one satisfying assignment is fo und. Pro p osition 4.1(2) gua rantees the completeness of our algor ithm. Our alg orithm is no t using lo o p formulas like the algorithm of Lin and Zhao (Lin and Zhang 2002) but sy stematically sear ches for supp or ts of pro of schemes, th us providing supp orts for atoms in the putative model. It also differs from the mo dified lo o p formulas approa ch of F erra ris, Lee and Lifschitz (F erra ris, Lee a nd Lifschitz 2006) in that we do not consider lo ops of the ca ll- graph of P at all. Ins tead, we com- pute systema tically pro of schemes a nd their supp orts for atoms. While the time- complexity of our a lgorithm is significa nt be cause there may b e exp onentially many suppo rts for any given atom p , the space complexity is | P | . This is the effect of not lo oking at lo op formulas at all ((Lifschitz a nd Razb orov 200 6)). 12 V.W. Mar ek and J .B. R emmel 5 Conclusions and F urther W ork W e hav e shown that gua rded unit resolution, a pro of s y stem that is a nonmono- tonic version o f unit r esolution, is adequate for des cription of the Gelfond-Lifschit z op erator GL P and its fixp oints. That is, we ca n characterize stable models o f logic progra ms in terms of gua r ded r e s olution. There are several natural questio ns co ncerning extens io ns o f gua rded r esolution in the con text of Answer Set Pr ogra mming. F o r example: (1) Is ther e a n analo gous pr o of system for the disj un ctive version of lo gic pr o gr am- ming ? or (2) A r e ther e analo gous pr o of systems for lo gic pr o gr amming with c onstr aints? W e believe that av ailability of s uch pro o f systems co uld help with finding a v ar iety of results on the complexity of reaso ning in nonmonotonic lo gics. An interesting case is that of prop ositiona l Default Lo gic. W e will show in a subseque nt pap er that that we can develop a s imilar gua rded resolution pro of s cheme for pr op osi- tional Default Logic. The main difference is that w e m ust allo w proof trees where the leav es ca n be tautologies rather than just gua rded a toms or guarded clauses that a re derived fro m the given program P a s in this pap er. References Apt, K. , B lair, H.A. , and W alker, A. T ow ards a theory of Declarative Know ledge. In: F oundations of De ductive Datab ases and L og ic Pr o gr amming , J. Minker, Ed. Morgan Kaufmann, 89–148, 1988. Baral, C. , Know le dge R epr esentat ion, R e asoning and De cl ar ative Pr oblem Solving , Cam- bridge Universit y Press, 2003. Brass, J. and Dix, J. Semantics of (Disjunctive) Logic Programs Based on Pa rtial Eva l- uation. Journal of L o gic Pr o gr amm ing 40:1–4 6, 1999. Do wling, W .F. and Gallier, J.H. Lin ear time algorithms for t esting satisfiabilit y of prop ositional H orn form ulae. Journal of L o gic Pr o gr amming 1:267–284, 1984. Dung, P.M. an d Kanchansut, K . A fi xp oint approach to declarativ e semantics of logic programs. Pr o c e e dings of North Americ an Confer enc e on L o gic Pr o gr am m ing pages 604– 625, 1989. Erdem, E. and Lifschitz, V. Tight Logic Programs. The ory and Pr actic e of L o gic Pr o- gr amm ing 3:499–518, 2003. F a ges, F. Consistency of Clark’s completion and existence of stable models. Journa l of Metho ds of L o gic i n C omputer Sci enc e , 1 :51–60, 1994. Ferraris, P., Le e, J. and Lifschitz , V . A generalizati on of Lin-Zh ao theorem. Annals of Mathematics and Artificial Intel ligenc e 47 :79–101, 2006. Gelfond, M. and Leone, N. Logic Pro gramming and Kno wledge Representa tion – A - Prolog p ersp ective. Art ifici al Intel li genc e 138 :3–38, 2002. Gelfond, M. and Lifschi tz, V. The stable mod el seman tics for logic programming. In: Pr o c e e dings of the International Joint Confer enc e and Symp osium on L o gic Pr o gr am- ming . MIT Press, 1070–10 80, 1988 . Guar de d r esolution fo r Answer Set Pr o gr amming 13 Karp, C. L anguages wi th Expr essions of Infinitary length . North-H olland, Amsterdam, 1964. Lifschitz, V. Twe lve defin itions of a stable mo del. In: Pr o c e e dings of International Con- fer enc e on L o gic Pr o gr amming , p ages 37–51, 2008. Lifschitz, V. , Pear ce, D. and V al verde, A. S trongly equiva lent logic programs. ACM T r ansactions on c omputational lo gic 2:526–541, 2001. Lifschitz, V. and R azboro v . A. Why are there so many loop formulas. Annals of Math- ematics and Artificial Intel ligenc e 7 :261–268, 2006. Lin, F. an d Zhao , Y. A S SA T: Computing answe r sets of a logic program by SA T solv ers. Pr o c e e dings of AAAI 2002 , p ages 112–117. 2002. Marek, V.W. and Rem mel, J.B . An A pplication of Pro of-theory in Answ er S et Pro- gramming. Preliminary ver sion at arXiv:0905.4 076 , 2010. Marek, V.W., and Truszczy ´ nski, M. Stable Models and an A lternative Logic Pro- gramming Paradigm. The L o gic Pr o gr amming Par adigm , pp. 375–398. Series Artificial Intellig ence, Springer-V erlag, 1999. Niemel ¨ a, I. Logic programs with stable model semantics as a constraint progr amming paradigm. Annals of Mathematics and Artificial I ntel li genc e 25, 3,4, 241–273, 1999 Truszczynski, M. Strong and Uniform Equiv alence of Nonmonotonic Theories An alge- braic Approach. Pr o c e e dings of the Confer enc e on Principl es of Know le dge R epr esenta- tion and R e asoning , pages 389–399, 2006.

Original Paper

Loading high-quality paper...

Comments & Academic Discussion

Loading comments...

Leave a Comment