Temporal Projection and Explanation

Andrew B. Baker and Matthew L. Ginsberg Computer Science Department Stanford University Stanford, California 94305

Abstract given is in fact somewhat simpler than that presented in [Hanks and McDermott, 1987], but still retains all of the We propose a solution to problems involving troublesome features of the original. In Section 3, we go temporal projection and explanation (e.g., the on to describe proposed solutions, and investigate their Yale shooting problem) based on the idea that technical shortcomings. whether a situation is abnormal should not de• The formal underpinnings of our own ideas are pre• pend upon historical information about how sented in Section 4, and we return to the Yale shooting the situation arose. We apply these ideas both scenario in Section 5, showing that our notions can be to the Yale shooting scenario and to a blocks used to solve both the original problem and the variant world domain that needs to address the quali• presented in Section 2. In Section 6, we extend our ideas fication problem. to deal with the qualification problem in a simple blocks world scenario. Concluding remarks are contained in 1 Introduction Section 7.

The paper [1987] by Hanks and McDermott describing 2 The Yale shooting the Yale shooting problem has generated such a flurry of responses that it is difficult to imagine what another The Yale shooting problem involves reasoning about a one can contribute. The points raised by Hanks and sequence of actions. In order to keep our notation as McDermott, both formal and philosophical, have been manageable as possible, we will denote the fact that some discussed at substantial length elsewhere. fluent holds in a situation 5 by writing simply It is not our intention to enter here into the philosoph• ical portion of this discussion. Rather, the contribution holds we hope to make is technical. In [Hanks and McDer• A situation will be written as an ordered sequence of mott, 1987], the authors raise a specific technical ques• actions tion: How is a certain form of temporal reasoning to be modelled? They go on to demonstrate that none of the then existing descriptions of action using nonmonotonic (We write the last action first so that we can append reasoning is suitable, and proceed from this observation new actions to the front of the sequence.) The initial to draw more far-reaching conclusions regarding the role situation is written simply as corresponding to the of formal methods in Al. A discussion of these philosoph• empty sequence of actions. ical issues is outside the intended scope of this paper. The Hanks-McDermott problem involves an individ• Since the initial circulation of Hanks' and McDer• ual, often named Fred, and a gun. Fred may or may not mott 's ideas in 1985, a variety of researchers have pro- be alive, and the gun may or may not be loaded. In the Dosed solutions to the technical challenge they raised initial situation, however, Fred is alive and the gun is Baker, 1989, Gelfond, 1988, Haugh, 1987, Kautz, 1986, loaded: Lifschitz, 1987a, Lifschitz, 1987b, Lifschitz and Rabinov, hoIds(alive, 1989, Shoham, 1986, and others]. Unfortunately, subse• (i) quent analysis (most of it over coffee tables) has shown holds(loaded, (2) most of these intended solutions to be flawed for one or We are also told that in any situation in which the gun another technical reason. is loaded, firing it will kill Fred. We write this as: We begin in the next section by presenting a brief description of the Yale shooting problem itself, and a holds(loaded,5) -iholds(alive, (3) variant that appears in [Baker, 1989]. The description where we are using to construct the result of per• *This work has been supported by the Rockwell Palo Alto forming the action a in the situation s. Finally, we are Laboratory, by General Dynamics, and by NSF under grant given a frame axiom: number DCR-8620059. The first author is supported by an AFOSR graduate fellowship. (4)

906 Planning, Scheduling, Reasoning About Actions In other words, unless the action a is abnormal in that the effect that if we fire the gun and then wait, Fred will it potentially reverses the fluent / in the situation s, be dead: / will persist through the execution of the action. We will presumably minimize the extent of the abnormality -iholds(alive, (wait, shoot)). predicate using any of the formal approaches to nonmon• Given this information, is it legitimate to conclude that otonic reasoning [Ginsberg, 1987].l the gun was loaded in the initial situation after all? Now suppose that in the initial situation, we wait and One would expect so, although this conclusion, as in then fire the gun. Does Fred die? In other words, what the original Yale shooting problem, is not sanctioned by can we say about . The reason is that we are unable to holds(alive,(shoot,wait))? distinguish between extensions with

Remarkably, we can say very little about it. Our in• ab(shoot, alive, ()) (6) tuition is that the shooting action should be abnormal, and should cause Fred's aliveness to be terminated. In where Fred dies when we shoot him, and those with other words, we should be able to derive ab(wait, alive, (shoot)),

ab(shoot,alive,(wait)) where Fred dies acausally during the waiting action. In• from the domain description given by (l)-(4). deed, even if we could select the abnormality appearing Unfortunately, we cannot do this. As Hanks and Mc- in (6), it would not follow from this that the gun was Dermott noticed, all that we can actually derive is the actually loaded before the shooting action took place. disjunction 3 Solutions ab(shoot, alive, (wait)) V ab(wait, loaded, ()). (5) The collection of proposed solutions to the original Yale This is saying that either Fred becomes not alive after shooting problem fall into roughly two groups. One set the shooting action, or the waiting action causes the of researchers [Kautz, 1986, Lifschitz, 1987b, Shoham, gun to become unloaded. If our intention is merely to 1986] suggests resolving the ambiguity underlying the minimize abnormality, there is no way to select between 2 problem by appealing to temporal information; another these two possibilities. As this sort of a minimization is Haugh, 1987, Lifschitz, 1987a, Lifschitz and Rabinov, all that is effected by any of the existing formalizations 1989] suggests modifying the domain description so as of nonmonotonic reasoning, all of these formalizations to capture the notion of causality directly. are incapable of concluding that Fred is dead after we shoot him. 3.1 Temporal orders Causal reasoning of this sort, where one reasons for• The first idea involves selecting among competing ex• ward in time from a fixed initial state, is called "tem• tensions based on a temporal order. Thus we might poral projection" by Hanks and McDermott in [1987]. prefer the extension in which ab(shoot, alive, (wait)) Before we turn to the various solutions that have been holds over that in which ab(wait, loaded, ()) holds on proposed to the temporal projection problem, let us dis• the grounds that ab(wait, loaded, ()) refers to an ear• cuss its dual, the temporal explanation problem [Hanks lier time than does ab(shoot, alive, (wait)). This is the and McDermott, 1987]. older of the two approaches, and is in fact endorsed by This involves reasoning backward from information Hanks and McDermott as a possible solution in [1987]; given about some state in the future. Here is an example the proponents of this approach argue that there can be similar to one introduced by Kautz in [1986 no causal reason for the earlier abnormality. In this example, which we call the "murder mystery," Unfortunately, this approach can be used for temporal we drop the axiom (2) saying that the gun is loaded in projection problems only. In the murder mystery, where the initial situation, and replace it with a statement to we need to ielect between 1Our formulation is slightly different from that presented ab(shoot, alive, ()) in [Hanks and McDermott, 1987]. We use it because: (1) It is as natural a description of the domain as that given by Hanks and and McDermott in [1987], (2) In the original description, it ab(wait, alive, (shoot)), was impossible to conclude -holds(alive, (shoot,wait)) in either extension, since there were no axioms relating alive to the chronological approaches favor the second extension, the fluent dead used in [Hanks and McDermott, 1987], and a choice that is at odds with our intuition. (3) The description appearing in [Hanks and McDermott, One might hope that one could use "reverse chrono• 1987] requires the introduction of an axiom explicitly stating logical minimization" to deal with temporal explanation that the shoot action leads to an abnormality for the alive problems, now preferring those extensions in which the predicate. This explicit analog to STRIPS delete lists will make abnormality occurs as early as possible. Unfortunately, it difficult to extend this approach to more complex domains [Ginsberg and Smith, 1988, Lifschitz, 1986]. reverse chronological minimization remains unable to 2In our formulation, there is also a third possibility, conclude that the gun was actually loaded in the murder namely ab(wait, alive, ()), where Fred dies while we wait mystery. In addition, it seems extremely unlikely that to shoot him. This possibility will have no effect on the ar• problems of practical interest will admit a clear distinc• guments to be presented in this paper. tion between these two aspects of temporal reasoning.

Baker and Ginsberg 907 3.2 Causal approaches The causal approaches work because they describe ac• Other proposed solutions [Haugh, 1987, Lifschitz, 1987a, tions not directly in terms of situations, but in terms of Lifschitz and Rabinov, 1989] have involved reformulat• the values of various fluents in those situations. Because ing the original domain description in a way that cap• of this, they have no reason to introduce an abnormality tures the notion of causality directly. Loosely speaking, into 5 in order to avoid one in (wait|s). these approaches proceed by indicating explicitly that In [Baker, 1989], this observation led to the argument the shooting action causes Fred to become not alive, that the simplest way to solve the Yale shooting problem and by saying that no change can occur unless there is simply to allow the function that computes the result is a causal explanation for that change. of an action to vary. It is shown there that this idea can Hanks and McDermott raise a variety of philosophical indeed be used successfully; the ideas we are about to 4 objections to this reformulation. Principally, they argue present are a natural outgrowth of this earlier work. that nonmonotonic formalisms were introduced to enable Another way to understand the problem is as follows: us to give intuitive descriptions of things like the frame When we attempt to minimize abnormalities of the form axiom. It would be unfortunate if they needed to resort to descriptions of causality that were (at least to Hanks' and McDermott's eyes) anything but intuitive after all. we are not minimizing over situations so much as we are In addition, it will in general be impossible to explic• over action sequences; we might just as well be minimiz• itly list all possible causal connections; some will be con• ing a function sequences of constraints on the situation that arises when (9) an action is executed.3 The causal approaches suggest that this problem can be addressed by minimizing the This sort of a minimization, however, completely misses extent of the causes predicate instead of minimizing ab• the intuition that we are hoping to capture - our intent normality. is to think of a situation not as a sequence of actions, but This does not work in all situations, however. The instead in terms of the values taken by various fluents. simplest one in which it fails is probably Hanks' and In order to make this explicit, we will make a distinc• McDermott's original description of the Yale shooting tion between a situation, such as (wait), and a state, problem, in which the gun is initially unloaded and there which will be described simply in terms of fluent values. is a load action that loads it: If a fluent changes value when an action a is performed in a situation s, we will think of the abnormality not as causes(load, loaded, true). a function of the situation s, but as a function of the The intent of the above axiom is that the load action state corresponding to it. causes the fluent loaded to become true. In order to formalize this, we introduce a subscript Now we also introduce a fluent dead, along with a onto the frame axiom (4): domain constraint saying that Fred is dead if and only if he is not alive: The subscript indicates that it is a situation that is being holds(dead, s) holds(alive, s). (7) considered abnormal. Finally, we have an axiom saying that shooting the In order to connect situations to the state vectors de• gun causes Fred to become not alive: scribing them, we introduce a predicate

causes(shoot,alive, false). describes

Now, we would like to be able to conclude that since that is intended to capture the notion that the situation shooting the gun causes Fred to become not alive, it also s is described by the state vector v. The intention here causes him to die: is that v contains enough information to determine the causes(shoot, dead, true) (8) value assigned by s to any particular fluent /. In the Yale shooting domain, v might contain two entries, cor• Unfortunately, this does not follow. Another possible responding to the values of the alive and loaded fluents minimization of the causes predicate is one in which the respectively; the value of any other fluent, such as dead, load action causes Fred to die, and the theory needs to can be computed from these two.5 be modified in a way that disallows this choice. Although a variety of suggestions have been made to address this We also avoid several problems with the approach in problem, none of them is completely satisfactory at this [Baker, 1989]. Varying the value of a function is at odds point. with the unique names assumption, and makes it difficult to implement the suggestions in [Baker, 1989]; the work we are 4 Situations and states presenting assumes the validity of the unique names assump• tion, in accordance with most work in logic programming. Note, however, that the causal approaches do correctly We also avoid the introduction of the temporal order used in conclude that the gun was loaded in the murder mys• [Baker, 1989], although this is a less substantial matter. tery, since this is the only explanation that avoids the "The conditions that the state completely describe the sit• introduction of a new causal rule. uation and that the user supply the system with a description of the describes predicate are fairly restrictive ones. In a 3This is known as the ramification problem [Finger, 1987, forthcoming paper [Ginsberg, 1989], one of us will discuss an Ginsberg and Smith, 1988]. extension of these ideas that uses partial descriptions only.

908 Planning, Scheduling, Reasoning About Actions We now say that abnormal situations correspond to 6 The blocks world abnormal state vectors: The ideas we have presented can be tested much more describes (11) thoroughly if we consider a somewhat more complex do• We also need an axiom saying that for any given state main of discourse. Let us therefore turn our attention to vector there is some situation s that is described a simple blocks world domain containing three blocks, A, by it: B and C. describes (12) In this domain, there is an action move that takes (Note that this axiom says only that some situation is a block and relocates it at a location However, rather than treat the requirements that both the block and the described by the state vector in actuality many situ• target location be clear as preconditions to the move ac• ations may be.) tion, we will view them as qualifications to it. This leads Instead of minimizing ab , we minimize allowing 5 us to describe the move action as: all other predicates to vary. That's all there is to it.

5 The shooting domain where the loc means that the block b is located at As an example, we return to the Yale shooting domain, /. which we have axiomatized using (3), describing the The subscripts and s on the abnormality predicate shooting action, and (7), describing the predicate dead. indicate respectively that it is a qualification abnormal• We also capture the describes predicate as: ity that is being considered, and that the qualification describes(s, [alive, loaded]) is being described for situations as opposed to state vec• holds(alive,s) holds(loaded, s) tors. As in Section 4, we introduce: describes(s, [alive,unloaded]) (14)

holds(alive, s) holds(loaded, s) and minimize ab, instead of ab describes(s, [dead, loaded]) In order to keep our notation uniform, we introduce holds(alive,s) holds(loaded, s) a subscript into the "frame" axioms (10) and (11), obtaining describes(s, [dead, unloaded]) holds(alive, s) holds(loaded, s) We begin by noting that it is a consequence of the above axioms that Now when we do the minimization, we minimize abqv (shoot, alive, [alive, loaded]). (13) preferentially over ab If we were not to do so, then we could avoid all violations of the frame axiom simply by In other words, the shooting action is abnormal in any assuming that all actions were qualified! We write our situation where Fred is alive and the gun is loaded. circumscription policy as To see this, suppose we denote by SQ the situation s[alive, loaded]. It follows from (12) that (17) describes( [alive, loaded]), Returning to the blocks world, we have the domain so that constraints holds(alive, ) holds(loaded, ), and therefore holds(alive,(shoot and (shoot, alive, ). saying respectively that only one block can be in any Applying (11), we obtain (13). particular location, that a block can be in only one place No other state vectors or actions will be abnormal if at a time, and that no block can be on top of itself. ab,, has its minimal extent, so we conclude that Next, we describe a situation by giving the locations (wait, loaded, [alive, loaded]), of the three blocks: and therefore that (wait, loaded, (21) where the initial situation is given by (1) and (2). It Finally, although the move action has no explicit pre• follows that the gun remains loaded during the wait ac• conditions, it can be qualified if either the block being tion, and Fred dies. The murder mystery is also solved moved or the target location is not clear: correctly, since it is only by assuming holds(loaded, ()) holds(loc that we can avoid increasing the extent of the pred• icate. holds(loc

Baker and Ginsberg 909 At this point, our description is complete. (The action in which some subgoal has been accomplished. Prelimi• of moving a block to itself is qualified by virtue of the nary results in this direction are the focus of [Ginsberg, fact that the success of the action is in direct conflict 1989]. with (20).) But there is one additional subtlety we need We will also need to extend our results to deal with to consider. Consider again the axiom (12) saying that more sophisticated ontologies of time and action. Al• every description corresponds to some situation; what though space does not allow us to discuss these matters situation corresponds to the state where both here, these issues present no substantial difficulty for the A and B are located at approach that we have described. Essentially, the con• In light of the domain constraint (18) indicating that tribution we have made is to notice that we must avoid only one block can be at any particular location, there being syntactically trapped into minimizing abnormal• is no such situation. It follows that (18) and (12) are in ity over actions as in (9), and must instead be careful conflict; what we really wanted to say in (12) is that ev• to ensure that we perform the minimization over the ery consistent description has some associated situation. combinations of fluents and values to which these action We therefore weaken (12) to become sequences correspond. This observation is independent of the representation we choose for time or action, and (22) extends easily to integer- or real-valued time and to con• and minimize inconsistent. Since whether or not a current actions. state vector is inconsistent should be determined before considering the qualification or frame problem, our re• Acknowledgement vised circumscription policy is

We are grateful to , David Israel, Paul Mor• ris, Karen Myers, Eunok Paek, Yoav Shoham and Dave Note that the predicate inconsistent appears Smith for many stimulating discussions, and are espe• nowhere else in our domain description; specifically, we cially indebted to Vladimir Lifschitz for careful conver• do not need to axiomatize a notion of consistencv. The sations during a Stanford faculty retreat. determination of the consistency of any particular state vector is handled automatically by the circumscription. References Note also that the ramification problem is handled by. [Baker, 1989] Andrew B. Baker. A simple solution this approach. Thus, for example, if we move a block to the Yale shooting problem. In Proceedings of from one location to another, we are able to conclude the First International Conference on Principles of that the block is no longer at its original location with• Knowledge Representation and Reasoning, 1989. out introducing an additional axiom to this effect - the Finger, 1987] Jeffrey J. Finger. Exploiting Constraints conclusion is a consequence of the relocation, together in Design Synthesis. PhD thesis, Stanford Univer• with the axiom (19) saying that the block can be in only sity, Stanford, CA, 1987. one location at a time. Gelfond, 1988] Michael Gelfond. Autoepistemic logic 7 Conclusion and formalization of common-sense reasoning. In Proceedings 1988 Non-monotonic Reasoning Work- We hope that the simplicity of the solution we have sug• shop, American Association for Artificial Intelli• gested will defuse some of the arguments that McDer- gence, Munich, 1988. mott has recently raised against formal work on com- Ginsberg, 1987] Matthew L. Ginsberg. Readings in monsense reasoning [McDermott, 1987]. Indeed, the de• Nonmonotonic Reasoning. Morgan Kaufmann, Los scription of action we have developed seems rather more Altos, CA, 1987. robust than a procedural description of action such as Ginsberg, 1989] Matthew L. Ginsberg. Situations and that proposed in [Hanks and McDermott, 1987]. The Descriptions. Technical Report, Stanford Univer• ramification problem is well-treated, we do not need to sity, 1989. supply an explicit "delete" list of those facts that an ac• [Ginsberg and Smith, 1988] Matthew L. Ginsberg and tion makes abnormal, and it is possible to incorporate David E. Smith. Reasoning about action I: A possi• qualifications into our description. To the best of our ble worlds approach. , 35:165- knowledge, the description we have presented is the only 195, 1988. one capable of representing the blocks world of Section 6 using a nonmonotonic description of the frame axiom [Hanks and McDermott, 1987] Steve Hanks and Drew and an implicit description of ramifications in terms of McDermott. Nonmonotonic logics and tempo• domain constraints. ral projection. Artificial Intelligence, 33:379-412, Much work remains to be done, however. For exam• 1987. ple, all of the situations we have examined in this paper [Haugh, 1987] Brian Haugh. Simple causal minimiza• have been "complete," in that we have been able to com• tions for temporal persistance and projection. In pute the state vectors associated with them. If we are Proceedings of the Sixth National Conference on Ar• to incorporate our description of action into a general- tificial Intelligence, pages 218-223, 1987. purpose planner, however, we will need to work with [Kautz, 1986] Henry A. Kautz. The logic of persistence. situations about which we have only partial knowledge, In Proceedings of the Fifth National Conference on such as situations in which the goal has been achieved, or Artificial Intelligence, pages 401-405, 1986.

910 Planning, Scheduling, Reasoning About Actions [Lifschitz, 1986] Vlad imir Lifschitz. On the semantics of STRIPS. In Proceedings of the 1986 Workshop o Planning and Reasoning about Action, Timberline, Oregon, 1986. [Lifschitz, 1987a] Vladi mir Lifschitz. Formal theories of action. In Proceedings of the 1981 Workshop on the Frame Problem in Artificial Intelligence, Lawrence, Kansas, 1987. [Lifschitz, 1987b] Vladimir Lifschitz. Pointwise circum• scription. In Matthew L. Ginsberg, editor, Readings in Nonmonotonic Reasoning, Morgan Kaufmann, Los Altos, CA, 1987. [Lifschitz and Rabinov, 1989] Vladimir Lifschitz and Arkady Rabinov. Miracles in formal theories of ac• tion. Artificial Intelligence, 38:225-237, 1989. [McDermott, 1987] Drew McDermott. A critique of pure reason. Computational Intelligence, 3:151- 160, 1987. Shoham, 1986] Yoav Shoham. Chronological igno• rance. In Proceedings of the Fifth National Confer• ence on Artificial Intelligence, pages 389-393, 1986.