Representing Incomplete Knowledge in Abductive Logic Programming Marc Denecker Danny De Schreye K.U.Leuven, Department of Computing Science Celestijnenlaan 200A, 3001 Heverlee, Belgium e-mail: fmarcd, [email protected] Abstract Recently, Gelfond and Lifschitz presented a formal language for representing incomplete knowledgeonactionsandstates,andasoundtranslationfromthis language to extended logic programming. We present an alternative transla- tion to abductive logic programming with integrity constraints and prove the soundness and completeness. In addition, we show how an abductive proce- dure canbe used, notonly forexplanation,but alsofordeduction and proving satis(cid:12)ability under uncertainty. Fromamoregeneral perspective, this workcanbe viewed asa-successful- experiment in the declarative representation of and automated reasoning on incomplete knowledge using abductive logic programming. 1 Introduction The key issue in this paper is the representation of incomplete knowledge in a logic programming formalism. In pure Prolog, incomplete knowledge cannot be represented: due to negation as failure, an atom which cannot be proved is assumed to be false. Recently, [13] used extended programs to represent incomplete knowledge in the context of temporal domains. They introduced a new temporal language A which allows to represent a number of well-known benchmark problems involving incomplete temporal knowledge and they proposed a sound transformation to extended programs, programs with both negation as failure and classical or explicit negation [12]. In the past, another approach has been explored for temporal reasoning, based on event calculus [10], [21], [17], [8]. [8] proposes solutions for the same benchmarks as in [13]. This approach makes use of the formalism of abductive logic programming. One may interpret an abductive program as an incomplete logic program in the sense that it contains only de(cid:12)nitions for the non-abducible predicates. The completion semantics for abductive logic programs of [3] re(cid:13)ects this well by taking as the completion of an abduc- tive program the set of completed de(cid:12)nitions of the non-abducible predicates only. As a consequence, the completion does not impose any restriction on the interpretation of the abducible predicates and incomplete knowledge can be represented via the unde(cid:12)ned predicates. Observe that this treatment dif- fers totally from the treatment of a de(cid:12)ned predicate with empty de(cid:12)nition: this latter predicate is always false. In the rest of the paper we talk about incomplete programs instead of abductive programs, and unde(cid:12)ned predicates instead of abducible predicates. We prefer these names over the more com- monly used terminology because the latter refers to the speci(cid:12)c procedural way of executing these programs by abduction. Ingeneralanincompleteprogramwillallowtoomuchuncertainty. Inmost applications, the knowledge engineer has knowledge that implicitly restricts the possible states of the unde(cid:12)ned predicates. A declarative way of repre- senting this knowledge is by (cid:12)rst order logic integrity constraints. In order to illustrate this approach, we present a transformationfrom A domain descrip- tions to incomplete programs with integrity constraints (section 3). Despite thefactthatthe benchmarksin [8]weresolvedin abductive/incomplete event calculus, it turns out to be di(cid:14)cult to transform A domain descriptions to event calculus programs: as situation calculus, A is based on the branching time philosophy, whereas event calculus is based on a linear time philosophy. However, the use of the incomplete programs is in no way restricted to event calculus. The proposed transformation maps an A domain description to an incomplete situation calculus. Asecondarygoal istoillustrate howan abductive procedure can be useful for automated reasoning with incomplete programsand integrity constraints. That anabductive procedure can be used for explanationof someobservation is well-known from [21]. It is less known that an abductive procedure can also be used for deduction and for proving consistency of a theory. In section 4, we apply the abductive procedure called SLDNFA [5, 6], to solve distinct computational tasks involving complete and incomplete knowledge. The paper is structured as follows. In section 2, we recall the language A and its semantics. In section 3, the transformation fromA to situation calcu- lus programs is presented and the soundness and completeness are stated. In section 4, the use of abduction for explanation and deduction is illustrated. Section 5 gives a comparison between our transformation and the transfor- mation in [13] and section 6 discusses another recent transformation from A proposed in [9] and other related work. Proofs are omitted. 2 The temporal language A The language A [13] allows to describe relationships between (cid:13)uents (= time dependent propertiesoftheworld)andactions. Aisapropositional language: both (cid:13)uents andactions arerepresented bypropositional symbols. Twotypes of expressions occur. A v-proposition describes the value of a (cid:13)uent after a (possibly empty) sequence of actions. Its syntax is as follows: F after A1;:::;An HereA1;:::;An isasequenceofactionsymbolsandF isa(cid:13)uentexpression: a positiveornegativeliteralcontaininga(cid:13)uent. TheexpressionmeansthatF is true after executing the sequence of actions A1;:::;An. When the sequence of actions is empty (n=0), the v-proposition describes the initial situation. Instead of F after , one usually writes: Initially F Ane-proposition describes thee(cid:11)ectofactionsonthe(cid:13)uents. Ithastheform: A causes F if P1;:::;Pn where F;P1;:::;Pn are (cid:13)uent expressions and A is an action symbol. The expressionmeansthatifP1;:::;Pnaretrue,thenthee(cid:11)ectofAonthecurrent situation is that F becomes true. P1;:::;Pn are called preconditions. When n=0, one writes: A causes F. A domain description is a set of v- and e-propositions. Example We recall the Yale Turkey Shooting problem as formulatedin [13]. The (cid:13)uents are Loaded, Alive; the action names are Shoot, Wait and Load. The domain description D0 contains the following propositions: Initially Alive Initially :Loaded Load causes Loaded Shoot causes :Alive if Loaded Shoot causes :Loaded Example The Murder Mystery domain D1 is a variant of YTS, obtained by substituting :Alive after Shoot;Wait for Initially :Loaded in D0. This is a prototypical postdiction prob- lem: we want to obtain the conclusion that initially the gun is loaded. The semantics for A is de(cid:12)ned as follows. A state is a set of (cid:13)uent names and describes a possible state of the world. Given a (cid:13)uent symbol F and a state (cid:27), F holds in (cid:27) if F 2 (cid:27), otherwise :F holds in (cid:27). A transition function (cid:8) maps pairs (A;(cid:27)) of action symbols A and states (cid:27) into the set of states. (cid:8) describes how a situation changes under applica- tion of an action A. A structure M is a pair ((cid:27)0;(cid:8)), where (cid:27)0 represents the initial state and (cid:8) the transition function. MA1;:::;Am denotes the state (cid:8)(Am;(cid:8)(Am(cid:0)1;:::;(cid:8)(A1;(cid:27)0):::)). A v-proposition F after A1;:::;An holds in a structure ((cid:27)0;(cid:8)) i(cid:11) F holds in MA1;:::;Am. De(cid:12)nition 2.1 A structure M = ((cid:27)0;(cid:8)) is a model of a domain expression D if and only if the following rules are satis(cid:12)ed: (cid:15) Each v-proposition F after A1;:::;An holds in M. (cid:15) For any state (cid:27), (cid:13)uent symbol F and action A, if there exists an e- proposition A causes F if P1;:::;Pn such that P1;:::;Pn hold in (cid:27), then F holds in(cid:8)(A;(cid:27)). If there isan e-proposition A causes :F if P1;:::;Pn such that P1;:::;Pn hold in (cid:27), then :F holds in (cid:8)(A;(cid:27)). Otherwise, F holds in (cid:8)(A;(cid:27)) i(cid:11) F holds in (cid:27). [13] observes that the e-propositions of a domain D completely determine the transition function (cid:8). A domain description is called consistent if it has a model. We introduce a new notion, e-consistency. A domain description is e-consistent if the set of e-propositions of D is consistent. There is a simple necessary and su(cid:14)cient condition for a domain description to be e-consistent. Lemma 2.1 A domain description D is e-consistent i(cid:11) for each pair of rules A causes F if P1;:::;Pn and A causes :F if Pn+1;:::;Pm in D, there exists an i and j such that Pi is the complement of Pj. This condition is satis(cid:12)ed when the complementary literals are found in the bodies of the two rules but also when they appear in the body of one rule, as in shoot causes alive if loaded;:loaded. Such a rule has an inconsistent body. It can never be applied and can never cause an inconsistency. In [9], an action A for which there exists a pair of rules 0 0 A causes F if P1;:::;Pn and A causes :F if P1;:::;Pm such that no complement of a literal in the (cid:12)rst is contained in the second is called self-contradicted. [9] contains a similar proposition as lemma 2.1. We say that a (cid:13)uent F is non-inertial under an action A in a state (cid:27) i(cid:11) there exists an e-expression A causes F if P1;:::;Pn or an e-expression A causes :F if P1;:::;Pn such that P1;:::;Pn hold in (cid:27). A v-expression Qis entailedby adomain description D i(cid:11) Qholds in each model of D. A domain description is called complete if it has a unique model. The YTS domain and Murder Mystery domain are examples of complete domain descriptions. Since they share their e-propositions, their models have anidentical transitionfunction(cid:8)whichmapstuples(Wait;(cid:27))on(cid:27),(Load;(cid:27)) on (cid:27)[fLoadedg, and maps (Shoot;(cid:27)) on (cid:27)nfAlive;Loadedgif Loaded2 (cid:27), otherwise on (cid:27). The model M0 of D0 has initial situation fAliveg. The model M1 of D1 has initial situation fAlive;Loadedg. An incompletedomain description is obtained by dropping the v-expression Initially Alive from the Murder Mystery domain. One additional model is the structure with transition function (cid:8) but with initial situation fg. Aprovidesonlyrestrictedexpressivity: thelanguageisonlypropositional, no relationships between (cid:13)uents can be de(cid:12)ned, no indeterminate events are allowed. Nevertheless, Aallowstoformalise severalinterestingdomains. This and its clear semantics makes the language interesting for experiments as in [13], [9] and in this paper. 3 Translation to Incomplete Logic Programs In this section we present a general translation froman A domain description D toanincomplete logic programwithintegrityconstraints. Thetransforma- tion produces programsin situation calculus style. Traditionally, two options are available to represent a (cid:13)uent F in a logic formalism: by a predicate F(s) or by Holds(F;s) where s is a state argument. Then :F is trans- lated to :F(s) or :Holds(F;s). The two approaches are equivalent but the meta-approach has the advantage that the frame axiom can be stated for all (cid:13)uents at once, whereas in the (cid:12)rst approach one frame axiom per (cid:13)uent predicate is needed. As in [13], we use Holds=2. The (cid:12)rst order language LD contains the predicate symbols Holds=2,Noninertial=3 and Initially=1. Each (cid:13)uent and action symbol occurs in LD as a constant. In addition, there is a constant S0 to denote the initial state and a functor Result=2: Result(a;s) denotes the state obtained by applying action a on state s. In the sequel, we will use Result[a1;:::;an;s] as a shorthand notation for the term Result(an;Result(an(cid:0)1;:::Result(a1;s):::)). For n = 0, this denotes s. A allows uncertainty on the initial state. Correspondingly, the incom- plete program comprises one unde(cid:12)ned predicate, Initially=1. The transla- tion maps adomain description D toatheory (cid:25)D consisting of anincomplete logic program PD and a set of integrity constraints ICD. PD is de(cid:12)ned as follows: (cid:15) Initialisation: Holds(f;S0):-Initially(f) (1) (cid:15) Law of Inertia: Holds(f;Result(a;s)):-Holds(f;s);:Noninertial(f;a;s) (2) 0 0 (cid:15) Foreache-proposition A causes F if P1;:::;Pm;:P1;:::;:Pn withF, 0 Pi, Pj positive literals: Holds(F;Result(A;s)):-Holds(P1;s);:::;Holds(Pm;s); (3) 0 0 :Holds(P1;s);:::;:Holds(Pn;s) As in [13], weintroduce the convention thatwhen F is a negativeliteral 0 0 :F , Holds(F;t)is used asatextualdenotation for:Holds(F ;t). This handsome convention allows us to say that A causes F if P1;:::;Pn is translated to the clause: Holds(F;Result(A;s)):-Holds(P1;s);:::;Holds(Pn;s) without considering the sign of the literals Pi. Be awarethata program should never contain literals of the form Holds(:F;S), and that such literals in this paper always stand for :Holds(F;S). (cid:15) For each e-proposition A causes F if P1;:::;Pn with F a positive or negative (cid:13)uent literal: Noninertial(jFj;A;s):-Holds(P1;s);:::;Holds(Pn;s) (4) For a (cid:13)uent symbol F, jFj and j:Fj both denote the term F. The set of integrity constraints ICD is de(cid:12)ned as follows: (cid:15) For each v-proposition F after A1;:::;An (n (cid:21) 0): Holds(F;Result[A1;:::;An;S0]) (5) with the same syntactic convention on Holds=2 as above. Example The domain description D0 for the YTS problem is transformed to: Holds(f;S0):-Initially(f) Holds(f;Result(a;s)):-Holds(f;s);:Noninertial(f;a;s) Holds(Loaded;Result(Load;s)):-true Noninertial(Loaded;Load;s):-true Noninertial(Loaded;Shoot;s):-true Noninertial(Alive;Shoot;s):-Holds(Loaded;s) Holds(Alive;S0) :Holds(Loaded;S0) The clause Noninertial(Loaded;Load;s):-true may be dropped from this programwithoute(cid:11)ectonthesemanticsofHolds/2. Ingeneral,allNoninertial=3 rules for initiating e(cid:11)ects of actions may be dropped, without e(cid:11)ect on the semantics of Holds/2. (cid:25)D0 strongly resembles the YTS solution in [1]. They propose a Prolog programanalogoustotheoneobtainedfrom(cid:25)D0 bysubstitutingtheprogram clause: Holds(Alive;S0):-true forthe programclauses Holds(f;S0):-Initially(f)and Noninertial(Loaded; Load;s):-true andthetwointegrity constraintsof(cid:25)D0. Notethattheresult- ing programentails the twointegrity constraints. [1]provesthatthe resulting program is acyclic. The same holds for (cid:25)D0, and in fact for all transformed domain descriptions: Proposition 3.1 Thetranslation(cid:25)DofanydomaindescriptionD isacyclic. Several types of semantics have been de(cid:12)ned for incomplete programs [3], [14], [19], [7]. Due to the fact that (cid:25)D is acyclic and in each clause of PD, the variables of the body occur in the head, all semantics coincide in the (weak) sense that the set of all ground atoms implied by (cid:25)D under any of the semantics is identical. This extension of results of [1] is proven formally in [4]. The soundness and completeness of (cid:25) is proven wrt the completion semantics of [3]. Since an incomplete program does not contain clauses with unde(cid:12)ned predicates in the head, the Clark completion [2] contains for each unde(cid:12)ned predicate p=n the completed de(cid:12)nition 8(p(x1;:::;xn) $ false). In[3],thecompletioncompa(P)ofanincomplete programisde(cid:12)ned bytaking P'sClarkcompletion anddropping foreachunde(cid:12)ned predicateitscompleted de(cid:12)nition. Hence, compa(P) contains the axioms of Free Equality (FEQ or Clark's Equality Theory) and completed de(cid:12)nitions for all de(cid:12)ned predicates. The semanticsofatheoryPD+ICD isgiven bythe FOLtheorycompa(PD)+ ICD. In this way, [3] de(cid:12)nes indirectly a model semantics for P +IC: in the sequel, when we talk about a model of (cid:25)D we mean a classical model of compa(PD)+ICD. The translation (cid:25)D of a domain description contains two de(cid:12)ned predi- cates, Holds=2 and Noninertial=3. The completed de(cid:12)nition of Holds=2 is of the form: 8f;t : Holds(f;t)$ E1_E2_:::_Em (6) with: E1 = t = S0^Initially(f) E2 = 9a;s :t = Result(a;s)^Holds(f;s)^:Noninertial(f;a;s) Ei(i> 2)= 9s :f = F ^t = Result(A;s)^ Holds(P1;s)^:::^Holds(Pn;s) such that precisely for each e-expression A causes F if P1;:::;Pn with F a positiveliteral, thereexistsonedisjunctEi (i> 2)inthecompletedde(cid:12)nition. Ifwemapsonstate(cid:27),theResultfunctoron(cid:8)andHolds(f;s)toF 2 (cid:27) then the completed de(cid:12)nition ofHolds=2is similar to the second item of de(cid:12)nition 2.1. The completed de(cid:12)nition of Noninertial=3 is of the form: 8a;f;t :Noninertial(f;a;s)$ E1_:::_Em (7) with: Ei = a= A^f = jFj^Holds(P1;s)^:::^Holds(Pn;s) such that precisely for each e-expression A causes F if P1;:::;Pn (F pos- itive or negative), there exists one corresponding disjunct in the completed de(cid:12)nition. This formula expresses directly when a (cid:13)uent f is non-inertial under action a in state s. A transformationsuch as (cid:25) can be considered correct if the set ofentailed formulas are equivalent. In [13] a translation (cid:25) is de(cid:12)ned to be sound i(cid:11) for each domain D and v-expression Q, if (cid:25)D j= (cid:25)Q then D entails Q. (cid:25) is de(cid:12)ned to be complete if the reverse holds: if D entails Q then (cid:25)D j= (cid:25)Q. Theorem 3.1 (soundness) Let D be a domain description. For any v- proposition Q, if (cid:25)D j= (cid:25)Q then D entails Q. Theorem 3.2 (completeness) LetDbee-consistent. Foranyv-proposition Q, if D entails Q then (cid:25)D j= (cid:25)Q. The following example shows that the condition of e-consistency is neces- sary: (cid:25) is not complete in general. Example Consider the following domain description D2, which uses the (cid:13)u- ent Alive and the action Shoot. Shoot causes Alive Shoot causes :Alive Obviously, D2 is inconsistent: no transition function (cid:8) can exist which satis(cid:12)esthetwoe-propositions. Therefore,eachv-propositionisentailed by D2. (cid:25)D2 is given by: Holds(f;S0):-Initially(f) Holds(f;Result(a;s)):-Holds(f;s);:Noninertial(f;a;s) Holds(Alive;Result(Shoot;s)):-true Noninertial(Alive;Shoot;s):-true n This programis consistent. Shoot denotes the termResult[Shoot;:::; Shoot;S0] with n occurrences of Shoot. A Herbrand model of (cid:25)D1 is given by the set: n n fHolds(Alive;Shoot );Noninertial(Alive;Shoot;Shoot )jn> 0g In this model, the e-proposition Shoot causes Alive overrules the con- tradictingrule Shoot causes :Alive. (cid:25) isnotcomplete since D2 entails all v-propositions, while (cid:25)D2 does not. When D is inconsistent but e-consistent, then (cid:25)D is inconsistent too. When D is not e-consistent, then (cid:25) is incomplete i(cid:11) (cid:25)D is consistent. Even insuchacase,itisoftenpossible torestoretheequivalence betweenDand(cid:25)D by extending (cid:25) as follows. For each e-proposition A causes F if P1;:::;Pn with F a positive literal, we add the rule: Initiates(A;F;s):-Holds(P1;s);:::;Holds(Pn;s) For each e-proposition A causes :F if P1;:::;Pn with F a positive literal, we add the rule: Terminates(A;F;s):-Holds(P1;s);:::;Holds(Pn;s) In addition, we add the integrity constraint: 8a;f;s ::Initiates(a;f;s)_:Terminates(a;f;s) Example In (cid:25)D2 we have two additional rules: Initiates(Shoot;Alive;s):-true Terminates(Shoot;Alive;s):-true It is trivial that the resulting program violates the integrity constraint. In some interesting situations, this solution does not work. Consider the following example: Example The domain D3 is about (cid:13)ipping a (light) switch. There is one action: Switch and two (cid:13)uents, On and Off. Switch causes On if Off Switch causes Off if On Switch causes :On if On Switch causes :Off if Off Initially On Initially :Off D3 is not consistent, because (cid:8)(Switch;fOn;Offg)is not de(cid:12)ned con- sistently. However, starting from the initial situation in which On is true and Off is false and applying Switch consecutively (cid:13)ips the state of On and Off in such a way that On and Off are never true in the same state. Hence, from the initial state, the problematic state fOn;Offg can never be reached. For this reason, (cid:25)D3 is consistent, even with Terminating=3 and Initiating=3. The following interpreta- tion is a model: Initially(On) n Holds(On;Switch ) for each even n n Holds(Off;Switch ) for each odd n n Noninertial(On;Switch;Switch ) for each n n Noninertial(Off;Switch;Switch ) for each n n Initiates(Switch;On;Switch ) for each odd n n Terminates(Switch;On;Switch ) for each even n n Initiates(Switch;Off;Switch ) for each even n n Terminates(Switch;Off;Switch ) for each odd n Forthis example, the semantics of D3 and (cid:25)D3 di(cid:11)er. Which semantics is to be preferred? This is a matter of taste, but intuitively we (cid:12)nd the domain description D3 asensible theory,andthemodelasensible model ofthetheory. 1 By considering D3 inconsistent, the semantics ofA is toourtastetoosevere . 4 Reasoning on incomplete logic programs Traditionally, incomplete programs have been associated with abduction as procedural paradigm. We show how other important procedural paradigms such as deduction and proving satis(cid:12)ability are feasible and can be emulated by a suitable abduction procedure. 1 Notice that the inconsistency of D3 can easily be repaired by dropping the (cid:13)uent Off and replacing it everywhere by :On. It is unclear to us whether such a solution exists in general when the semantics of D and (cid:25)D di(cid:11)er. In[6]weproposedSLDNFA,anabductive procedurefornormalabductive programs. The soundness of SLDNFA has been proven. Two completeness results were proven: if an SLDNFA execution terminates with failure on a query Q, then compa(PD) j= 8(:Q); hence no abductive solutions ex- ist. If an SLDNFA execution terminates and generates abductive solutions (cid:1)1;:::;(cid:1)m,then foreachotherabductive solution (cid:1),there existsa(cid:1)i which is more general than (cid:1) in the sense that a skolem substitution (cid:18) exists such that (cid:18)((cid:1)i) (cid:18) (cid:1). If (cid:1)i contains no skolem constants, this simply means that 2 (cid:1)i (cid:18) (cid:1) . SLDNFA is not developed for dealing with FOL integrity constraints, but there is a general technique to transform an incomplete program P and a theoryofFOLintegrityconstraintsIC intoanequivalent incomplete program 0 P . This transformationtechnique is a trivial extension of the transformation proposed in [16]. In a (cid:12)rst step, P is extended with: false:-:F for each integrity constraint F 2 IC. The result is a general incomplete pro- gram. In the second step, it is transformed to a normal incomplete program 0 P using the technique in [16]. The transformationis correct in the sense that 0 P +IC is equivalent with P +f:falseg according to completion semantics. The remaining integrity constraint :false can be added as an extra literal to the query to be solved by the abductive solver. This result shows that FOL (with FEQ) and incomplete logic programming have the same expressivity in the strongest possible sense, namely on the level of logical equivalence. The proof of this result is a trivial extension of the proof in [16]. ForadomaindescriptionD,thetransformationoftheintegrityconstraints of(cid:25)Dtoanincompleteprogramistrivial. AgroundatomHolds(F;Result[A1; :::;An;S0]) is transformed to: false:-:Holds(F;Result[A1;:::;An;S0]) A ground negative literal :Holds(F;Result[A1;:::;An;S0]) is transformed to: false:-Holds(F;[A1;;:::;An;S0]) ApplyingthistechniqueontheintegrityconstraintsoftheMurderMystery 0 domainD1,weobtainanincomplete programP ,in whichthefollowingrules: false:-:Holds(Alive;S0) false:-Holds(Alive;[Shoot;Wait;S0]) are substituted for the integrity constraints of (cid:25)D1. An abductive procedure generatesexplanations for agiven observation on the problem domain. Here we can take :false as an observation. SLDNFA 2 Any other abductive procedure which satis(cid:12)es the same completeness results can be used. At the time of writing, SLDNFA seems to have advantages over other published procedures in two senses: it su(cid:11)ers less from (cid:13)oundering since it does not (cid:13)ounder on abducible atoms and more powerful completeness results have been proved for it.
Description: