A Logical Formalization of the Egg-Cracking Domain - Semantic Scholar

51 downloads 0 Views 183KB Size Report
ing that cracking an egg and separating the two parts of the eggshell while holding the .... val; end(i) denotes the ending time point of an interval. All formulas are ...
Beyond Toy Problems: A Logical Formalization of the Egg-Cracking Domain (Preliminary Report) Leora Morgenstern

IBM T.J. Watson Research Center P.O. Box 704 Yorktown Heights, NY 10598 [email protected]

Abstract

Formal research in object-level commonsense reasoning (csr) has concentrated on toy problems|problems that require only a few axioms to formalize. The resulting body of research is often narrow, since scaling down a problem factors out much of the diculty. This paper aims to reverse this trend. We tackle a substantial problem in csr: the formalization of egg cracking. To do this, we develop theories of shape and material and integrate these with a theory of action and planning. The initial formalization of the egg-cracking domain has led to the identi cation of unaddressed problems in csr and has provided a testbed for existing theories of action. We report on these and other results in the paper.

Introduction

Research in formal AI abounds in metatheory but rarely tackles object-level commonsense problems that require more than a few axioms to formalize. Instead, AI research focusses on toy problems, such as the blocks world. Such problems are useful in highlighting a speci c well-de ned diculty of an existing logical theory or approach. Often, however, the most interesting aspects of a commonsense problem disappear when the problem is cut down to size. Thus, research in commonsense reasoning (csr) has become very narrow. This paper is part of a group e ort to broaden the scope of research in csr, speci cally by focussing on non-trivial commonsense problems. 1 The problem chosen for the initial e ort is the egg-cracking problem (Davis, 97b); that is, the problem of reasoning that cracking an egg and separating the two parts of the eggshell while holding the egg over a bowl will result in the egg being in the bowl. The egg-cracking problem is a problem of physical csr. The few existing papers in this eld (Hayes, 85b;Davis, 88,93) demonstrate the diculty of formalizing even comparatively simple domains such as over owing bathtubs. It was anticipated from the start that the egg-cracking problem would be considerably 1 This paper represents one of the formalizations developed as part of the group e ort.

