From: AAAI-00 Proceedings. Copyright © 2000, AAAI (www.aaai.org). All rights reserved.

Open World Planning in the Situation Calculus

Alberto Finzi and Fiora Pirri Ray Reiter Dipartimento di Informatica e Sistemistica Department of Computer Science UniversitaÁ degli Studi di Roma ªLa Sapienzaº University of Toronto

Via Salaria 113, 00198 Roma, Italy Toronto, Canada, M5S 1A4

alberto,®ora ¡ @assi.dis.uniroma1.it [email protected]

Abstract sensing actions, knowledge, etc, but in all cases, its basic in- gredients consist of actions, situations and ¯uents. We describe a forward reasoning planner for open worlds that uses domain speci®c information for pruning its search space, Actions Actions are ®rst order terms consisting of an ac- as suggested by (Bacchus & Kabanza 1996; 2000). The plan- tion function symbol and its arguments. In the blocks world,

ner is written in the situation calculus-based programming § the action of moving block ¦ onto block might be denoted language GOLOG, and it uses a situation calculus axiomati- by the action term ¨ © ¤ ¦§ .

zation of the application domain. Given a sentence ¢ to prove,

the planner regresses it to an equivalent sentence ¢¤£ about the Situations A situation is a ®rst order term denoting a se-

initial situation, then invokes a theorem prover to determine quence of actions. These sequences are represented using a

¢ ¢

whether the initial database entails £ and hence . We de- © binary function symbol © : denotes the sequence

scribe two approaches to this theorem proving task, one based  resulting from adding the action  to the sequence . So

on compiling the initial database to prime implicate form, the

© !" # %$"'& other based on Relsat, a Davis/Putnam-based procedure. Fi- © is like LISP's , or Prolog's . The

nally, we report on our experiments with open world planning special constant (") denotes the initial situation, namely the * based on both these approaches to the theorem proving task. empty action sequence, so (") is like LISP's or Prolog's

#+& . Therefore, in a blocks world, the situation term

Introduction ©¨ © ¤ -,./01©¨2© ¤ 13*©3*456 /. 

7©¨2©  ¤809: ( ;; Currently, virtually all implemented deterministic planning ) systems make a closed world assumption that complete in- denotes the sequence of actions

formation is available about the initial state of the applica- #<¨2©  ¤809: ¨2©  3*©3*456 /= ¨2© ¤ >,?/0&;@ tion domain. Conformant Graphplan (Smith & Weld 1998), CMBP (Cimatti & Roveri 1999) and the planner of (Rintanen Notice that the action sequence is obtained from a situation 1999) are exceptions to this. So also are a few conditional term by reading the term from right to left. planners incorporating ªinformation gatheringº actions, used Foundational axioms for situations are given in (Pirri & to ®ll gaps in the planners' incomplete knowledge base (e.g. Reiter 1999). (Golden, Etzioni, & Weld 1994; de Giacomo et al. 1997)). Fluents Relations whose truth values vary from state to Open worlds preclude direct appeal to most planning algo- state are called ¯uents, and are denoted by predicate sym- rithms in the literature, including the successful SAT (Kautz bols with last argument a situation term. For example, in the

& Selman 1996) and Graphplan (Blum & Furst 1997) ap- blocks world, © !A¦§B might be a relational ¯uent, mean-

proaches. ing that in that state of the world reached by performing the

¦ § In this paper, we describe the theoretical foundations and action sequence  , block will be on block . implementation for an open world planner without sensing actions; its job is to ®nd straight line plans using only what Axiomatizing a Domain Theory is known about the (incomplete) initial state, together with A domain theory is axiomatized in the situation calculus general domain speci®c facts like state constraints and ac- with four classes of axioms (More details in (Pirri & Reiter tion preconditions and effects. Ours is a forward reason- 1999)): ing planner, using domain dependent information to prune

its search space, as suggested by (Bacchus & Kabanza 1996; 1. Action precondition axioms. There is one for each action ¦D

2000); it is axiomatized entirely in the situation calculus. function ,.C , with syntactic form

E

¦"1GFIHKJ*C¦" @

The Situation Calculus and GOLOG © -,.C

J

C¦L Here, H is a formula with free variables among

The situation calculus (McCarthy 1963) is a ®rst order lan-

¦"@ , C These characterize the preconditions of the action . guage for axiomatizing dynamic worlds. In recent years, it 2. Successor state axioms. There is one for each ¯uent

has been considerably extended beyond the ªclassicalº lan- M ¦"

guage to include concurrency, continuous time, processes, C , with syntactic form

M

¥

¦©4N;AFPOQ*C¦R4D 

Copyright c 2000, American Association for Arti®cial Intelli- C ¦4D gence (www.aaai.org). All rights reserved. where OQ*C is a formula with free variables among

M

