University of Wisconsin - Madison | CS 540 Lecture Notes | C. R. Dyer |
Planning (Chapter 11.1 - 11.4)
Name: pickup(x) Preconditions: ontable(x), clear(x), handempty Add list: holding(x) Delete list: ontable(x), clear(x), handempty
Note: Instead of the two Add and Delete lists, we could have specified a single "Effects list:"
Effects list: holding(x), ~ontable(x), ~clear(x), ~handempty
Two main approaches to solving planning problems, depending on the kind of search space that is explored:
Two approaches to situation-space planning:
O = pickup(x) with u = {x/A} means
T = {clear(B), clear(C), ontable(B), ontable(C), holding(A)}
and the operator instance associated with the action from S to T is pickup(A).
Gj' = true, if (Gj)u in
(Add-list(O))u
Gj' = false, if (Gj)u in
(Delete-list(O))u
Gj' = (Gj)u, otherwise
procedure strips(I, G1 ^ ... ^ Gn, OPS) ;; I = initial-state ;; G1 ^ ... ^ Gn = conjunctive goal list ;; OPS = list of operators push(achieve(G1, ..., Gn), Goal-Stack) loop: if empty(Goal-Stack) then success N = pop(Goal-Stack) if N of the form "achieve(g1, ..., gm)" then begin if N true in state I then goto loop if all possible orders of gi already attempted, then fail push(N, Goal-Stack) Choose a new order for the gi push(achieve(gi), Goal-Stack) in selected order end else if N of the form "achieve(g)" then begin if N true in state I then goto loop Choose an operator O from OPS that possibly adds g If none, fail Choose a set of variable bindings that makes O add g push(apply(O), Goal-Stack) push(achieve(preconditions(O)), Goal-Stack) end else if N of the form "apply(O)" then I = apply(O,I) ; apply operator O in state I to ; produce successor state
P (Preconditions): ontable(x), clear(x), handempty E (Effects): holding(x), ~ontable(x), ~clear(x), ~handempty
P: holding(x) E: ontable(x), clear(x), handempty, ~holding(x)
P: holding(x), clear(y) E: on(x,y), clear(x), handempty, ~holding(x), ~clear(y)
P: clear(x), on(x,y), handempty E: holding(x), clear(y), ~clear(x), ~on(x,y), ~handempty
clear(B) ------- clear(C) | | on(C,A) | C | ontable(A) | | ontable(B) ------- ------- handempty | | | | | A | | B | | | | | -------------------------
on(A,C) ------- on(C,B) | | | A | | | ------- | | | C | | | ------- | | | B | | | -------------
------- | | | A | | | ------- ------- | | | | | C | | B | | | | | ------- ------- ------- | | | | | | | A | | B | | C | | | | | | | ---------------------- ----------- Initial State Goal State
Solving on(A,B) first (by doing unstack(C,A), stack(A,B) will be undone when solving the second goal on(B,C) (by doing unstack(A,B), stack(B,C)). But, similarly, solving on(B,C) first will be undone when solving on(A,B). Hence, either order of solving the two goals means the plan that solves the second goal inadvertently undoes the solution to the first as a side-effect.
Copyright © 1996-2003 by Charles R. Dyer. All rights reserved.