more dicult, and initial attempts at formalization would be incomplete. What do we hope to accomplish during these initial stages? (1) A critical mass of research in this area should jumpstart the eld of object-level csr, which has been languishing since the publication of (Moore and Hobbs, 1985) (Davis's papers are a notable exception). (2) We may identify new concrete and tractable problems in csr. For example, the development of the eggcracking domain highlights the need to develop a language in which we can talk about objects that do not last forever and that can exist in many forms. (3) The formalization of non-toy problems can act as a testbed for existing theories of csr. For example, the egg-cracking domain is rich in temporal reasoning, and thus o ers a good way of evaluating existing temporal languages and theories. (4) We can formalize pieces of theories that can be used in other parts of csr. For example, in developing our formalization, we focussed on theories of containers, cracks, and gaps. This paper is organized as follows. The next section presents Davis's egg-cracking problem, discusses our methodology, and suggests criteria for evaluating the resultant formalism. Subsequently, we present the formalization, developing the required (simpli ed) theories of shape, material, and action, as well as furnishing speci c axioms on eggs. Useful lemmas are proved. We then prove the two main (object-level) theorems of the paper. Finally, we evaluate the formalization with respect to the criteria outlined in section 2.

Problem Statement, Methodology, and Evaluation Criteria

Davis's (97b) problem statement reads as follows: Characterize the following: A cook is cracking a raw egg against a glass bowl. Properly performed, the impact of the egg against the edge of the bowl will crack the eggshell in half. Holding the egg over the bowl, the cook will then separate the two halves of the shell with his ngers, enlarging the crack, and the contents of the egg will fall gently into the bowl. The end result is that the entire contents of the egg will

be in the bowl, with the yolk unbroken, and that the two halves of the shell are held in the cook's ngers. What happens if: The cook brings the egg to impact very quickly? Very slowly? The cook lays the egg in the bowl and exerts steady pressure with his hand? The cook, having cracked the egg, attempts to peel it o its contents like a hard-boiled egg? The bowl is made of looseleaf paper? of soft clay? The bowl is smaller than the egg? The bowl is upside down? The cook tries this procedure with a hard-boiled egg? With a coconut? With an M & M? Approach: We interpret the problem as an injunction to develop a formalization that will entail theorems specifying that the standard plan to crack an egg, suggested in the rst paragraph, is feasible and will result in the inside of the egg being inside a bowl, yolk unbroken. The second paragraph gives scenarios that presumably will not work; thus, the theory we develop should at the very least not entail theorems stating that these are feasible egg-cracking plans. Ideally, the theory should entail theorems stating that these are not feasible egg-cracking plans. We develop our ontology and axioms with the aim of proving the following: Given certain initial conditions (there exist a whole, raw egg and a hard, empty, upright bowl), one can perform a plan that will result in the egg being in the bowl, with yolk unbroken. The particular plan we will consider is: A sequence of hitting the egg against a hard surface (edge of bowl), moving the egg to a location above bowl; rotating the egg so that the crack faces down; and opening up the shell, like a hinged box Evaluation: There are obviously many ways to develop an ontology and axioms: one's direction will be partly guided by one's idea of what makes a \good" formalization . We suggest that formalizations should be judged the the following criteria: 1. Epistemological adequacy: (McCarthy & Hayes, 1969) The axioms and theorems should roughly correspond to the way intelligent beings reason about the domain. This argues for using a naive physics (Hayes, 1985a;1985b) and against using Newtonian physics as the basis for one's formalization. (This point is not universally accepted; see, e.g., (Davis, 88;97a)). 2. Faithfulness to the real world: This is not an absolute criterion, since all theories are idealizations to some extent. (In particular, there is some tension between naivete and faithfulness to the world.) 3. Reusability: It should be possible to reuse parts of the theory for other theories of csr. 4. Elaboration tolerance: (McCarthy, 1988) The theory should handle similar problems without needing to rework the entire theory. Davis's second paragraph can be viewed as giving elaborations to the egg-cracking problem. 2 Other elaborations include cracking ostrich eggs and separating yolks from whites. 2

Davis (1997a) has argued

against

aiming to develop

Formalization of Egg Cracking

Logical Preliminaries

We will be using a sorted rst-order logic. x, y, z and o range over objects; r ranges over regions of space; loc ranges over locations. We use an interval-based theory of time, as in (McDermott, 82) or (Davis, 90). i ranges over (closed) intervals, s ranges over time points. In general, predicates are de ned over time points. We will assume that if a predicate holds over all points in an interval, it holds during that interval, unless otherwise noted. start(i) denotes the beginning time point of an interval; end(i) denotes the ending time point of an interval. All formulas are assumed to be universally quanti ed unless otherwise noted. A list of predicates and functions used can be found in the appendix.

Consider the egg

We begin by considering the salient properties of an egg. Much work in physical commonsense reasoning (Davis, 88;90, ch. 7.3) is restricted to reasoning about solid rigid objects. It is often assumed for convenience that such objects are never created or destroyed. This assumption cannot be made here: one of eggs' most salient characteristics is that they break easily. Thus, one must be able to talk about objects that only exist at some period of time. We formalize this by saying that an object may go through stages, including stages where it doesn't really exist in any important sense. In particular, for an egg, we delineate four stages: not yet laid, whole egg, cracked but still holding together, and broken. 3 Thus: Axiom 1 (An egg is not forever:) egg(x) ,NotYetLaid(x,s) _WholeEgg(x,s) _CrackedEgg(x,s) _BrokenEgg(x,s)

In the whole-egg and cracked-egg stages, the egg holds together: The property of togetherness can be useful when reasoning about the location of an egg, or about moving an egg:

Axiom 2 WholeEgg(x,s)

)together(x,s)

_CrackedEgg(x,s)

Also useful is the concept of a package. Intuitively, a package is a collection of items which are in close spatial connection during some interval of time. The predicate package takes three arguments: an object denoting the package, the set of objects which constitute the package, and an interval of time. 4 We consider the inside of an egg to be a package consisting of an egg yolk and an egg white. This is true as long as the egg is whole or cracked (an idealization, but useful). theories that are elaboration tolerant, since this makes an already dicult problem that much harder. 3 We ignore the possible stage where the egg is hatched. 4 There is obviously a close connection, not formalized in this paper, between the predicates together and package.

Axiom 3 (WholeEgg(x,i) _CrackedEgg(x,i) )

package(egginsideof(x),feggyolk(x),eggwhite(x)g,i)

The geometry of an egg

We formalize the geometry of various shapes associated with eggs, speci cally, the shapes of the eggshell and egg inside. The function shape takes two arguments, an object and a time point, and returns a region of space. The concept of a shell is taken from (Davis, 88a) (who labels this concept a \box" ). De nition 1 shell(r) is true i r is an ordinary point set and the complement of r has exactly 2 connected components. Note that one component will be nite (the component \inside" the shell); the other will be in nite (the component \outside" the shell). In other words, a shell de nes a hollowed out container-like shape. inside-of(r) is the closure of the nite component of the complement of r, and outside-of(r) is the closure of the in nite component of the complement of r. We now de ne a shell inside and a lled shell, again borrowing from (Davis, 88).

De nition 2 ShellInside(r1,r2) ,shell(r2) ^r1=inside-of(r2)

shell(r) ,9r1,r2 (shell(r2) ^ShellInside(r1,r2) ^r = r1 [ r2)

The eggshell of a whole egg is shaped like a shell:

Axiom 4 WholeEgg(x,i)

^eggshell(y,x)

)shell(shape(y,i))

The inside of the egg is shaped like a shell-inside:

)ShellInside(shape(y,i),

Thus, we have:

shape(x,i))

