Errata For Automated Planning: Theory and Practice: Dana S. Nau, University of Maryland May 4, 2005
Errata For Automated Planning: Theory and Practice: Dana S. Nau, University of Maryland May 4, 2005
Page ii, 5th line from bottom. Remove for a list of publications. Page xxiv, last paragraph. replace this paragraph with the following: The web site for the book can be found at http://www.laas.fr/planning or http://books.elsevier. com/mk/1558608567. It contains a complete set of lecture slides, and other auxiliary materials. Page 6, Example 1.1, 3rd line. Change can can to can. Page 10, last paragraph. Change A0 to A1. Page 11, 3rd line before Section 1.6. Change II to III. Page 25, middle of the page. i = 0, . . . , n should be i = 0, . . . , m. Pages 25 and 26. All occurrences of vali+1 mod m should be vali+1 mod m . Page 30, 2nd line of Example 2.10. c1,c2 should be c3,c1. Page 31, last paragraph. g contains negated atoms should be g may contain negated atoms, and Denition 2.1 (see page 20) should be on page 22. Page 32, Example 2.11, 8th line. l1 should be loc1. Page 33, 2nd paragraph, 2nd line. is should be be. Page 33, 2nd bullet. t and I (t) should be s and I (s). Page 35, last line. Interchange the superscripts Page 48, 4th line. xn should be tn . Page 51, 5th line. eects should be precond. Page 51, 6th line. precond should be eects. Page 56, 2nd bullet. P should be (P, k ). Page 57. Remove the paragraph before Proposition 3.1. Page 73, line 5 of Section 4.3. The equation should be 1 (g ) = { 1 (g, a) | a A is relevant for g }
+
and .
Page 73, 4th line from bottom. applicable should be relevant. Page 74, middle of page. r1 should be r1. One line earlier, at(r1, loc1), should be removed. Three lines later, occupied(loc1) should be occupied(loc1). Page 79, last line before Section 4.5.2. In position(c1,s0 ), c1 should be c3. Page 88, rst line of Denition 5.1. set should be multiset. Page 107, line 12 of Exercise 5.7. Both occurrences of status(x,ll) should be status(x,lling). Page 121, 4th line of Denition 6.4. actions should be actions, see p. 124. Page 126, 7th line of Example 6.3. Mr21 should be Mr12. Page 157, line 12. Interchange function and cost. Page 165, exercise 7.3. After robots, insert that can be in the same location at the same time. Page 171, Examples 8.3 and 8.4. {(, ), (, ), (, )} should be {(, ); (, ); (, )}. Page 171, 5th line from bottom. due should be dual. Pages 174177. Replace Section 8.3.1 with the pages at the end of the errata list. Page 191. Add the following: 8.11 Modify the encoding of Frame Axioms (Step 4 in Section 8.3.1) such as to get only binary constraints (hint: add a new CSP variable for each action and for each variable invariant for that action). Page 202, 2nd and 3rd lines of (9.1). Replace the two lines with 0 (s, g ) = 0 0 (s, g ) = 0 if g s if p s and a A, p eects+ (a)
Page 202, rst line after (9.1). Replace an estimate with the exact value. Page 203, Figure 9.2. Replace U {s} with U s. Replace u U, precond(a) u with precond(a) U . Replace U {u} eects+ (a) with U U eects+ (a). Page 213, last paragraph, 6th line. were should be when. Page 213, last paragraph, 8th line. 99 should be 98. Page 220, Section 10.3, 2nd paragraph. Remove the space after progr. Page 240, Example 11.8, 3rd line. loc2 should be l2. Page 244, last paragraph, 3rd line. should be = a1 , . . . , an . Page 269, 5th paragraph, 2nd line. load(r, c) should be load(r1,c1).
Page 274, 2nd through 12th lines. Put space before (domain), (move l2), etc. to line them up in a column. Page 283, 1st bullet. location 1 to location 2 should be location 2 to location 1. Page 295, 5th and 8th lines of the text. Replace all four occurrences of with . Page 299, last line. a should be an. Page 302, 3rd line. Replace As mentioned earlier, IAc is with Let IAc be. Page 303, title of Section 13.4.1. Replace Constraints with Problems. Page 303, Section 13.4.1, 3rd paragraph, 1st line. Remove constraint. Page 311, 10th line before bottom. Remove for. Page 322, 2nd and 3rd bullets. Replace C with . Page 338, 2nd line of the gure. Replace return( ) with return(, ). Page 346, Figure 14.8. lling(bt), lling(wm), and lling(dw) should be ll(bt), ll(wm), and ll(dw). Page 371, Figure 15.9, 6th line. (/) should be {(/)} . Page 393, 6th-8th lines from bottom. replace f and e with full and empty throughout. Page 395, 5th line from bottom. function should be partial function. Page 396, 3rd line. b(s3) = 0 should be b(s4) = 0. Page 396, 5th line. observe container should be observe-container. Page 403, end of 1st paragraph. Replace conventions with ideas. Page 415, 3rd and 4th bullets. S C A should be S C be S C S C. A, and S C S C should
Page 421, Section 17.3.3. Replace In spite of . . . seem to be with Temporal logics cannot express goals that are. Page 432, 1st paragraph, 4th line. Replace a satisability problem with the problem of nding a plan that satises the specication. The next four pages contain the replacement for Section 8.3.1.
174
Chapter 8
8.3.1
A bounded planning problem P = (O, R, s0 , g, k ) in the state variable representation is encoded into a constraint satisfaction problem P in four steps corresponding respectively to (1) the denition of the CSP variables of P , (2) the denition of the constraints encoding the initial state s0 and the goal g , (3) the encoding of the actions that are instances of operators in O, and (4) the encoding of the frame axioms. The set of solutions of the CSP P is intended to correspond to the set of plans a1 , . . . , ak of P of length k . We are interested in characterizing the sequences of states s0 , s1 , . . . , sk corresponding to such plans. For convenience, let us refer to the state sj in this sequence by its index j , for 0 j k. Step 1: CSP variables. The CSP variables of P are dened as follows:
is the set of all possible actions, in addition to a noop action that has no preconditions and no eects, i.e., s, (s, noop) = s. More formally: act : {0, . . . , k 1} Dact , and Dact = {a(vu , . . . , vw ) ground instance of o O} {noop} Hence, the CSP variables are all the ground state variables of P , plus one variable act(j ) whose value corresponds to the action carried out in state j . Example 8.14 Let P = (O, R, s0 , g ), where O are the operators given in Example 8.13 for a simplied DWR domain with one robot r1, one container c1, and two adjacent locations l1, l2. Since there is a single robot and a single container, let us simplify the notation by removing the arguments r and c in the variables rloc, rload, cpos, and in the operators. Let s0 be the following state s0 = {rloc=l1, rload=nil, cpos=l2}; and let g ={cpos=l1}. A plan for this problem consists in moving the robot from l1 to l2, loading the container, moving back to l1 and unloading. Assume that we are seeking a plan of at most k = 4 steps. The corresponding CSP P has the following set of variables:
rloc(j ) {l1, l2}, for 0 j 4; rload(j ) {c1, nil}, for 0 j 4; cpos(j ) {l1, l2, r1}, for 0 j 4 ;
Automated Planning
175
act(j ) {move(l, m), load(l), unload(l), noop}, for all the possible in-
stances of these operators and for 0 j 3. In this problem there are 6 5 1 = 29 CSP variables. 2
Step 2: Constraints encoding s0 and g . The encoding of the state s0 and the goal g into constraints follows directly from the denition of the CSP variables.
Every ground state variable xi whose value in s0 is vi is encoded into a
unary constraint of the corresponding CSP variable for j = 0 of the form: {(xi (0) = vi )} (8.1)
into a unary constraint of the corresponding CSP variable for j = k {(xi (k ) = vi )} (8.2)
Note that there is no constraint for s0 and g on the CSP variables act(j ) . Example 8.15 The state s0 of Example 8.14 is translated into the following unary constraints: {(rloc(0)=l1)}, {(rload(0)=nil)}, and {(cpos(0)=l2)}. The goal g is translated into the unary constraint: {(cpos(4)=l1)}. 2 Step 3: Constraints encoding actions. This encoding step translates the actions of the planning problem P into binary constraints of P . Well rst dene the set of all allowed pairs in these binary constraints for all actions; let E be this set. Well then use the pairs in the set E to dene the constraints on the state variables that encode each action. For every action a(vu , . . . , vw ), an instance of some operator o O such that the constants vu , . . . , vw meet the rigid relations in the preconditions of a, and for 0 j k 1, we do the following:
For every condition of the form (xi = vi ) in precond(a) we put in E the
pair: (act(j ) = a(vu , . . . , vw ), xi (j ) = vi ) no assignment of xi in eects(a) we put in E the pair: (act(j ) = a(vu , . . . , vw ), xi (j + 1) = vi ) (8.4) (8.3)
For every condition of the form (xi = vi ) in precond(a) such that there is
176
Chapter 8
(act(j ) = a(vu , . . . , vw ), xi (j + 1) = vi )
(8.5)
Once this is done for all actions, we have in E all the pairs of allowed values for the variable act(j ) and for the variables appearing in actions. The binary constraint on act(j ) and a variable x is simply the union of all pairs in E related to act(j ) and x. Example 8.16 The move and load operators in the Example 8.14 lead to the following pairs in E : (act(j ) = move(l, m), rloc(j ) = l), (act(j ) = move(l, m), rloc(j + 1) = m), (act(j ) = load(l), rloc(j ) = l), (act(j ) = load(l), rloc(j + 1) = l) (act(j ) = load(l), cpos(j ) = l), (act(j ) = load(l), cpos(j + 1) = r1), (act(j ) = load(l), rload(j ) = nil), (act(j ) = load(l), rload(j + 1) = c1), for (l, m) being either (l1,l2) or (l2,l1), and for 0 j 3. A similar set of pairs is dened for the operator unload. The constraint between the two state variables act(j ) and rloc(j ), for 0 j 3, is the union of all the pairs in E related to these two variables, that is: {(act(j ) = move(l, m), rloc(j ) = l), (act(j ) = load(l), rloc(j ) = l), (act(j ) = unload(l), rloc(j ) = l) | (l, m) {(l1,l2), (l2,l1)}} 2 Step 4: Constraints encoding frame axioms. A variable that is invariant for an action a remains unchanged between s and (s, a). Frame axioms can be encoded directly into a ternary constraints whose tuples involve act(j ), an invariant variable xi (j ) and xi (j + 1). As in the previous step, well rst dene the set of all such tuples of possible values: for every action a(vu , . . . , vw ) and every variable xi , invariant for a, a tuple of possible values is: (act(j ) = a(vu , . . . , vw ), xi (j ) = vi , xi (j + 1) = vi ), for vi Di (8.6)
A frame axiom constraint is the union of all such tuples related to the same three variables act(j ), xi (j ) and xi (j + 1). Note that noop has no action constraint, since it has no precondition and no eect, but every state variable is invariant for noop. Example 8.17 In Example 8.14, the variable rload is invariant with respect to the actions move and noop. Consequently, the frame axiom constraint for act(j ), rload(j ) and rload(j + 1), for 0 j 3, is the following: {(act(j ) = move(l, m), rload(j ) = v, rload(j + 1) = v ), (act(j ) = noop, rload(j ) = v, rload(j + 1) = v ) | v {c1, nil}}. 2
Automated Planning
177
Plan extraction. We have encoded a planning problem P and an integer k into a CSP P . Let us assume that we have a tool for solving CSPs. Given P as input, this CSP solver returns a tuple as a solution of P , or failure if P has no solution. The tuple gives a value to every CSP variable in P , in particular to the variables act(j ). Let these values in be: act(j ) = aj +1 , for 0 j k 1. Each aj is an action of P, and the sequence = a1 , . . . , ak is a valid plan of P that possibly includes noop actions. Proposition 8.18 There is a one-to-one mapping between the set of plans of length k that are solutions of a bounded planning problem P and the set of solutions of the CSP problem P encoding P . Proof Let be a tuple solution of P . The value in of the variable act(0)=a1 meets all the constraints, in particular those specied through Equation 8.3: for every condition xi (0) = vi in precond(a1 ), the constraint between act(0) and xi (0) allows only the value xi (0) = vi whenever act(0)=a1 . These values of the variables xi (0) also meet the unary constrains in Equation 8.1 for state s0 . Consequently action a1 , whose preconditions are met is state s0 is applicable to s0 . Consider now the state s1 corresponding to the state variables dened by the values of xi (1) in the solution . These values of xi (1) meet all the constraints, in particular those specied through Equations 8.4, 8.5, and 8.6 : whenever act(0)=a1 the only allowed values for xi (1) are either those specied in the eects of a1 , or xi (1) = xi (0) when xi is invariant in a1 . This is exactly the denition of the state resulting from applying a1 to s0 , hence s1 = (s0 , a1 ). The same argument applies for act(1)= a2 and s2 = (s1 , a2 ); it can be repeated till act(k 1) = ak and sk = (sk1 , ak ). Now, the values xi (k ) = vi meet also the unary constraints of Equation 8.2, i.e., the goal g is satised in sk . Hence = a1 , . . . , ak is a valid plan of P . Conversely, let = a1 , . . . , ak be a solution plan of P and let s1 = (s0 , a1 ), . . . , sk = (sk1 , ak ) be the corresponding sequence of states. Consider the tuple that gives to every CSP variable xi (j ) the value corresponding to that of the state variable xi in state sj , for 0 j k , and act(j ) = aj +1 , for 0 j k 1. It is straightforward to show that meets all the constraints of P , hence it is a solution of P . This proof also shows that there is no plan of length k for the planning problem P i the CSP P is inconsistent. 2