¦L@ ds"tG@  t 4DC These characterize the truth values of the ¯uent 1. Sequence: Do action , followed by action .

in the next situation ©4D in terms of the current situ- u 2. Test actions: uNv Test the truth value of expression in the ation  , and they embody a solution to the current situation.

for deterministic actions (Reiter 1991).

 t 3. Nondeterministic action choice: w$ tG@ Do or . 3. Unique names axioms for actions. These state that the

actions of the domain are pairwise unequal. 4. Nondeterministic choice of action arguments: xy¦D; .

Nondeterministically pick a value for ¦ , and for that value

4. Initial database. This is a set of ®rst order sentences  of ¦ , do the action .

whose only situation term is (") and it speci®es the initial state of the domain. 5. Procedures, including recursion. The semantics of GOLOG programs is de®ned (see Example 1 The following are successor state and action (Levesque et al. 1997)) by macro-expansion, using a

precondition axioms for a blocks world used in the imple- 9:©zuNU ©1{WU 47¨| }- ternary relation 9:© . is an abbrevia- mentation described below. tion for a situation calculus formula whose intuitive mean-

Action Precondition Axioms ing is that  } is one of the situations reached by evaluat-

E 

ing the GOLOG uDU ©1{oU 4¨ , beginning in situation . There-

© ¨ © ¤ ¦§ SFT 6 4U¦WV [

fore, to execute uNU ©1{oU 4¨ , one proves, using the situation §B

6 4U§WRVX¦ZY calculus axiomatization of some background domain (e.g. E

© ¨ © ¤ 13*©3*475'6 ¤¦N1SFT 6 47U¦RWV the axioms of Example 1), the situation calculus formula

\

© !D3*456 ¦ @  ]W;9:©~uDU ©1{oU 4¨d(")W . Any binding for obtained by a constructive proof of this sentence is an execution trace, in Successor State Axioms

terms of the primitive actions, of the uNU ©1{WU 47¨ . A GOLOG '6 4U¦R©4D;AF

interpreter, written in Prolog, is described in (Levesque et al.

[

#^]W_¤`4 ¨2©  ¤§W_¤Wa

]W§ 1997); this is the implementation used for our planner.

[

4 ¨2©  3*©3*456 §&RVX© !A§W¦¡ba

[

\

]W§;4 ¨ © ¤ §W¦D 

6 47U¦R"V A Depth-First Forward Planner

[ ¨2©  ¤¦R§¤a

© !A¦R§W©4D`cFT4 We can now present our planner, written in GOLOG.

[

© !A¦§B"VX4dY ¨2© ¤ 13*©3*456 ¦DWV

proc *`uN€!"

[

\

]B_¤;4 ¨ © ¤ ¦_ 

{o© 46v‚$ #

\

[

5 4(A†^nmD4‡n†© !"vKs*`uN€!‰ˆ‹Š&

© !D3*456 ¤¦R©4D;AFT4 ¨2© ¤ 13*©3*456 ¦DSa [

\ endProc © !D3*456 ¤¦RV ]W§;4 ¨ © ¤ ¦§ @

1 !

K;uD€R!" expects the user to provide , a depth bound,

uDU †¨ †^n† ¤ 4 `n†© ! Planning in the Situation Calculus {W© 46 , a planning goal, , a predicate char- acterizing what are the primitive actions of the domain, and The classical de®nition of planning is (Green 1969). ®nally, an axiomatization of a domain dependent predicate

De®nition 1 Plans 5147(A†ŒnmN4‡n†© ! , used to ®lter out partial plans that are known

Let e be a background situation calculus axiomatization for to be fruitless.

some domain, and f: a situation calculus formula ± the Like any GOLOG program, the planner is executed by ]W;9:©K;uD€R!" (")W

goal ± with one free situation variable  . A situation term proving . Therefore, we start with

©g"©RgBhRi jjj©ki ( "jjj ; (  )

) that mentions no free as the current situation. In general, if is the current

*`uN€!" {o© 46;"

variables is a plan for f iff situation, succeeds if can be proved, or

!Žƒ„ 4

[ if and a primitive action can be chosen (nonde-

E

el$ ¦D  1mn456 ©Rg"©gWhi'jjj7©ki( "jjj `; )

terministically) such that © 4D" is provable and such

g gWhi i

VXf:7© © jjj`© (") Ljjj `; @ ©4D"

that after ªperformingº 4 , meaning that becomes

\ ¦N  mon475'6

Here, the expression is an abbreviation the new current situation, 5 4(A†^nmD4‡n†© !A7©4D"` can be

E E

i i

©  (")1pV © Aq© (") `pV jjjrV 7©4D"

for proved, and *`uN€!ˆ‘Š succeeds with as the cur-

E

g gBhRi i

© jjj© (")"jjj ; @ © ¤ So on this rent situation. On success, the current situation is a plan for

de®nition, planning is a theorem-proving task: the {o© 46 . Therefore, the planner works depth-®rst, gener-

i g @@@

Determine a sequence  of variable free action ating subplans by increasing length, ®ltering these with the

g gWhi i

f:© © jjj7© (")"jjj ;`

terms such that 5147(A†ŒnmN4‡n†© ! predicate, and testing the survivors against

e 5 4(c†ŒnmD4 n†© ! is provable from the background axioms , and moreover, the {o© 46 . The ®lter is our version of Bacchus this action sequence is executable, meaning that each of its and Kabanza's use of domain speci®c information for prun- action's preconditions are provable in that situation in which ing the search tree of bottom-up planners (Bacchus & Ka- it is to be performed. This is the formal foundation for our banza 2000). open world planner. A Regression-Based Theorem Prover GOLOG

The planner *`uN€ generates potential plans of the form

g i

@@@© (") Ljjj  ’ Our planner is implemented in the situation calculus-based © , where the are action

programming language GOLOG (Levesque et al. 1997), a terms; then it tests these potential plans against {W© 4¤6

language for de®ning complex actions in terms of a set of and 5 47(A†ŒnmN4‡n†© ! . So the test expressions that must be

g i

@@@© (")Ljjj ; primitive actions axiomatized, as described above, in the sit- proved are of the form “”© , uation calculus. It has the standard ± and some not so stan- dard ± control structures found in most Algol-like languages. 1 •–—˜š™ stands for the World's Simplest Depth First Planner  for formulas “” with a single free situation variable . The following are the top-level Prolog

These› are the kinds of sentences for which regression was clauses in our implementation for the regres- designed (Pirri & Reiter 1999). Essentially, regression uses sion theorem-prover prove, as just described:

successor state axioms to replace a sentence of the form

g i

@@@© (")Ljjj ; “”© by a logically equivalent A Regression Theorem Prover sentence about the initial situation only, and the original sentence is provable iff the regressed sentence is provable prove(W):- eliminateQuantifiers(W,I), using only the initial database together with the unique simplify(I,Simp), regress(Simp,R), names axioms for actions. So our strategy will be this: clausalForm(R,Clauses), databaseEntails(Clauses).

1. Eliminate the quanti®ers in the sentence

“”©g"@@@;©ki( "jjj ; ) . Here, we insist that regress(P & Q, R) :- regress(P,R1), all quanti®ers be typed, and that these types range over (R1 = false, R = false, ! ; regress(Q,R2), simplify(R1 & R2,R)). ®nite domains of constants. Formally, a type œ"¦N is an abbreviation for a description of a ®nite domain of regress(P v Q, R) :- regress(P,R1), (R1 = true, R = true, ! ;

constants: regress(Q,R2), simplify(R1 v R2,R)).

[ [

[ regress(-P,R) :- regress(P,R1),

¦ 3icaZjjj aX¦ 3D W œ"¦NAžŸ simplify(-R1,R).

where 3Ri@@@`3N are all constants. Now, introduce typed regress(A,R) :- isAtom(A), A <=> W, ]W¦X£œW quanti®ers ^¡¢¦|£¤œW and according to: % A is a defined atom. % Retrieve and regress its definition.

[ eliminateQuantifiers(W,I),

^¡"¦X£¤œW;¤A¦NAžŸ ^¡¢¦D @<œ"¦N¥I¤A¦D  simplify(I,S), regress(S,R).

[ regress(A,R) :- isAtom(A), not A <=> W, ]W¦D @<œ"¦N"VX¤A¦D @ ]W¦d£œW;¤A¦NAžŸ % A is an atom, but it has no definition, Then typed quanti®cation of formulas can be reduced to % so the regression is finished. conjunctions and disjunctions according to the following (A = false, R = false, ! ; R = A). equivalences Here, databaseEntails(Clauses) is a call to a the-

^¡"¦X£¤œW @<¤A¦NAFT¤A-3iRVZjjjVX¤A-3D 7  orem prover for determining whether Clauses are a logi-

i

RaZjjja‘¤A>3  @ ]W¦d£œW @<¤A¦DAF¦¤A>3 cal consequence of the clauses for the initial database. The Therefore, quanti®er elimination for the sentence precise details of this theorem prover are still open; to com-

plete the implementation, this must be speci®ed, and that is

“”©g"@@@;©ki( "jjj ; ) amounts to replac- the topic of the next section. ing “ 's quanti®ed subformulas by conjunctions and disjunctions according to these equivalences. Theorem Proving in the Initial Database 2. Regress the resulting sentence to a sentence about the ini- tial situation only. For open world planning, our task is to imple- ment a theorem prover for determining whether 3. Convert the regressed sentence to clausal form. databaseEntails(Clauses), as required by the 4. Determine whether all clauses of this clausal form are en- regression-based theorem prover. Here, Clauses are the tailed by the initial database. If so, report QED; else report clauses obtained by regressing the expression to be proved. failure. Our overriding concern must be to make this theorem proving task as ef®cient as possible because the prover will This is what our implementation does, with one important be called each time a test expression must be evaluated, and difference: Rather than regress the entire sentence to the ini- in the process of searching for a plan, such test expressions

tial situation, it does a depth ®rst regression of the compo- (e.g. © !A4D5 ©¨2© ¤  ‡ ©¨ © ¤ 13*©3*475'6 ¤ (")`; ) nents of the sentence, hoping that the regressed component are generated and tested a huge number of times. We have will simplify in such a way that the remaining components experimented with two approaches, one based on compiling

need not be regressed. For example, suppose, in regressing E

E the initial database to prime implicate form, the other using

¨ ¨ €D4¤6 VX§ we ®rst regress to get . If simpli®es to , an on-line theorem prover.

there is no point in next regressing § , since in any event, the

E €D46 regressed form of V:§ will be . There is a dual prin-

E Prime Implicates and Compiling an Initial

ciple for regressing formulas of the form a § . Database Regression requires successor state axioms, and we al-

low for these by user-provided Prolog assertions of the form We begin with the initial database, which, being open world, ( Atom <=> Expression. Now we can describe the ®- can be any sentences about ) . Our approach is to transform nal details of the regression theorem prover. In regressing an these sentences into their logically equivalent prime impli- atom A, there are two possibilities: cates. De®nition 2 Prime Implicate

1. A has a de®nition of the form A <=> W. This means that 8 Let © be a set of clauses. A clause is a prime implicate

A has a successor state axiom or is a de®ned atom, and to [

8 ©l$ 8 of © iff is not a tautology, , and there is no clause

regress A, we need to regress W. [

[ 2

} } }

Y 8 8 8 ©ª$ 8 8 such that subsumes and . 2. A has no de®nition of the form A <=> W. Therefore, ei-

2 ¬L«

ther A is not a ¯uent, or it is, but its situation argument is A clause is a tautology iff it contains « and for some atom

­ ­S® ­ ­S® s0, so the regression is ®nished. « . Clause subsumes clause iff each literal of occurs in . 5147(A†ŒnmN4‡n†© !

Theorem 1 (Quine 1959) Suppose © is a set of clauses, also imposes certain canonical order-

© © and uN†`-©? is the set of all of 's prime implicates. Then ing rules on plans, which we do not describe here.

and uN†`-©? are logically equivalent. Moreover, for any non- The following Prolog clauses implement rules 1 and 3:

[

©¯$ 8 H%°:uN†`-©?

tautologous clause 8 , iff there is a clause 8 such that H subsumes . Some Bad Situations for a Blocks World

This tells us, ®rst, that we can safely replace © by its prime badSituation(do(move(X,Y),S)) :- implicates, and secondly, with these equivalent clauses in prove(-goodTower(X,do(move(X,Y),S))).

hand, we can quickly determine whether a given clause is en- badSituation(do(moveToTable(X),S)) :- © tailed by © . So it seems that we need only to compute 's prove(-goodTower(X,do(moveToTable(X),S))), prime implicates, and thereafter we have ef®cient theorem existsActionThatCreatesGoodTower(S). proving that can be performed in time linear in the number of existsActionThatCreatesGoodTower(S) :- prime implicates. These prime implicates act like a compiled (A = move(Y,X) ; A = moveToTable(Y)), poss(A,S), prove(goodTower(Y,do(A,S))).

form of © : All the ªhardº reasoning is done at compile time, in computing the prime implicates; after that, reasoning be- comes easy. Of course, there is no free lunch, so we have to Next, we present an example open world blocks problem expect that the compilation phase will have high complexity, with 12 blocks, arranged as indicated in the ®gure. and indeed, this is so. In the worst case, the number of prime implicates of a set of clauses is exponential in the number of A Blocks World Problem with Incomplete Initial distinct atoms in those clauses. Situation The ®rst stage of our implementation converts the initial database to clausal form. In doing so, it ®rst eliminates quan- /* Initial situation: Only the blocks so ti®ers in the sentences of the initial database, making use indicated have been specified to be clear. X of various logical simpli®cations, for example, replacing d m <-- clear; = X by true, -true by false, P & true by P, etc. clear --> p a not on table Finally, the implementation computes the prime implicates not on--> n /\ of these clauses, using a straightforward algorithm based on table ?/ \? f <-- not (Quine 1959). / \ on table g b \ On-Line Theorem Proving h c e k ------The alternative to compiling the initial database is on- line theorem proving. This involves a once-only con- Goal situation d k h g version of the initial database to clausal form by quanti- b m ®er elimination as described in the previous section, but e f without further processing these clauses into prime impli- a c cates. Subsequently, whenever it is required to establish ------*/ databaseEntails(Clauses) for a regressed set of Clauses, a clausal form theorem prover is invoked. The goal(S) :- prove(on(d,h,S) & on(h,b,S) & advantage of this on-line approach is that it avoids the expen- on(b,e,S) & on(e,a,S) & ontable(a,S) & sive prime implicate computation. The disadvantage is that on(k,g,S) & on(g,m,S) & on(m,f,S) & the theorem proving task becomes much more expensive. on(f,c,S) & ontable(c,S) ).

goodTower(X,S) <=> X = a & ontable(a,S) v An Open Blocks World X = e & on(e,a,S) & ontable(a,S) v X = b & on(b,e,S) & on(e,a,S) & ontable(a,S) v We illustrate an open world axiomatization for the blocks X = h & on(h,b,S) & on(b,e,S) & on(e,a,S) & world. Recall that K;uD€R!" searches for plans bottom-up, ontable(a,S) v ®ltering out useless subplans with a user supplied, domain X = d & on(d,h,S) & on(h,b,S) & on(b,e,S) &

speci®c 5 4(A†^nmD4‡n†© ! predicate. We next describe the pred- on(e,a,S) & ontable(a,S) v

icate we used for our blocks world implementation. X = c & ontable(c,S) v

 ¦ Let {o© © 3*© * U¦ be true whenever, in situation , X = f & on(f,c,S) & ontable(c,S) v X = m & on(m,f,S) & on(f,c,S) & ontable(c,S) v is a good tower, meaning that ¦ is the top block of a tower of blocks that is a sub-tower of one of the goal towers. We X = g & on(g,m,S) & on(m,f,S) & on(f,c,S) & suppose the planner has available to it a description of all the ontable(c,S) v good towers corresponding to its planning goal. The follow- X = k & on(k,g,S) & on(g,m,S) & on(m,f,S) & on(f,c,S) & ontable(c,S).

ing are some natural 5 4(A†^nmD4‡n†© ! s: 1. The situation resulting from moving a block off a good /* Initial database. All references to clear and tower. ontable have been eliminated, via their definitions, in favor of on. */ 2. The situation resulting from moving a block onto a good tower, if the resulting tower is a bad tower. axiom(all([y,block],-on(y,m,s0))). % m is clear. axiom(all([y,block],-on(y,p,s0))). % p is clear. 3. Opportunistic rule: The situation resulting from creating axiom(all([y,block],-on(k,y,s0))). % k on the table. a bad tower by moving a block to the table, and some other axiom(all([y,block],-on(c,y,s0))). % c on the table. action could have been performed instead that creates a axiom(all([y,block],-on(e,y,s0))). % e on the table. good tower. axiom(all([y,block],-on(h,y,s0))). % h on the table. axiom(on(b,c,s0)). axiom(on(d,a,s0)). ciency.

axiom(on(± g,h,s0)). axiom(on(p,n,s0)). axiom(on(a,b,s0) v on(a,e,s0)). % a is on b or on e; 2. The initial database axioms include three state constraints,

axiom(all([x,block],on(x,b,s0) => x = a)). % nothing relativized to the initial situation. The general state con-

\ © !A§W¦R

axiom(all([x,block],on(x,e,s0) => x = a)). % else straints, e.g. ^¡¢¦§B @<© !A¦R§W¥ , are not

[ (") % is on b or e. among our axioms because, except for the case  , axiom(some([x,block],on(f,x,s0))). % f not on table. they are entailed by the successor state and action precon- axiom(some([x,block],on(m,x,s0))). % m not on table. dition axioms. See (Lin & Reiter 1994) for a discussion of axiom(some([x,block],on(n,x,s0))). % n not on table. this issue. In general, for open world planning, the initial database must include all state constraints for the applica- % Initial state constraints. tion domain, relativized to the initial situation. axiom(all([x,block],all([y,block], 3. The clauses for poss and goal assume responsibility for on(x,y,s0) => -on(y,x,s0)))). calling prove on appropriate formulas. axiom(all([x,block],all([y,block], all([z,block], on(y,x,s0) & on(z,x,s0) => y = z)))). 4. The successor state axioms differ from Example 1, which

axiom(all([x,block],all([y,block], all([z,block], universally quantify over all actions 4 . In contrast, the on(x,y,s0) & on(x,z,s0) => y = z)))). open world blocks world axiomatization uses two clauses for clear, one for action move(U,V), the other for % clear and ontable defined in the initial situation. action moveToTable(U). There is no deep reason for this choice. It was made only to simplify the imple- clear(X,s0) <=> all([y,block],-on(y,X,s0)). simplify ontable(X,s0) <=> all([y,block],-on(X,y,s0)). mentation of the simpli®cation routine used by the regression theorem prover. To see why, consider

% Domain of blocks. the successor state axiom for 6 4U in example 1, and 4 consider an instance ¨2©  ¤mR ¤ of in this sentence:

domain(block,[a,b,c,d,e,f,g,h,k,m,n,p]).

6 47U¦R©¨ © ¤ m  `GF

[

#^]W_;¨2©  ¤mR ¤ ¨2©  ¤§W_¤Aa

% Action preconditions. ]B§¤

[

¨2©  ¤mR ¤ ¨ © ¤ 13*©3*456 §¤š&¢VX© !A§B¦¡‚a

[

\

]B§¤;¨ © ¤ m  ¨ © ¤ §B¦D @ poss(move(X,Y),S) :- 6 4U¦"V findall(Z,(domain(D), member(Z,D), prove(clear(Z,S))),L), Using the unique names axioms for actions, and some member(X,L), member(Y,L), not X = Y. elementary , this can be simpli®ed to yield the poss(moveToTable(X),S) :- domain(D), member(X,D), logical form of the ®rst successor state axiom for clear prove(clear(X,S) & -ontable(X,S)). in the above blocks world axiomatization. Obtaining this logical form from the general successor state axiom % Successor state axioms. was straightforward, but required a lot of simpli®cation based on reasoning about quanti®ers, equality and unique clear(X,do(move(U,V),S)) <=> names axioms for actions. To avoid having to implement on(U,X,S) v -(X = V) & clear(X,S). such simpli®cation routines we have opted instead for the clear(X,do(moveToTable(U),S)) <=> on(U,X,S) v clear(X,S). user of the system to do this herself, in advance, and to on(X,Y,do(move(U,V),S)) <=> represent the results of these simpli®cations directly by X = U & Y = V v -(X = U) & on(X,Y,S). successor state axioms, particularized to each action, as on(X,Y,do(moveToTable(U),S)) <=> -(X = U) & on(X,Y,S). was done in the above axiomatization. ontable(X,do(move(U,V),S)) <=> -(X = U) & ontable(X,S). ontable(X,do(moveToTable(U),S)) <=> Experimental Results X = U v ontable(X,S). We tested our planner on two classes of problems: One class primitive_action(move(X,Y)). consists of variants of the blocks world problem of the previ- primitive_action(moveToTable(X)). ous section in which we vary the extent to which individual blocks have known information associated with them. The There are four things to note about these axioms: other problem class was drawn from the logistics domain,

1. The initial database is de®ned only using the ¯uent © ! , and and again, we varied the amount of known information about

© !Bn475'6 © !

not 6 4U and . In the blocks world, the ¯uent the domain's individuals. Moreover, we experimented with © !Bn456 is primitive, and ¯uents 6 4U and can be de®ned two versions of the planner's theorem prover: the prime im- in terms of it: plicate approach described above, and an on-line theorem

prover Relsat 1.0, an implementation of the Davis-Putnam

\ © !A§B¦1

6 4U¦AF”Œ¡¢§¤ algorithm based on (Bayardo & Schrag 1997).

\ © !A¦§W1@ © !Bn456 ¦AF”Œ¡¢§¤ In designing our experiments, we introduced the concept

Thus, instead of representing the initial fact that ² is on of an unknown for the purposes of measuring a problem's

the table by © !Bn475'6 ¤²R(") , we elected instead to use degree of incompleteness. For a given domain individual,

\

^¡¢§ © !A²R§W(  6 4U ) ; similarly for . With this choice, an unknown is any property of that individual that is not en-

the initial database does not include facts about 6 4U and tailed by the initial database, and whose negation also is not

© !Bn456 . This considerably reduces the number of clauses entailed. For the blocks world problem of the previous sec- 

for the initial database because these will not include tion, 6 4U is an unknown property of , because the ax-

\

6 47U © !Bn456

redundant clauses involving '6 4U and . This, ioms for the initial database entail neither it, nor .

[

¨ ³D¦N1¦ in turn, considerably improves the theorem proving ef®- ³N¦D;© !A¨d¦N is an unknown property of , and

[ Prime Implicate: Logistics

"V2© !A4D¦D 4 5Ra ¦ is an unknown property of . In total, Problem 03 03 04 05 there´ are 8 unknown properties for this example. Unknowns 0 1 2 11 Plan (sec) 19.0 24.8 262.5 stack o'¯ow The Blocks World Clauses 776 811 6772 9359 Implicates 776 811 6772 9359 Here, we used the axiomatization of the blocks world given Compile (sec) 15.0 16.3 1178.3 2339.2 in the previous section, but varied the initial situation (so Plan length 9 10 11 - only the ®rst problem in the set of experiments corresponds to the picture associated with those axioms). The remaining Discussion four blocks world problem instances used in our experiments Our experiments suggest that open world planning is feasi- were obtained from the problem given in the previous sec- ble for moderate sized problems (up to 17 step blocks world tion by adding more blocks to it, and by varying the amount plans, and 19 step logistics plans). To our surprise, theo- of known information about these additional blocks. The ta- rem proving with Relsat 1.0 was the clear winner over the bles given below summarize the comparative performances prime implicate compilation approach. With larger prob- of Relsat vs the prime implicate implementations of the the- 3 lems, the latter was overwhelmed by the prime implicate orem proving component of our open world planner. computation, whereas Relsat found plans for all our problem instances. Perhaps a more sophisticated prime implicate al- Relsat gorithm would have helped here, e.g. (de Kleer 1992). We Blocks 12 20 20 22 22 leave such considerations for the future. Unknowns 8 8 10 14 10 Conformant Graphplan (Smith & Weld 1998), CMBP Plan (sec) 19.7 19.0 31.2 38.7 38.2 (Cimatti & Roveri 1999) and the planner of (Rintanen 1999) Clauses 175 449 502 624 586 Compile (sec) 5.1 44.8 50.1 79.6 82.1 are the only other open world planners that we know. Cimatti Plan length 14 14 17 17 17 and Roveri have extensively tested their planner against those of Smith/Weld and Rintanen, and their data suggests the superiority of their approach over these other planners. The examples on which we tested our planner did not inter- Prime Implicates sect those of Cimatti and Roveri ± we did not learn of their Blocks 12 20 20 22 22 work until after we had conducted our experiments. How- Unknowns 8 8 10 14 10 ever, we have since done some unsystematic runs with our Plan (sec) 3.9 19.8 - - - Clauses 175 449 502 624 586 planner on the bomb and the toilets problem that ®gured Implicates 248 569 - - - prominently in their experiments. This problem has some Compile (sec) 15.7 119.6 - - - straightforward and natural 5 47(A†ŒnmN4‡n†© ! s: Plan length 14 14 - - - 1. Flushing a toilet twice without an intervening package

dunking creates a 5 47(A†ŒnmN4‡n†© ! . The Logistics Domain 2. The problem has a high degree of symmetry, which can be substantially reduced by canonically ordering the pack- Space limitations prevent us from presenting our situation ages and toilets: calculus axiomatization for this domain. They are available,

(a) Dunking a package creates a 5 4(c†ŒnmD4 n†© ! if there is on request, from the authors. To generate open world prob- an undunked package lower in the package ordering. lems for this domain, we selected a number of the standard closed world benchmarks, and ªopened them upº by remov- (b) Dunking into a toilet creates a 5147(A†ŒnmN4‡n†© ! if there is ing information from their initial state descriptions. As for an unclogged toilet lower in the toilet ordering. the blocks world, our measure of the degree of incomplete- We tested our prime implicate-based planner, using these

ness of these problems was de®ned by the number of un- 5147(A†ŒnmN4‡n†© ! s, on several of the Cimatti and Roveri test known properties of all domain individuals. In the tables be- problems. None caused it any dif®culties. The smallest low, the problem numbers are those of the closed world in- problem their planner could not solve was BMTC(10,3) ± 10 stances of logistics problems used in the First International packages, 3 toilets ± with high uncertainty, meaning that ini- Planning Competition, described at www.informatik.uni- tially it is unknown whether any of the toilets are clogged;

freiburg.de/ µ koehler/ipp.html. Our problems were obtained our planner found a 20 step plan in 0.32 seconds. The biggest by ªopening upº these problem instances. problem we ran was BMTC(40,6) ± 40 packages, 6 toilets ± with high uncertainty, producing an 80 step plan in 114 sec- onds. Relsat: Logistics In all fairness to CMBP, we must emphasize that it is a do- Problem 03 03 04 05 main independent planner, whereas ours relies heavily on its Unknowns 0 1 2 11 Plan (sec) 24.3 31.0 342.8 1405.0 problem speci®c 5 47(A†ŒnmN4‡n†© ! s. Moreover, CMBP returns Clauses 776 811 6772 9359 all minimal length plans, while ours returns plans one at a Compile (sec) 9.8 10.5 1146.6 1528.9 time, and these need not be minimal length. Finally, CMBP Plan length 9 10 11 19 provides for actions with nondeterministic effects; for us, all actions must be deterministic. On the other hand, we can't think of any reasons for not exploiting domain speci®c in- formation in planning when it is so obviously useful. 3All CPU times here are for a SUN Sparc 10 Ultra, with 333 Our planner differs considerably from those of Bac- MHZ processor and 256 MB of RAM. chus/Kabanza in its theoretical foundations and in its imple- mentation. Theoretically, it is based entirely on the situa- Levesque, H.; Reiter, R.; Lesperance, Y.; Lin, F.; and Scherl, R. tion ¶ calculus and Green's De®nition 1 for planning, and is ar- 1997. GOLOG: a language for dynamic do- guably more ªlogically pureº and transparent than the latter, mains. J. of Logic Programming, Special Issue on Actions 31(1- which rely on a combination of STRIPS-like operators and 3):59±83. a linear temporal logic. In its implementation, our planner Levesque, H. 1996. What is planning in the presence of sens- differs in one fundamental respect. The Bacchus/Kabanza ing? In Proceedings of the National Conference on Arti®cial In- planners maintain a current database by progressing the pre- telligence (AAAI'96), 1139±1146. vious database in response to the last planned action, whereas Lin, F., and Reiter, R. 1994. State constraints revisited. J. of Logic our planner does no database progression; instead, it main- and Computation, special issue on actions and processes 4:655± tains only the initial database, and computes entailments us- 678. ing goal regression together with theorem-proving relative Lin, F., and Reiter, R. 1997. How to progress a database. Arti®cial to the initial database. There is a good reason for this: Ex- Intelligence 92:131±167. cept for one special case described in (Lin & Reiter 1997), McCarthy, J. 1963. Situations, actions and causal laws. Technical there are no known provably correct and ef®cient algorithms report, Stanford University. Reprinted in Semantic Information for progressing an incomplete initial database. Despite these Processing (M. Minsky ed.), MIT Press, Cambridge, Mass., 1968, technical differences, our planner is very much in the spirit pp. 410-417. of the Bacchus/Kabanza approach, and our experiences rein- Pirri, F., and Reiter, R. 1999. Some contributions to the metathe- force their arguments in favor of exploiting domain speci®c ory of the situation calculus. Journal of the ACM 46(3):261±325. control information in planning systems. Quine, W. 1959. On cores and prime implicants of truth functions. In addition to the open world planner described here, a va- American Math. Monthly 66:755±760. riety of closed world, forward reasoning, situation calculus Reiter, R. 1991. The frame problem in the situation calculus: a planners based on the ideas of Bacchus and Kabanza have simple solution (sometimes) and a completeness result for goal re- also been implemented (Reiter 1999). These include plan- gression. In Lifschitz, V., ed., Arti®cial Intelligence and Math- ners for ªclassicalº (totally ordered) problems, as well as for ematical Theory of Computation: Papers in Honor of John Mc- concurrency, and temporally ordered processes, as exempli- Carthy. San Diego, CA: Academic Press. 359±380. ®ed by a multi-handed blocks world agent. Reiter, R. 1999. Knowledge in Action: Logical Foundations for (Levesque 1996) has elegantly generalized Green's ac- Describing and Implementing Dynamical Systems. In preparation. count of planning in the situation calculus (De®nition 1) to Draft available at http://www.cs.toronto.edu/Äcogrobo/. conditional plans, and we believe that the methods of this pa- Rintanen, J. 1999. Constructing conditional plans by a theorem- per can be adapted to implement conditional planners based prover. Journal of Arti®cial Intelligence Research 10:323±352. on his foundations. Smith, D., and Weld, D. 1998. Conformant graphplan. In Proceedings of the National Conference on Arti®cial Intelligence References (AAAI'98), 889±896. AAAI Press/MIT Press. Bacchus, F., and Kabanza, F. 1996. Planning for temporally ex- tended goals. In Proceedings of the National Conference on Arti- ®cial Intelligence (AAAI'96), 1215±1222. Bacchus, F., and Kabanza, F. 2000. Using temporal to express search control knowledge for planning. Arti®cial Intel- ligence 116(1-2):123±191. Bayardo, R., and Schrag, R. 1997. Using CSP look-back tech- niques to solve real-world SAT instances. In Proceedings of the National Conference on Arti®cial Intelligence (AAAI'97), 203± 208. Blum, A., and Furst, M. 1997. Fast planning through planning graph analysis. Arti®cial Intelligence 90(1-2):281±300. Cimatti, A., and Roveri, M. 1999. Conformant planning via model checking. In Biundo, S., ed., Proc. ECP99: European Conference on Planning. Springer-Verlag. de Giacomo, G.; Iocchi, L.; Nardi, D.; and Rosati, R. 1997. Plan- ning with sensing for a mobile robot. In Preprints of the Fourth European Conf. on Planning, 158±170. de Kleer, J. 1992. An improved incremental algorithm for gener- ating prime implicates. In Proceedings of the National Conference on Arti®cial Intelligence (AAAI'92), 780±785. Golden, K.; Etzioni, O.; and Weld, D. 1994. Omnipotence with- out omniscience: Ef®cient sensor management for planning. In Proceedings of the National Conference on Arti®cial Intelligence (AAAI'94), 1048±1054. Green, C. 1969. Theorem proving by resolution as a basis for question-answering systems. In Meltzer, B., and Michie, D., eds., Machine Intelligence 4. New York: American Elsevier. 183±205. Kautz, H., and Selman, B. 1996. Pushing the envelope: Planning, propositional logic and stochastic search. In Proceedings of the National Conference on Arti®cial Intelligence (AAAI'96), 1194± 1201.