^egginsideof(y,x)

Theorem 1 WholeEgg(x,i) )FilledShell(shape(x,i))

There is a strong connection between one shape being inside another shape, and the concept of one object being enclosed by another. This is formalized below:

Axiom 6 inside(shape(y,i),shape(x,i)) ,enclosed(y,x,i)

We then have the following theorem, which follows from De nition 2 and Axiom 6:

Theorem 2 shell(shape(x,i)) ^ShellInside(shape(y,i), shape(x,i)) )enclosed(y,x,i) From Axioms 4 and 5 and Theorem 2 we have the following theorem:

Theorem 3 WholeEgg(x,i)

^egginside(y,x) )enclosed(y,z,i)

We must reason about the material of an egg when planning to crack an egg. Speci cally, eggshells are breakable: raw egg yolks are (semi)-solid; raw egg whites are liquid but have high viscosity. First we have that eggshells are breakable;

Axiom 7 eggshell(y,x) )breakable(y)

If one hits a breakable object against a suciently hard object with the right amount of force, the rst object will be cracked. The function crackforce, (abbreviated cf), given a breakable object and a hard object, returns the proper force necessary to crack the breakable object when hit against the hard object. One must specify the correct amount rather than the minimum amount of force. The point here is to crack the egg, not to shatter it (which would almost certainly result in the yolk being broken). The value returned by cf is an argument to the action hitagainst.

Axiom 8 breakable(x)

^occurs(hitagainst(x,o,cf(x,o)),i) )cracked(x,end(i)))

^hard(o)

If an eggshell is cracked, the egg is a cracked-egg:

Axiom 9 (egg(x) and ^eggshell(y,x) ^cracked(y,i))

)CrackedEgg(x,i)

De nition 3 lled-

Axiom 5 WholeEgg(x,i)

The material of an egg

^eggshell(z,x)

That is, the inside of an egg is enclosed in the eggshell while the egg is whole. 5 5 The proof that the inside of an egg is enclosed in the eggshell while the egg is whole is relatively elegant, relying

Thus, if one hits an eggshell of a whole egg against a suciently hard surface with the proper force, the egg becomes a cracked egg:

Lemma 1 (WholeEgg(x,start(i)) ^hard(o)

^occurs(hitagainst(eggshellof(x),o,cf(eggshellof(x),i)),i) )CrackedEgg(x,end(i))

Proof: Follows immediately from Axioms 7, 8, and 9.

2 This analysis does not take into account various important features of the egg-cracking process, such as the fact that when one hits the egg against a hard surface, the protruding part of the eggshell is hit; that the resulting crack is therefore along the protruding part of the eggshell, and does not go all around the shell. These aspects of egg cracking are left for future work. We now specify the properties of egg whites and yolks. These properties are needed to reason about almost entirely on the spatial characteristics of the eggshell and the egginside. It is surprising in that it makes no mention of the liquid nature of the egg inside or the non-porous nature of the shell. Intuitively, we reason: even though the egg is liquid, it stays inside the shell because the shell is not porous. This line of reasoning does not come into Theorem 3, due to the strength of Axiom 6. Indeed, the fact that the egginside stays in the shape of a shellinside really shouldn't be taken as an axiom, but should be proved from more basic principles, including properties of the material of the egginside and the eggshell. We emphasize this not only to point out an area for future work, but to demonstrate the interplay between a theory's elegance and its accuracy. Often, as in this case, the more elegant theory glosses over important portions of a problem domain.

the possibility of the egg leaking out of the cracked shell:

Axiom 10 (egg(x)

^eggwhite(w,x) )liquid(w,s) ^viscosity(w,s) = high

Axiom 11 (egg(x)

)semisolid(y,s)

^raw(w,s))

^yolk(y,x)

^raw(y,s))

For our purposes, semisolid is as good as solid:

Axiom 12 semisolid(x,s) )solid(x,s) A yolk is not very narrow:

Axiom 13 (egg(x) )larger(y,z)

^yolk(y,x)

^narrow(z))

An egg yolk in a whole egg is never broken:

Axiom 14 WholeEgg(x,s) ):

BrokenYolk(yolkof(x),s)

Both the yolk and white of a raw egg are raw:

Axiom 15 (egg(x)

and

raw(x,s)

^yolk(y,x)

^eggwhite(w,x)) )(raw(y,s) ^raw(w,s))

The initial crack

