Situation Calculus Speci cations for Event ... - Semantic Scholar

1 downloads 0 Views 221KB Size Report
15] M. P. Shanahan, A Circumscriptive Calculus of Events, to appear in. Arti cial Intelligence, 1994. 16] Leon Sterling and Ehud Shapiro, The Art of Prolog, MIT ...
Situation Calculus Speci cations for Event Calculus Logic Programs Rob Miller Department of Computing, Imperial College of Science, Technology and Medicine, 180 Queen's Gate, London SW7 2BZ, ENGLAND email: rsm@doc. ic. ac. uk WWW: http://laotzu.doc.ic.ac.uk/UserPages/sta /rsm/rsm.html

February 1995 To appear in: Proceedings of the Third International Conference on Logic Programming and Non-monotonic Reasoning, June 26-28, 1995, Lexington, KY, USA. pub. Springer Verlag

Abstract

A version of the Situation Calculus is presented which is able to deal with information about the actual occurrence of actions in time. Baker's solution to the frame problem using circumscription is adapted to enable default reasoning about action occurrences, as well as about the e ects of actions. Two translations of Situation Calculus style theories into Event Calculus style logic programs are de ned, and results are given on the soundness and completeness of the translations.

1

1 Introduction This paper compares two formalisms and two associated default reasoning techniques for reasoning about action { the Situation Calculus [11], using a variant of Baker's circumscriptive solution to the frame problem [1], and the logic-programming based Event Calculus [8], in which default reasoning is realised through negation-as-failure. The version of the Situation Calculus used enables information about the occurrences of actions along a time line to be represented. A course of actions identi ed as actually occurring is referred to as a narrative, and this formalism is referred to as the Narrative Situation Calculus. Information about a narrative might be incomplete, so that default assumptions might be required. The circumscription policy incorporated in the Narrative Situation Calculus minimises action occurrences along the time-line. The original Event Calculus incorporates an analogous default assumption - that the only action occurrences are those provable from the theory. The present paper shows that under certain circumstances the Narrative Situation Calculus may be regarded as a speci cation for Event Calculus style logic programs. The programs presented here are described as `Event Calculus style' because of their use of Initiates and Terminates predicates to describe the e ects of actions, because of the form of their persistence axioms, and because of the use of a time-line rather than the notion of a sequence or structure of situations. They di er from some other variants of the Event Calculus in that they do not assume complete knowledge of an initial state, and in that properties can hold (and persist) even if they have not been explicitly initiated by an action. Two classes of programs are discussed, both of which are \sound", for a wide class of domains, in that they only allow derivation of Holds information which is semantically entailed by their circumscriptive speci cations. Programs of the second type, although more complex, have an advantage over those of the rst in that they are also \complete" even where information is missing about the state of a airs before any action occurs.

Notation: Many-sorted rst order predicate calculus together with parallel

and prioritized circumscription is used to describe the Narrative Situation Calculus. Variable names begin with a lower case letter. All variables in formulas are universally quanti ed with maximum scope unless otherwise in2

dicated. To simplify descriptions of the implementations, logic programs are written in a subset of the same language, supplemented with the symbol not (negation-as-failure). Meta-variables are often written with Greek symbols, so that, for example,  might represent an arbitrary ground term of a particular sort. The parallel circumscription of predicates 1; : : :; n in a theory T with 1; : : :; k allowed to vary is written as CIRC [T ; 1; : : : ; n ; 1; : : :; k ] If 1; : : :; m are also circumscribed, at a higher priority than 1; : : : ; n, this is written as CIRC [T ; 1; : : : ; m ; 1; : : :; n; 1; : : : ; k ] ^ CIRC [T ; 1; : : : ; n ; 1; : : :; k ] Justi cation for this notation can be found, for example, in [9]. One other piece of notation for specifying uniqueness-of-names axioms will be useful. UNA[1; : : :; m] represents the set of axioms necessary to ensure inequality between di erent terms built up from the (possibly 0-ary) function symbols 1; : : :; m. It stands for the axioms i(x1; : : : ; xk) 6= j (y1; : : :; yn) for i < j where i has arity k and j has arity n, together with the following axiom for each i of arity k > 0 i(x1; : : : ; xk ) = i(y1; : : :; yk ) ! [x1 = y1; : : : ; xk = yk ]

2 A Narrative Situation Calculus In this section an overview is given of the Narrative Situation Calculus employed here as a speci cation language. This work is presented more fully in [13]. A class of many sorted rst order languages is de ned, and the types of sentence which can appear in particular domain descriptions are then described. Finally, the circumscription policy is discussed.

De nition 1 [Narrative domain language] A Narrative domain language is a rst order language with equality of four sorts; a sort A of actions with 3

sort variables fa; a1; a2; : : :g, a sort Fg of generalised uents1 with sort variables fg; g1; g2; : : :g, a sort S of situations with sort variables fs; s1; s2; : : :g, and a sort R of time-points with sort variables ft; t1; t2; : : :g. The sort Fg has three sub-sorts; the sub-sort F + of positive uents with sort variables ff + ; f1+ ; f2+; : : :g, the sub-sort F ? of negative uents with sort variables ff ? ; f1? ; f2?; : : :g, and the sub-sort Ff of uents with sort variables ff; f1; f2; : : :g, such that

F + \ F ? = ;;

F + [ F ? = Ff ;

Ff  Fg

It has time-point constant symbols corresponding to the real numbers, a nite number of action and positive uent constants, a single situation constant S 0, and no negative or generalised uent constants. It has ve functions: Neg : F + 7! F ? Sit : Fg 7! S State : R 7! S Result : A  S 7! S And : Fg  Fg 7! Fg and six predicates (other than equality): Holds ranging over Fg  S , Ab ranging over A  Ff  S , Absit ranging over Fg , < (in x) ranging over RR,  (in x) ranging over RR, and Happens ranging over AR. 2 Only models are considered in which the predicates < and  are interpreted in the usual way as the \less-than" and \less-than-or-equal-to" relationships between real numbers. Happens( ;  ) represents that an action occurs at time  2, and State( ) represents the situation at time  . Several domain independent axioms will always appear in Narrative Situation Calculus theories. The following ve axioms are taken from [1].

Holds(And(g1 ; g2); s) $ [Holds(g1; s) ^ Holds(g2 ; s)]

(B1)

Holds(Neg(f + ); s) $ :Holds(f + ; s)

(B2)

Baker introduces generalised uents in order to supply names to conjunctions of primitive uents, so that for example the generalised uent And(Loaded; Neg(Alive)) represents the joint property of being loaded and dead. 2 Action occurrences are thus represented here as instantaneous. However the approach can easily be modi ed to represent actions with a duration (see [13]). The choice of the real numbers is also somewhat arbitrary { any ordered (or \non-converging" partially ordered) set of time-units would suce (see [12] for further details). 1

4

Holds(g; Sit(g))

:Absit(g)

(B3)

Sit(g1) = Sit(g2) ! g1 = g2

(B4)

[Holds(f; Result(a; s)) $ Holds(f; s)]

:Ab(a; f; s)

(F1)

Axioms (B1)-(B4) are Baker's \existence-of-situations" axioms. Every combination of positive and negative uents (negative uent terms being those constructed with the Neg function) has at least one corresponding single \generalised uent" term which can be constructed using the And function. Axioms (B1)-(B4), together with minimisation of Absit, ensure that, in each preferred model, for each consistent combination of uents (characterised by some generalised uent g ) there is at least one situation (Sit(g)) in which all of these uents hold. Such situations are not characterised in the language by any actions which have led to them, but simply by the uents that hold in them. Axiom (F1) is a frame axiom. Ab is minimised to represent the assumption that actions result only in changes demanded by the domain theory. Baker's minimisation policy avoids the \Yale Shooting Problem" by incorporating existence-of-situations axioms and by circumscribing Ab (at a lower priority than Absit) whilst allowing the Result function to vary. Varying Result ensures that for a given term Result( ; ), the circumscription (and not the structure of the term) determines the set of possible situations to which it might refer. For any given model, inclusion in the language of terms of the form Result( ; ) does not necessitate inclusion of extra situations in the universe of discourse, since there are no uniqueness-of-names axioms mentioning Result. Indeed, under the circumscription, the preferable models are generally those in which the denotation of each situation term of the form Result( ; ) is the same as for some term of the form Sit(g). (For further details consult [1].) Two more domain independent axioms are included in the Narrative Situation Calculus, concerning properties of narratives and time-points:

State(t) = S 0

:9a1; t1[Happens(a1; t1) ^ t1 < t]

5

(N1)

State(t) = Result(a1; State(t1)) (N2) [Happens(a1; t1) ^ t1 < t ^ :9a2; t2[Happens(a2; t2) ^ [a1 6= a2 _ t1 6= t2] ^ t1  t2 ^ t2 < t]] Axiom (N1) relates all time points before the rst action occurrence to the initial situation S 0, and Axiom (N2) says that if action 1 happens at 1, 1 is before  and no other action happens between 1 and  , then the situation at time  is equal to Result( 1; State(1)). Several types of axioms are either required or allowed in Narrative Situation Calculus theories3. The following de nitions specify the form of such sentences.

De nition 2 [Initial conditions description] A formula is an initial conditions description if it is of the form

Holds(; S 0) or where  is a positive uent constant.

Holds(Neg(); S 0)

2

De nition 3 [Action description] A formula is an action description if it is of one of the following two forms Holds(; Result( ; s))

Holds(; Result( ; s)) [Holds(1; s) ^ : : : ^ Holds(n; s)] where is an action constant, ; 1; : : :; n are (positive or negative) ground

uent terms, and for each i and j , 1  i; j  n, i 6= Neg(j ). 2

De nition 4 [Narrative domain description] Given a narrative domain lan-

guage with positive uent constants 1; : : : ; n and with action constants 1; : : :; m, a formula N is a narrative domain description if it is a conjunction of action descriptions, initial conditions descriptions, occurrence descriptions, the frame axiom (F1), existence-of-situations axioms (B1)-(B4), axioms (N1) and (N2), uniqueness-of-names axioms In this paper theories do not include domain constraints, since no translation of domain constraints into logic programs will be given. The Narrative Situation Calculus in [13] includes such constraints. 3

6

UNA[1; : : :; n; And; Neg] UNA[ 1; : : :; m] and a domain closure axiom for uents f = 1 _ : : : _ f = n _ f = Neg(1) _ : : : _ f = Neg(n)

2 Although domain constraints have not been explicitly included in narrative domain descriptions, care must be taken, since domain constraints might be derived from pairs of action descriptions, together with Axiom (B2). For example, from the two action descriptions Holds(F1; Result(A; s)) Holds(F2; s)

Holds(Neg(F1); Result(A; s)) Holds(F3; s) the sentence :[Holds(F2; s) ^ Holds(F3; s)] can be derived. In fact, domain constraints are entailed only from pairs of action descriptions of this form (see [12]). Hence the following de nition is included, of narrative domain descriptions with no implicit domain constraints.

De nition 5 [Fluent independence] A narrative domain description N is

uent independent if for every pair of action descriptions in N of the form Holds(; Result( ; s)) [Holds(1; s) ^ : : : ^ Holds(m; s)]

Holds(Neg(); Result( ; s)) [Holds(m+1; s) ^ : : : ^ Holds(n ; s)] there is some i, 1  i  m, and some j , m + 1  j  n, such that i = Neg(j ) or j = Neg(i). 2 The following de nition is also useful. It identi es narrative domain descriptions in which information about what holds in the initial situation is complete.

De nition 6 [Initially speci ed narrative domain description] A narrative

domain description N is initially speci ed if for every positive uent constant  in the language, either Holds(; S 0) or Holds(Neg(); S 0) is an initial conditions description in N . 2 7

Two examples of uent independent narrative domain descriptions are given below. The rst is initially speci ed and the second is not. Only the domain-dependent axioms are given. Example 1 is a version of the Yale Shooting Problem, including a simple narrative in which a Sneeze4 action occurs at time 1 followed by a Shoot action at time 3. The full narrative domain description is referred to as NY SP .

Example 1 [The Yale Shooting Problem, NY SP ] Fluent constants: Alive, Loaded, Action constants: Sneeze, Shoot, Domain-speci c axioms: Holds(Neg(Alive); Result(Shoot; s)) Holds(Loaded; s) (Y1) Holds(Loaded; S 0)

(Y2)

Holds(Alive; S 0)

(Y3)

UNA[Alive; Loaded; And; Neg]

(Y4)

UNA[Sneeze; Shoot]

(Y5)

f = Alive _ f = Loaded _ f = Neg(Alive) _ f = Neg(Loaded)

(Y6)

Happens(Sneeze; 1)

(Y7)

Happens(Shoot; 3)

(Y8)

2 Because it is not initially speci ed, Example 2 below is useful in illustrating that logic program translations cannot be used to derive Holds literals not warranted by their speci cations (i.e. that they are \sound"). It concerns an electric gate, connected to a button which will open the gate when pressed, provided the system is connected to an electric supply. The gate is initially closed. There is no information as to whether the system is initially The Sneeze action takes place of the Wait action in the original formulation. In the Narrative Situation Calculus, \waits" are more naturally represented by the absence of an action occurrence within some time interval. 4

8

connected to an electrical supply, hence it is not possible to deduce that the gate will be either open or closed after the button has been pressed. The full narrative domain description is referred to as NGATE .

Example 2 [NGATE ] Fluent constants: Open, Connected, Action constant: Press, Domain-speci c axioms: Holds(Open; Result(Press; s)) Holds(Connected; s) (G1) Holds(Neg(Open); S 0)

(G2)

UNA[Open; Connected; And; Neg]

(G3)

f = Open _ f = Connected _ f = Neg(Open) _f = Neg(Connected)

(G4)

Happens(Press; 1)

(G5)

2 is

For a given domain description D, Baker's original circumscription policy

CIRC [D ; Absit ; Ab; Result; Holds; S 0] ^ CIRC [D ; Ab ; Result; S 0] The above policy will be referred to as CIRCb. As regards the Yale Shooting Problem, Baker shows that CIRCb[NY SP ] j= Holds(Neg(Alive); Result(Shoot; Result(Sneeze; S 0))) The Narrative Situation Calculus introduces an extended circumscription policy representing the assumption that the only action occurrences are those explicitly described in the narrative description. The separation of sentences in theories into those which describe actions' e ects and those which refer to the narrative allows this to be achieved in a natural way simply by circumscribing Happens in parallel with Ab, while varying State along with Result. As before, Absit is circumscribed at a higher priority so as to ensure the existence of all consistent situations. Thus, given a narrative domain description N , the extended circumscription policy is 9

CIRC [N ; Absit ; Ab; Happens; Result; Holds; S 0; State] ^ CIRC [N ; Ab; Happens ; Result; S 0; State] This circumscription policy is referred to as CIRCn. Three theorems are useful at this point. Full proofs of these can be found in [12]. The rst two theorems show that minimisation of Happens does not interfere with the minimisation used to solve the frame problem. The third theorem shows that, unsurprisingly, circumscribing Happens has the same e ect as forming its completion.

Theorem 1 Let N be a narrative domain description. Then CIRCn[N ] j= CIRCb[N ]

2

Theorem 2 Let N be a narrative domain description, and let  be a sentence which does not contain the predicate symbol Happens and does not contain the function symbol State. Then CIRCn[N ] j=  if and only if CIRCb[N ] j=  2 Theorem 3 Let N be a narrative domain description with k occurrence descriptions. If k < 0 and the set of occurrence descriptions is fHappens( i; i ) j 1  i  kg then

_k

CIRCn[N ] j= Happens(a; t) $ [a = i ^ t = i] i=1

and if k = 0 then CIRCn[N ] j= :9a; t[Happens(a; t)]

2

These theorems together with Axioms (N1) and (N2) allow the deduction of what uents hold at di erent time points, i.e. they facilitate temporal projection. For example, in the Yale Shooting Problem it can be shown that CIRCn[NY SP ] j= Holds(Neg(Alive); State(5)) A derivation of this is given in [12].

10

3 A Translation into Logic Programs For the purposes of deriving information about what holds along the timeline, the narrative domain descriptions of the previous section can be translated into Event Calculus style logic programs which do not contain situation terms or arguments. In this section, logic programs are de ned which use the following predicate symbols: