ebook img

Unfolding Partiality and Disjunctions in Stable Model Semantics PDF

0.64 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Unfolding Partiality and Disjunctions in Stable Model Semantics

Unfolding Partiality and Disjun tions ∗ in Stable Model Semanti s 4 0 Tomi Janhunen and Ilkka Niemelä 0 2 Department of Computer S ien e and Engineering n Helsinki University of Te hnology a J P.O.Box 5400, FIN-02015 HUT, Finland 2 {Tomi.Janhunen,Ilkka.Niemela}hut.(cid:28) ] I A Dietmar Seipel . s c University of Würzburg [ Am Hubland, D-97074 Würzburg, Germany 2 v seipelinformatik.uni-wuerzburg.de 9 0 0 Patrik Simons 3 0 Neotide Oy 3 0 Wol(cid:30)ntie 36 / s FIN-65200 Vaasa, Finland c : v Patrik.Simonsneotide.(cid:28) i X r a Jia-Huai You Department of Computing S ien e University of Alberta Edmonton, Alberta, Canada T6G 2H1 you s.ualberta. a ∗ A preliminary version of this paper [21℄ appears in the Pro eedings of the 7th In- ternational Conferen e on the Prin iples of Knowledge Representation and Reasoning, KR'2000. 1 Abstra t The paper studies an implementation methodology for partial and disjun tive stable models where partiality and disjun tions are un- foldedfromalogi programsothatanimplementationofstablemodels for normal (disjun tion-free) programs an be used as the ore infer- en e engine. The unfolding is done in two separate steps. Firstly, it is shown that partial stable models an be aptured by total stable mod- elsusing asimple linear and modular program transformation. Hen e, reasoning tasks on erning partial stable models an be solved using an implementation of total stable models. Disjun tive partial stable models have been la king implementations whi h now be ome avail- able as the translation handles also the disjun tive ase. Se ondly, it is shown how total stable models of disjun tive programs an be de- termined by omputing stable models for normal programs. Hen e, an implementation of stable models of normal programs an be used as a ore engine for implementing disjun tive programs. The feasibility of the approa h is demonstrated by onstru ting a system for omput- ing stable models of disjun tive programs using the smodels system as the ore engine. The performan e of the resulting system is om- pared to that of dlv whi h is a state-of-the-art system for disjun tive programs. 1 INTRODUCTION Implementation te hniques for de larative semanti s of logi programs have advan ed onsiderably during the last years. For example, the XSB sys- tem [40℄ is a WAM-based fulllogi programmingsystem supporting the well- founded semanti s. In addition to this kind of a skepti al approa h that is based on query evaluation also a redulous approa h fo using on omputing models of logi programs is gaining popularity. This work has been entered around the stable model semanti s [17, 18℄. There are reasonably e(cid:30) ient implementations available for omputing stable models for disjun tive and normal (disjun tion-free) programs, e.g., dlv [24℄, smodels [46, 45℄, mod- els [1℄, and assat [29℄. The implementations have provided a basis for a new paradigm for logi programming alled answer set programming (a term oined by Vladimir Lifs hitz). The basi idea is that a problem is solved by devising a logi program su h that the stable models of the program provide the answers to the problem, i.e., solving the problem is redu ed to a stable 2 model omputationtask [27, 32, 34, 13, 5℄. This approa h has led to interest- ing appli ations in areas su h as planning [8, 11, 2℄, model he king [30, 20℄, and software on(cid:28)guration [49℄. This paper addresses two issues in the stable model semanti s: partial- ity and disjun tions. The idea is to develop methodology su h that e(cid:30) ient pro edures for omputing (total) stable models that are emerging an be ex- ploited when dealing with partial stable models and disjun tive programs. Sometimes it is natural to use partial stable models to represent a domain. Even when working with total stable models, partial stable models ould be useful, e.g., for debugging purposes to show what is wrong in a program without any total stable models. However, little has been done on imple- menting the omputation of partial stable models and most of the work has fo used on query evaluation w.r.t. the well-founded semanti s. In the paper we show that total stable models an apture partial stable models using a simple linear program transformation. This transformation works also in the disjun tive ase showing that implementations of total stable models, e.g. dlv, an be used for omputing partial stable models. Using a suitable transformation of queries, a me hanism for query answering an be realized as well. Our translation is interesting in many respe ts. First, it should be noted that the translation does not follow dire tly from the omplexity results al- readyavailable. Ithasbeenshown, e.g., thattheproblemofdΣe pidingwhether a query is ontained in some model (possibility inferen e) is 2- omplete for both partial and total stable models [12, 15℄. This implies that there exists a polynomial time redu tion from possibility inferen e w.r.t. partial models to possibility inferen e w.r.t. total models. However, this kind of a translation is guaranteed to preserve only the yes/no answer to the possibility inferen e problem. Se ond, not all translations are satisfa tory from a omputational point of view. In pra ti e, when a program is ompiled into another form to be exe uted, ertain omputational properties of the translation play an important role: • e(cid:30) ien y of the ompilation (in whi h order of polynomial), • modularity (are independent, separate ompilations of parts of a pro- gram possible), and • stru tural preservation (are the omposition and intuition of the origi- nalprogrampreserved so that debugging and understandingof runtime 3 behavior are made possible). All this points to the importan e of (cid:28)nding good translation methods to enable the use of an existing inferen e engine to solve other interesting prob- lems. The e(cid:30) ien y of pro edures for omputing stable models of normal pro- grams has in reased substantially in re ent years. An interesting possibility to exploit the omputational power of su h a pro edure is to use it as a ore engine for implementing other reasoning systems. In this paper, we follow this approa h and develop a method for redu ing stable model omputation of disjun tive programs to the problem of determining stable models for nor- mal programs. This isΣnpon-trivial as de iding whether a disjun NtiPve program has a stable model is 2- omplete [12℄ whereas the problem is - omplete in the non-disjun tive ase [31℄. The method has been implemented using the smodels system [46, 45℄ as the ore engine. The performan e of the im- plementation is ompared to that of dlv, whi h is a state-of-the-art system for omputing stable models for disjun tive programs. There are a number of novelties in the work. Maximal partial stable models for normal programs are known as regular models, M-stable models, and preferred extensions [10, 39, 50℄. Although this semanti s has a sound and omplete top-down query answering pro edure [10, 16, 28℄, so far very little e(cid:27)ort has been given to a serious implementation. For disjun tive pro- grams, to our knowledge, no implementation has ever been attempted. As a result, we obtain (perhaps) the (cid:28)rst s alable implementation of the regu- lar model/preferred extension semanti s, and the (cid:28)rst implementation ever for partial stable model semanti s for disjun tive programs. Our te hni- al work on the relationship between stable and partial stable models via a translational approa h provides a ompelling argument for the naturalness of partial stable models: stable models and partial stable models share the same notion of unfoundedness, arefully studied earlier in [14, 26℄. Finally, we demonstrate how key tasks in omputing disjun tive stable models an be redu ed to stable model omputation for normal programs by suitable program transformations. In parti ular, we develop te hniques for mapping a disjun tive program into a normal one su h that the set of stable models of the normal program overs the set of stable models of the disjun tive one and in many ase even oin ides with it. Moreover, we devise a method where the stability of a model andidate for a disjun tive program an be determined by transforming the disjun tive program into a normal one and 4 he king the existen e of a stable model for it. Finally, in the experimental part of this paper, we present a new way of en oding quanti(cid:28)ed Boolean formulas as disjun tive logi programs. This transformation is more e onom- i al in the number of propositional atoms and disjun tive rules than earlier transformations presented in the literature [12, 25℄. The rest of the paper is stru tured as follows. We (cid:28)rst review the basi de(cid:28)nitions and on epts in Se tion 2. It is then shown in Se tion 3 that par- tial stable models an be aptured with total stable models using a simple program transformation. In Se tion 4, we des ribe the method for om- puting disjun tive stable models using an implementation of non-disjun tive programs as a ore engine. After this, we present some experimental results in Se tion 5 and (cid:28)nish with on luding remarks in Se tion 6. As a omment on the histori al development of the translation given in Se tion 3, the hara terization of partial stable models as stable models of the transformed program was (cid:28)rst sket hed for normal programs in a proof by S hlipf [42, Theorem 3.2℄. Fordisjun tive programs, itwas dis overed and proven in [43℄, and independently in [21℄. In the urrent paper we present a proof based on unfounded sets, whi h was given in [21℄, as this proof reveals some of the properties of unfounded sets whi h are of interest in their own right. Yet another approa h to omputing the partial stable models of a disjun tive program based on a program transformation has been developed P byRuizandMinker[37℄: adisjun tiveprogram istranslatedintoapositive P3S P disjun tive program with onstraints, the 3S(cid:21)transformation of , su h P3S that the total minimal models of that additionally ful(cid:28)ll the onstraints P oin ide with the partial stable models of . 2 DEFINITIONS AND NOTATIONS P P A disjun tive logi program (or, just disjun tive program ) isa set of rules of the form a a b ,...,b , c ,..., c 1 k 1 m 1 n ∨···∨ ← ∼ ∼ (1) k 1 m,n 0 a b c i i i where ≥ , ≥ and 's, 's and 's are atoms from the Herbrand Hb(P) P 1 base of . Let us also distinguish sub lasses of disjun tive programs. P 1 Forthesakeof onvenien e,weassumethatagivenprogram isalreadyinstantiated by the underlying Herbrand universe, and is thus ground. 5 k = 1 P P If for ea h rule of , then is a disjun tion-free or normal program. n = 0 P P If for ea h rule of , then is alled positive. Hb(P) a Literals are either atoms from or expressions of the form ∼ where a Hb(P) A Hb(P) A a a A ∈ . For a set of atoms ⊆ , we de(cid:28)ne ∼ as {∼ | ∈ }. A B, C A = B C Let us introdu e a shorthand ← ∼ for rules where 6 ∅, and Hb(P) A are subsets of . In harmony with (1), the set of atoms in the head B C of the rule is interpreted disjun tively while the set of literals ∪ ∼ in the body of the rule is interpreted onjun tively. We wish to further simplify A B, C A B C the notation ← ∼ in some parti ular ases. When , or is a a a a B = C = B singleton { }, we write instead of { }. If ∅ or ∅ we omit and C ∼ (respe tively) as well as the separating omma in the body of the rule. 2.1 PARTIAL AND TOTAL MODELS We review the basi model-theoreti on epts by following the presentation P I P in [15℄. Let be any disjun tive program. A partial interpretation for is T,F Hb(P) T F = atpair h f i of subsetus of su h that ∩ ∅. The atoms in the sets I = T I = F I = Hb(P) (T F) , and − ∪ are onsidterfed to bue true, false, and unde(cid:28)ned, respe tively. We introdu e onstants , , and , to denote I P the respe tive three truth valuesu. A partial interpretation for is a total P I = Hb(P) interpretation for whenever ∅, i.e., if everytatom of is either I true or false. When no onfufsion arises, wetuse ualone to spe ify a total I P I = Hb(P) I I = interpretation for (then − and ∅ hold). P Given a pIatrtiIafl interIpuretation for , the truth vatluefs of atuoms are de- termined by , and as explained above while , and have their E I(E) (cid:28)xed truth values. For morEe omIplex logi al exIp(resas)ions , we use t tfo denuote the trutIh(av)aluefoft inu . The value ∼ is de(cid:28)ned to be , , or whenever is , , or , respe tively. To handle onjun tions and dfi<sjuun <tiotns, we introdu e an orderingLon=thle,t.h.r.e,el truth values by setting 1 n . By default, a set of literals { } denotes the onjun - l1 ln WL l1 ln tion ∧···∧ while denotes the orresponding disjun tion ∨···∨ . I(L) I(WL) The truth values and are de(cid:28)ned as the respe tive minimum I(l ),...,I(l ) A B, C 1 n and maximum among the truth values . A rule ← ∼ I I(WA) I(B C) is satis(cid:28)ed in if and only if ≥ ∪∼ . A partial interpretation M P P P M for is a partial muodel of if all rules of are satis(cid:28)ed in , and for M = a total model, also ∅ holds. Let us then introdu e an orderingt amongt M M M M 1 2 1 2 partial mf odels off a disjun tive program: ≤ if and only if ⊆ M M M P 1 2 and ⊇ . A partial model of is a minimal one if there is no 6 M′ P M′ < M M′ M M′ = M partial model of su h that (i.e., ≤ and 6 ). In N N N N 1 2 1 2 ase of total models, we have ≤ if and only if ⊆ . Moreover, N P a totalNm′odePl of is Non′sideNred to be a minimal one if there is no total model of su h that ⊂ . 2.2 STABLE MODELS I P Given a partial interpretation for a disjun tive program , we de(cid:28)ne a P redu tion of as follows: PI = A B A B, C P C If . { ← | ← ∼ ∈ and ⊆ } Note that this transformation oin ides with the Gelfond-Lifs hitz redu tion P P I of (the GL-redu tion of ) when is a total interpretation. N De(cid:28)nition 2.1 (Total stable model) A total interpretation for a dis- P N jun tive program is a stable model if and only if is a minimal total model PN of . The original de(cid:28)nition of partial stable models [35, 36℄ is based on a P weaker redu tion. Given a disjun tive program and an interpretation I P P I , the redu tion is the set of rules obtained from by repla ing any c I( c) ∼ in the body of a rule by ∼ . As noted in [35℄, the only pra ti al PI P P I I di(cid:27)Aeren eBb,etCweenP and isI(thaCt) = huas rules that oIrr(espCo)nd=tto rules oAf ←B ∼PI ∈ satIi(sfyCin)g= ∼f . Note that if ∼ P , then I ← ∈ , and if ∼ , then the partial models of are not P I onstrained by the rule in luded in . M De(cid:28)nition 2.2 (Partial stable model) A partial interpretation for a P P M disjun tive program is a partial stable model of if and only if is a P M minimal partial model of . M P M In the above de(cid:28)nition, the relation between and is similar to the one for the total stable model, both for the purpose of preserving the stability ondition. While maximizing falsity and minimizing true atoms, a partial stable model does not insist that every atom must be either true or false. (Partial)stablemodelsareintimatelyrelatedtounfoundedsets[14,26℄. I De(cid:28)nition 2.3 (Unfounded sets) Let be a partial interpretation for a P U Hb(P) disjun tive program . A set ⊆ of ground atoms is an unfounded 7 P I set for w.r.t. , if at least one of the following onditions holds for ea h A B, C P A U = rule ← ∼ ∈ su h that ∩ 6 ∅: f t B I = C I = UF1: ∩ 6 ∅ or ∩ 6 ∅, B U = UF2: ∩ 6 ∅, or t u (A U) (I I ) = UF3: − ∩ ∪ 6 ∅. t U P I I U I = An unfounded set for w.r.t. is - onsistent if and only if ∩ ∅. The onditions UF1 and UF3 above oin ide with the onditions I(B C) = f I(W(A U)) = f ∪∼ and − 6 , U respe tively. The intuition is that the atoms of an unfounded set an be A B, C assumedtobefalsewithoutviolatingthesatis(cid:28)abilityofanyrule ← ∼ U of the program whose head ontains some atoms of . For any su h rule, I either the rule body is false in (UF1), or the rule body an be falsi(cid:28)ed U I by falsifying the atoms in (UF2), or the head of the rule is not false in (UF3). In parti ular, unfounded sets w.r.t. partial/total models an be used for onstru ting smallerpartial/totalmodels (re allthe de(cid:28)nitionof minimal partial and total models) in a way that is made pre ise by what follows. M = T,F Lemma 2.4 Let h i be a partial model of a positive disjun tive P U P M M UprograMm and aMn u′ n=fouTndedU,seFt foUr w.r.t. . Then, if P is total or is - onsistent, h − ∪ i is a partial model of . M P U M′ PROOF. Let , , and be de(cid:28)ned asabove. Additionally,we assume M U M thatA(a) Bis toPtal, or (b) is - Mon′sistent. Let us thenMa′s(sWumAe)t<haMt s′(oBm)e rule ←M′(oWf A)is<nott satiMs(cid:28)e′(dBi)n= t whi h mMea′(nWs tAh)at= f M′(B) = u. Thus (i) and , or (ii) and . Our proof splits in two separate threads. A U = M′(WA) < t I. Assume that ∩ ∅ holds. Consider the ase (i). Now A (T U) = A U = iAmpliTes= ∩ − M(W∅.A)Si<n et ∩ ∅ holds, tooM, w′(eBo)b=taint ∩ B ∅ soTthatU B . TOn theMo(tBhe)r=hatnd, implies ⊆ − . Thus ⊆ and holds as well. M(WA) < M(B) But then M′(WA) = f , a onAtradiF tionU. The ase (iAi) is aFnalyzed AnextU. N=ow M(WA)im=pflies ⊆ ∪ asMwe′(lBl a)s= u⊆ , sin e B∩(F U∅).=Thus . MBorFeo=ver, from M(B) > fwe obtain ∩ ∪ ∅. Thuswe obtain ∩ 6 ∅sothat holds. To M(WA) < M(B) on lude, we have established that , a ontradi tion. 8 A U = II. Otherwise ∩ 6 ∅ holdsA. TheBn at least one oMf (tBhe)u=nfofundedness onditions isBappliF able tBo ←F U. If UF1Mis,′(B) = f holds. It follows that ⊆ and ⊆ ∪ . Thus ontradi ting B U = bothB(i) a(nFd (iUi).) =If UF2 is apMpli′ (aBb)le=, wfe have ∩ 6 ∅. It follows that ∩ ∪ 6 ∅ so that , a ontradi tion. M(W(A U)) > f Thus UF3 must apply, i.e., − holds. Let us then onsider ases (a) and (b) separately. M M(W(A U)) = t (a) If istotal, we have ne essarily − . Thisimplies a A U T a T U thatMso′m(We Aat)o=mt ∈ − belongs to . Thus also ∈ − and , a ontradi tion with both (i) and (ii). U M U T = M(W(A U)) = t (b) If is - onsistent, we have ∩ ∅. By − a A U a F a F U there is an atoMm′(W∈A) >−f su h that 6∈ . Then 6∈ ∪ wMh′i( WhAim)p=lieus M′(B) =. Tthus (ii)isimpossibAlean(Td (i)Uim)p=lies and . It follows that ∩ − ∅ B T U U T = A T = and ⊆ − . Sin e ∩ B ∅,Tthe former implieMs (W∩A) < ∅t whileMt(hBe)la=ttetr implMies(WthAat) < M⊆(B.)Consequently, and , i.e., , a ontradi tion. 2 M U Let us yeMt emphasize the onteMnt′o=f LMemmUa 2.4 when is total (aPnd need not be - onsistent). Then − is also a total model of . A ouple of examples on unfounded sets follow. Example 2.5 Consider a disjun tive program P = a b c, a { ∨ ← ∼ } I = , a P andan interpretation h∅ { }i. The onlyrule in has its bodyunde(cid:28)ned I a I b in , hen e UF1 is not appli able. The set { } is unfounded w.r.t. sin e I is unde(cid:28)ned in and not in the set, hen e UF3 is appli able. On the other b I c hand, the set { } is not unfounded w.r.t. whereas { } is unfounded w.r.t. I c a b . On e belongs to an unfounded set, the atoms and an both get in U = a,b,c I due to UF2. Hen e, we hfave { f} as an unfounded set w.r.t. . U I I Comparing with , we (cid:28)nd that does not maximize the atoms that P should be false. This program has exa tly one stable model (whi h is als2o a partial stable model) in whi h all three atoms are false. 9 Unlike the ase for normal programs, the union of unfounded sets may not be an unfounded set. P Example 2.6 Consider a program ontaining only one rule a b ∨ ← I = a,b , and an interpretation h{ } ∅i. The program has two non-empty un- I a b a b founded sets w.r.t. , { } and{ }. Either or depends on the otherone not in the set foar UF3b to be appli able. Howevae,rb, UF3 be omes not appli ab2le when both and are in, thus the union { } is not an unfounded set. I P Aninterpretation for be omesparti ularlyinterestingwhentheunion U P I P of all unfounded sets for w.r.t. is also an unfounded set for w.r.t. I P U P . In this ase, the program possesses the greatest unfounded set for I w.r.t. . I De(cid:28)nition 2.7 A total interpretation is said to be unfounded free for a P U P I progratm if and only if there is no unfounded set for w.r.t. su h that U I = ∩ 6 ∅. The notion of unfounded freeness aptures the stable model beautifully. M Theorem 2.8 [26℄ Let be a total interpretation for a disjun tive program P . Then, the following are equivalent M P • is a stable model of . f M P M • is the greatest unfounded set for w.r.t. . M P • is unfounded free for . On the other hand, Eiter et al. [14℄ show that partial stable models an be de(cid:28)ned essentially without referen e to three-valued logi . M Theorem 2.9 [14℄ If is a partial interpretation for a disjun tive program P M P , then is a partial stable model of if and only if Mt PM • is a minimal total model of and f M M P M • is a maximal - onsistent unfounded set for w.r.t. . 10

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.