What happens once the initial crack is e ected? We consider the geometry of a cracked egg|a shell with a small gap|and the behavior of objects with this shape. In particular, we consider objects enclosed in shells with gaps. We begin with the following: De nition 4 Shellgap(r1,r2) i r1 is a shell and r2 is a connected subregion of r1 such that r2 is smaller than r1 - r2. Intuitively, r2 is the \gap." 6

We also have:

De nition 5 Gappedshell(r)

^Shellgap(r1,r2)

,9r1,r2

r

[

r2 = r1

Thus far, we have not speci ed anything in particular about eggshells; we are just taking about the geometrical concept of a shell. These concepts apply to bowls as well as cracked eggs; however, the gap is much larger in a bowl. We still have a concept of a region being inside a gapped shell, and an analogous concept of an object that is enclosed by a container in the shape of a gapped shell. 7 We have the following:

Axiom 16 Shellgap(r1,r2) ^shape(x,i) = r1 ^shellinside(shape(y,i),r1) ) enclosed-gappedshell(y,x,i) enclosed-gappedshell will be abbreviated as enc-gs.

If a package is enclosed by a gapped shell, then all of its constituents are, and vice versa:

We'd actually like to say that r2 is quite a bit smaller than r1 - r2. In addition, we'd like to specify that the gap doesn't go all around the shell, so that we can talk about the direction of the gap (see above). 7 In a later version, we will de ne the predicate inside-gappedshell and state an axiom connecting insidegappedshell and enclosed-gappedshell. 6

Axiom 17 package(y,S,i) ) (enc-gs(y,x,i) ,8 s 2 S enc-gs(s,x,i))

We make the following oversimpli cation: if a gapped shell partly encloses something and the gap of the gapped shell faces up, the object continues to be partly enclosed by the gapped shell as long as the gap faces up. (This is true only if the gap is small relative to the gapped shell and to the partly enclosed object; the nature of the partly enclosed object (whether liquid or solid) also a ects the truth of this statement.)

Axiom 18 (Gappedshell(shape(x,i))

^up(gap(x,i),i) ^enc-gs(y,x,start(i))) )enc-gs(y,x,end(i))

What happens to an enclosed object if a gapped shell is turned so that its gap faces down? It depends on the size and nature of the object, the size of the gap, and how long the gap faces down. We won't do a full analysis here; but give some sucient conditions for predicting that an object will fall out or remain inside the gapped shell. Speci cally:  if the object is solid and smaller than the gap, it will fall through 8 the gap  if the object is solid and larger than the gap, it will stay enclosed by the gapped shell  if the object is liquid, the viscosity is high, the gap is narrow, and the time interval during which the gap is turned down is short, the object will stay inside the gapped shell. 9 10  If the object is liquid, the viscosity is low, and the time interval during which the gap is turned down is long, the object will fall through the gap

Axiom 19 Gappedshell(shape(x),i)

^enc-gs(o,x,start(i)) ) (solid(o) ^larger(o,gap(x,i)) ) enc-gs(o,x,end(i)) ^ (solid(o) ^smaller(o,gap(x,i)) ) fall-through(o,gap(x,i),i)) ^

^down(gap(x),i)

^duration(i)=long)

8 Actually, this is true only if there are no other objects blocking the gap. We ignore this for now. 9 Thus, the egg white doesn't leak through a cracked egg if the egg is held cracked side down for a short period of time. Over a long period of time, the egg white leaks out. 10 This \fact" runs afoul of the heap (Sorites) paradox. This paradox is embodied by the sentences: a. a grain of sand is not a heap. b. if one takes one grain away from a heap of sand, one still remains with a heap. The paradox arises because one can repeatedly remove one grain of sand from a heap; by principle b, one still remains with a heap of sand. But at one point, one will be left with one grain of sand, which by a., is not a heap. Similarly, in the leaking cracked-egg case: If we say that the egg white will not leak through the crack during a short interval, and repeatedly apply this fact, we can conclude that the egg white does not leak out during an arbitrarily long interval. We will ignore this paradox in this preliminary work, but it is clear that we have to deal with this problem at some point. This will require a formalization of small and large quantities and is likely to be messy and inelegant.

(liquid(o) ^viscosity(o)=high ^duration(i)=short ^narrow(gap(x,i))) )enc-gs(o,x,end(i))) ^ (liquid(o) ^viscosity(o)=low ^duration(i)=long) ) fall-through(o,gap(x,i),i))

From Axiom 19 and Axiom 17, we then have the following theorem:

Theorem 4 Gappedshell(shape(x),i) ^down(gap(x),i) ^enc-gs(y,x,start(i)) ^package(y,S,start(i)) ) 8o 2 S (solid(o) ^larger(o,gap(x,i)) )enc-gs(o,x,end(i)) ^ (solid(o) ^smaller(o,gap(x,i)) ^duration(i)=long) )fall-through(o,gap(x,i),i)) ^ (liquid(o) ^viscosity(o)=high ^duration(i)=short ^narrow(gap(x,i))) )enc-gs(o,x,end(i))) ^ (liquid(o) ^viscosity(o)=low ^duration(i)=long) )fall-through(o,gap(x,i),i)) We specify the shape of a cracked egg:

Axiom 20

CrackedEgg(x,i) )Gappedshell(shape(eggshellof(x),i)) ^narrow(gap(eggshellof(x),i))

Finally, we assume:

Axiom 21 Gappedshell(shape(x,i)) ) 9i1 ; i2 ; : : : ; in ([i1; i2 ; : : : ; in ] = i ^ 8i' 2 fi1 ; i2; : : : ; in g (up(gap(x,i'),i') _down(gap(x,i'),i'))

This says that if an object x is in the shape of a gapped shell during the interval i, then one can divide the interval into a sequence of subintervals such that for each of the subintervals, the gap either faces up or down during the entire subinterval. We can now prove that if one with all due speed moves a cracked egg from the side of a bowl to a location above the bowl, neither the egg yolk nor white will leak out:

Lemma 2 CrackedEgg(x,start(i)) ^raw(x,i) ^ enc-gs(x,egginsideof(x),start(i)) ^ occurs(move(x,loc),i) ^duration(i)=short )enc-gs(x,egginsideof(x),end(i)) Proof: From Axiom 20, we know that the eggshell of

x is in the shape of a gapped shell. From Axiom 21, we know that there is a nite sequence of subintervals constituting the interval i, such that for each subinterval, the gap of the eggshell faces up or down. Consider the rst such subinterval, 1 . If the gap faces up, we can show using Axiom 18 that the egginside is enclosed at the end of 1 . Suppose the gap faces down. We must then consider both the yolk and the white. The yolk is semi-solid and is larger than the crack; thus it will remain enclosed at the end of 1 (follows from Axiom 11, Axiom 12, Axiom 13, and Axiom 19). The white is liquid but of high viscosity and will remain enclosed during the short interval ( 1 is11 short since it is a subinterval of i, which is short). (Follows from Axiom 10 and Axiom 19.) i

i

i

i

11 This proof does not violate the spirit of the heap paradox's solution, since the entire interval is short.

Thus, from Axiom 17 and Axiom 3, and Theorem 4, the egginside is still enclosed by the gappedshell at the end of subinterval 1. This argument can be repeated for each of the subintervals. Thus, the egginside remains enclosed at the end of the move action. 2 Note that we can prove a stronger lemma, namely Lemma 2 without the requirement that the egg is raw, if we add the facts that a non-raw eggwhite is solid, and that the solid eggwhite is larger than a narrow crack. i

Opening up the egg

To get the egg out of the shell, one turns the egg so that its crack faces down and then \separates the shell." This is actually akin to the opening of a box or shell along a hinge. (Think of the hinge as being along the \line"of the original crack; it becomes smaller and smaller as the shell is opened up and the crack is extended. Finally, the hinge breaks, and the cook is left with two eggshell pieces.) An accurate formalization of opening the hinged-shell would require an analysis of the shape of a hinged shell, and of the way the shape changes as the shell is opened. This is beyond the scope of this paper, and is left to future work. If one does the action of opening up the shell while the crack is down, the partly enclosed object will fall to the object directly below it. The action openshell takes two arguments, an object and a direction and is de ned only if the object is a gapped shell.

Axiom 22 (occurs(openshell(x,down),i)

^above(x,o,i) ^enc-gs(y,x,start(i))) )occurs(fall-onto(y,o,i))

If an object falls onto a at surface during some interval, it is on that surface at the end of that interval. On the other hand, if the object falls into a gapped shell whose gap is up, and the gapped shell is not overly full, the object will be enclosed by the gapped shell.

Axiom 23 occurs(fall-onto(x,o,i))

)( at-surface(shape(o,i)) )on(x,i,end(i)))) ^(Gappedshell(shape(o,i)) ^up(gap(o,i),i) ^smaller(y,gap(o,i),i) ^(capacity(o,start(i))  con-

tents(o,start(i)) + vol(x)) )enc-gs(y,o,end(i)))

Bowls are gapped shells and normally have their gaps up:

Axiom 24 bowl(o) )Gappedshell(shape(o,s)) Axiom 25 bowl(o) ^upright(o,s) )up(gap(o,s),s) Empty bowls have nothing in them:

Axiom 26 bowl(o) ^empty(o,s) )contents(o,s) = 0

If a package falls onto something, all of its constituents fall onto that thing:

Axiom 27 (package(y,S,i) ^occurs(fall-onto(y,o),i)) )8x 2

S occurs(fall-onto(y,o),i)

Thus, if one opens up a cracked egg shell while the egg is over a upright bowl and the crack is turned down, and the bowl is empty, then the egg yolk and egg white are enclosed by the bowl.

Lemma 3 CrackedEgg(x,start(i))

^occurs(openshell(eggshellof(x),down),i) ^enc-gs(yolkof(x),start(i)) ^enc-gs(eggwhiteof(x),start(i)) ^above(x,o,i) ^bowl(o) ^upright(o) ^empty(o,start(i)) ^capacity(o)  vol(x) )

enc-gs(yolkof(x),o,end(i))

Proof: Follows from: Axioms 19, 23, 24, 27, 26 and 3.

An Abbreviated Theory of Action

Feasible Plans We aim to show that the classic egg-

cracking plan is feasible and results in the egg being in the bowl. A full theory of plan feasibilty is beyond the scope of this paper; we focus here only on physical feasibility for a restricted class of single-agent plans (see (Morgenstern, 88) for the full theory). Single agent plans are de ned as follows: if act is an action, then act is a plan; if pln1 and pln2 are plans, then seq(pln1,pln2) is a plan; if c is a sentence of our language, and pln1 and pln2 are plans,then cond(c,pln1,pln2) is a plan; (don't need while loops and concurrency in this paper). The physical feasibility of single-action plans is generally given by speci c domain axioms (see next subsection). The physical feasibility of plan sequences is given by the following axiom: )physfeas(pln2,end(i)) )

De nition 6 Occurs(qmove(x,loc),i)

,Occurs(move(x,loc),i) ^duration(i)=short

We thus have the following lemma:

Lemma 4 CrackedEgg(x,s)

)physfeas(qmove(x,loc),s)

Similarly for ipping objects:

Axiom 33 together(x,s) )physfeas( ip(x),s) De nition 7 Occurs(q ip(x),i) ,Occurs( ip(x),i)

^duration(i)

^enc-gs(eggwhiteof(x),o,end(i))

Axiom 28 (physfeas(pln1,start(i))

A quick-move (qmove) is a move which has a short duration:

^(occurs(pln1,i)

physfeas(seq(pln1,pln2),start(i))

Axiom 28 requires a branching time ontology; otherwise will allow trivial plans to be feasible. The feasibility of conditional plans is given by:

Axiom 29 A plan of the form cond(c,pln1,pln2) is

physically feasible if the following is true: if c is true, then pln1 is physically feasible; if c is false, then pln2 is physically feasible

Feasibility of individual actions

To prove that the egg-cracking plan is feasible, we will have to show that each of the actions is feasible. The null action is always feasible:

Axiom 30 Physfeas(null,s)

It is feasible to hit an object with a given force:

Axiom 31 Physfeas(hit-against(x,o,f),s)

It is feasible to move an object if the object is in one place. Thus, one can move a whole egg or a cracked egg, though not necessarily a broken egg:

Axiom 32 together(x,s) )Physfeas(move(x,loc),s)

= short

We thus have the following lemma:

Lemma 5 CrackedEgg(x,s) )physfeas(q ip(x),s)

It is physically feasible to open up the shell of a raw cracked egg. It's not feasible to open up the shell of a whole (uncracked) egg, or of a cooked cracked egg; this is beyond the scope of this paper.

Axiom 34 (CrackedEgg(x,s)

^down(gap(eggshellof(x,s)),s) )physfeas(openshell(x,down),s)

^raw(x,s))

Similar axiom for up, of course.

Other axioms on actions

The e ect of moving an object to a location:

Axiom 35 occurs(move(x,loc,i)) )at(x,loc,end(i)) Axiom 36 (at(x,loc,s) ^above(loc,o,s))

)above(x,o,s)

Flipping a gappedshell means that the crack changes from up to down (and vice versa):

Axiom 37 Gappedshell(shape(o,start(i)))

^up(gap(o,i),start(i)) ^occurs( ip(o),i) )down(gap(o,i),end(i))

The Frame Problem Since the egg-cracking do-

main is rich in temporal reasoning, we need to deal with the frame problem (McCarthy & Hayes, 1969) in some way. That is, we need to prove that the world doesn't change in unexpected ways. For example, we need to know that cracking an egg doesn't cook it; that ipping an egg doesn't cause the bowl to change its shape. Research in the frame problem has occupied a central position in the formal AI community, so much so that it can be dicult to look at a problem that has a temporal component without seeing it as primarily a problem of temporal reasoning. Indeed, the other formalizations of the egg-cracking domain have centered around temporal formalisms that have been shown to deal with the frame problem. We decided not to take this approach: rst, because we believe that temporal reasoning is only one of the many interesting aspects of this domain, and we did not want to give it undue weight; second, because a rich domain like egg-cracking can provide a testbed

for existing temporal theories much more so than the set of benchmark problems that have previously been suggested (Sandewall, 94). Deciding beforehand on a particular temporal theory would a ect the way we approached the problem and wrote down axioms; we preferred to use a neutral temporal language and to subsequently attempt to apply a solution to the frame problem to our formalization. (This would ideally require a rewriting of axioms, since solutions to the frame problem generally rely on extensive rei cation, but should not require a substantial change in the axioms). After completing our formalization, we considered several solutions. It became quickly evident that many solutions (Stein & Morgenstern, 94; Lifschitz et al., 91) were insuciently expressive. The most promising candidate was Shanahan's (97) solution, both because it addressed both major parts of the frame problem (minimizing unexpected changes; minimizing unexpected occurrences), and because it is based on a rich temporal theory that allows representation of continuous action and triggered events. Our initial results in this translation e ort have been mixed. A direct rewriting has sometimes not been possible (particularly when an event is triggered by some combination of uents and actions), and our formalization has had to be considerably reworked. How this can be xed is a subject of current research. Failing a successful translation to a \good" solution to the frame problem, we fell back on a more traditional approach: writing down frame axioms. We used the approach suggested by Davis (90) and Schubert(90); writing down axioms that say that the only way for a uent to change is for a particular event to happen (explanation closure). The axioms required are roughly proportional to the number of uents. We don't write down these axioms here, due to space constraints, but they are straightforward. Frame axioms in themselves still do not solve the problem, since unexpected actions may still occur. We can solve this diculty either by disallowing concurrent actions or by minimizing the Occurs predicate.

Proving the egg-cracking theorem

One starts with the following assumptions. S is the initial time point.

Assumption 1 Assumption 2 Assumption 3 Assumption 4 Assumption 5 Assumption 6 Assumption 7 Assumption 8

bowl(B) upright(B,S) empty(B,S) hard(B) WholeEgg(X,S) raw(X,S) above(Loc,B,S) capacity(B)  vol(X)

We wish to prove the following theorems:

Theorem 5 Physfeas( (seq

hit-against(eggshell(X),B,cf(eggshell(X),B))), qmove(X,Loc), cond(:down(gap(X,NOW)),q ip(X)), openshell(X,down)), S) Theorem 6 occurs( (seq hit-against(eggshellof(X),B,cf(eggshellof(X),B))), qmove(X,Loc), cond(:down(gap(X,NOW)),q ip(X)), openshell(X,down)), i) ) enc-gs(yolkof(X),end(i)) ^encgs(eggwhiteof(X),end(i)) ^:broken(yolkof(X),end(i)) Proof of Theorem 5: Axiom 31 gives us that the rst

action in the plan is feasible. As a result, the egg is cracked (Assumptions 4, 5, and Lemma 1). By Lemma 4, can do the second act of the plan, the quick move. The egg is still cracked in the resulting situation (appropriate frame axioms). Now for the third action: Either the gap is up or down (Axiom 21). If down, third action is just null, which is feasible by Axiom 30. If up, third action calls for a quick ip, which is feasible by Lemma 5. So, the conditional action constituting the third step of the plan is feasible by Axiom 29. As a result of doing this action, the crack faces down (Axiom 37). So, the nal step in the plan is now feasible, by Axiom 34. Repeated applications of Axiom 28 show that the entire sequence is feasible. 2 Proof of Theorem 6: The egginside is inside the whole egg, in the starting situation (Assumption 5, Theorem 3). By using appropriate frame axioms, one can show that the egginside is still inside the egg after the initial crack (end of rst step). By Lemma 2, we know the egg yolk and egg white stay inside after the quick move. A similar argument can be made to show the egg yolk and egg white stay inside after the ip action (Theorem 4). Thus, by Lemma 3, can show that after the openshell action, egg yolk and egg white are in bowl. To show egg yolk unbroken, repeatedly apply frame axioms. 2

Evaluation

The formalism presented here is based on a de nitely naive physics and incorporates many basic principles that people use when reasoning about egg cracking. It is, of course, incomplete, and does not yet incorporate many aspects of egg cracking such as the position of the egg in the cracker's hands. The formalization is by and large faithful to reality, although some simpli cations (noted in the text) are made. The beginnings of theories on shape and containment are included in the text; these should prove useful in developing future csr theories, although this point needs to be considered after future research. How elaboration tolerant is this formalization? Consider Davis's second paragraph. Some elaborations are easy to handle. We can easily specify that if the force used is greater or smaller than crackforce, the egg will not be cracked; we must explicitly specify what does

happen if the force is too great or small (shatters or nothing). Di erent materials: looseleaf paper and soft clay are not hard; thus, the theory will not entail that hitting the egg against these objects will crack them. To get the conclusion that if a cracked egg is opened into a paper bowl, the egg will leak through, we must add axioms on porosity. It be easy to deal with an upside-down or too small bowl. Some elaborations are dicult. To reason about hard-boiled eggs and coconuts, we must specify how a shell is attached to a shell-inside. Doing so is not trivial. Other dicult elaborations include slowly pressing on the egg with one's hand and separating yolks and whites. Many basics are in place, but much remains to be done. This is hardly surprising; we cannot expect a full- edged theory of csr to be developed in a short period of time. How does this di er from previous work? Sadly, there is little previous work in this area. Hayes (85b) published a formalization of a single domain (liquids); Davis has published more, but these still number less than a dozen. (His philosophy is also quite di erent, since he argues against naive physics and does not endorse the goal of elaboration tolerance.) There has been much formalization done by the CYC group (Lenat and Guha, 90); due to a lack of publication of large-scale formalizations it is dicult to compare to our work. However, Hayes (98) has remarked that our line of work is substantially di erent due to its rejection of ad hoc statements and its attempt to build domain-speci c facts out of more basic principles. What, in the nal analysis, have we accomplished? We have constructed a formalization which entails some basic theorem about egg-cracking; we have shown that the formalism can be extended to deal with some similar problems with relative ease. We have identi ed several interesting problems in csr research, and have provided a rich testbed for theories of action. None of these is the sort of elegant, breathtaking result that one nds in research in metatheory; perhaps this is why so little object-level research is done. Ultimately, though, large-scale object-level research must be done, if logicist AI is ever to break free of the blocks world and to contribute to the construction of useful systems that are truly arti cially intelligent.

References

E. Davis: The Kinematics of Cutting Solid Objects, AMAI, 1993. E. Davis: A Logical Framework for Commonsense Predictions of Solid Object Behaviour, AI and Engineering, 3,3,125-140,1988. E. Davis: The Naive Physics Perplex,1997. E. Davis: Physical Reasoning:Cooking Problem, at http://www.dcs.qmw.ac.uk/conferences/CS98 /problems/Davis2.html. E. Davis: Representations of Commonsense Knowledge, Morgan Kaufmann, 1990.

P. Hayes: The Second Naive Physics Manifesto, in Hobbs and Moore: Formal Theories of the Commonsense World, Ablex, 1985. P. Hayes: Naive Physics I: Ontology for Liquids, in Hobbs and Moore: Formal Theories of the Commonsense World, Ablex, 1985. P. Hayes: Personal communication, 1998. D. Lenat and Guha: Building Large Knowledge-Based Systems, Addison-Wesley, 1990. J. McCarthy: Mathematical Logic in AI, Daedalus, Winter 1988. J.McCarthy and P. Hayes: Some Philosophical Problems from the Standpoint of AI, Machine Intelligence, 1969. Drew McDermott: A Temporal Logic of Processes and Plans, Cognitive Science, 1982. L. Morgenstern: Foundations of a Logic of Knowledge, Action, and Communication, Ph.D. thesis, NYU, 1988. E. Sandewall: Features and Fluents, Oxford University Press, 1994. L. Schubert: Monotonic solution of the frame problem in the situation calculus, in Kyburg et al. (eds): Knowledge Representation and Defeasible Reasoning, Kluwer, 1990. M. Shanahan: Solving the Frame Problem, MIT Press, 1997. L. Stein and L. Morgenstern: Motivated Action Theory, Arti cial Intelligence, 1994.

Appendix: Predicates and Functions

Predicates are in italics; functions in roman.

Time: precedes(i,j) occurs(act,i) start(i) end(i) duration(i) Eggs:

egg(x) NotYetLaid(x,s) WholeEgg(x,s) CrackedEgg(x,s) BrokenEgg(x,s) egginside(y,x) (egginsideof(x)) eggshell(y,x) (eggshellof(x)) raw(x,s) eggwhite(y,x) (eggwhiteof(x)) eggyolk(y,x) (yolkof(x)) BrokenYolk(y,s)

Shape, Regions:

shell(r) ShellInside(r1,r2) FilledShell(r) shape(r,s) shellgap(r1,r2) brokenshell(r1,r2) gappedshell(r1,r2) up(g,s) down(g,s) atsurface(r) inside-of(r)

Shape, Objects:

narrow(x) larger(x,y) smaller(x,y) enclosed(y,x,s) encgs(y,x,s) empty(o,s) up down capacity(o) contents(o,s)

vol(x) gap(x)

Materials:

solid(x,s) semisolid(x,s) liquid(x,s) breakable(x) hard(x) cracked(x,s) crackforce(x,o) viscosity(x)

Actions and Plans:

hitagainst(x,o,f) fallthrough(o,g) fallonto(o,x) move(x,loc) qmove(x,loc) ip(x) q ip(x) openshell(o,direction) physfeas(plan,s)

Miscellaneous:

together(x,s) package(x,S,s) above(y,x,s) bowl(o) upright(o,s) at(x,y,s)

Suggest Documents