![Page 1: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/1.jpg)
1
Chapter 5 Plan-Space Planning
![Page 2: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/2.jpg)
2
Problem with state-space search In some cases we may try many different orderings of the same
actions before realizing there is no solution
Least-commitment strategy: don’t commit to orderings, instantiations, etc., until necessary
Motivation
a bc
b a
b a ba cb c ac b
goal
…
…
…
………
dead end
dead end
dead end
dead enddead enddead end
![Page 3: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/3.jpg)
3
Left Sock
Start
Finish
Right Shoe
Left Shoe
Right Sock
Start
Right Sock
Finish
LeftShoe
RightShoe
Left Sock
Start Start Start Start Start
Right Sock
Right Sock
Right Sock
Right Sock
Right Sock
Left Sock
Left Sock
Left Sock
Left Sock
Left Sock
Left Sock
RightShoe
RightShoe
RightShoe
RightShoe
RightShoe
LeftShoe
LeftShoe
LeftShoe
LeftShoe
Finish Finish Finish Finish Finish
Left Shoe on Right Shoe on
Left Sock on Right Sock on
Partial Order Plans: Total Order Plans:
![Page 4: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/4.jpg)
4
Outline
Basic idea Open goals Threats The PSP algorithm Long example Comments
![Page 5: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/5.jpg)
5
Plan Space
![Page 6: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/6.jpg)
6
Plan-Space Planning - Basic Idea Backward search from the goal Each node of the search space is a partial plan
» A set of partially-instantiated actions» A set of constraints
Make more and more refinements,until we have a solution
Types of constraints: precedence constraint:
a must precede b binding constraints:
» inequality constraints, e.g., v1 ≠ v2 or v ≠ c» equality constraints (e.g., v1 = v2 or v = c) or substitutions
causal link:» use action a to establish the precondition p needed by action b
How to tell we have a solution: no more flaws in the plan Will discuss flaws and how to resolve them
a(x)Precond: …Effects: p(x)
b(y)Precond: p(y)Effects: …
c(x)Precond: p(x)Effects: …
p(x)
x ≠ y
![Page 7: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/7.jpg)
7
Flaw: An action a has a precondition p that we haven’t
decided how to establish
Resolving the flaw: Find an action b
• (either already in the plan, or insert it) that can be used to establish p
• can precede a and produce p Instantiate variables Create a causal link
a(y)Precond: …Effects: p(y)
c(x)Precond: p(x)Effects: …
a(x)Precond: …Effects: p(x)
c(x)Precond: p(x)Effects: …
p(x)
Open Goal
![Page 8: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/8.jpg)
8
Threat
Flaw: a deleted-condition interaction Action a establishes a condition (e.g., p(x)) for action b Another action c is capable of deleting this condition p(x)
Resolving the flaw: impose a constraint to prevent c from deleting p(x)
Three possibilities: Make b precede c Make c precede a Constrain variable(s)
to prevent c fromdeleting p(x)
a(x)Precond: …Effects: p(x)
c(y)Precond: …Effects: p(y)
b(x)Precond: p(x)Effects: …
p(x)
![Page 9: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/9.jpg)
9
The PSP Procedure
PSP is both sound and complete
![Page 10: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/10.jpg)
10
Example Similar (but not identical) to an example in Russell and Norvig’s
Artificial Intelligence: A Modern Approach (1st edition) Operators:
Start
Precond: none
Effects: At(Home), sells(HWS,Drill), Sells(SM,Milk), Sells(SM,Banana)
Finish
Precond: Have(Drill), Have(Milk), Have(Banana), At(Home) Go(l,m)
Precond: At(l)
Effects: At(m), At(l) Buy(p,s)
Precond: At(s), Sells(s,p)
Effects: Have(p)
![Page 11: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/11.jpg)
11
Example (continued)
Initial plan
Sells(SM,Milk), Sells(SM,Bananas) At(Home), Sells(HWS,Drill),
Have(Bananas), At(Home)Have(Drill), Have(Milk),
![Page 12: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/12.jpg)
12
Example (continued)
The only possible ways to establish the “Have” preconditions
At(s1), Sells(s1,Drill) At(s2), Sells(s2,Milk) At(s3), Sells(s3,Bananas)
Buy(Drill, s1) Buy(Milk, s2) Buy(Bananas, s2)
Have(Drill), Have(Milk), Have(Bananas), At(Home)
![Page 13: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/13.jpg)
13
Example (continued)
The only possible way to establish the “Sells” preconditions
Buy(Drill,HWS) Buy(Milk,SM) Buy(Bananas,SM)
At(SM), Sells(SM,Milk)At(HWS), Sells(HWS,Drill) At(SM), Sells(SM,Bananas)
Have(Drill), Have(Milk), Have(Bananas), At(Home)
![Page 14: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/14.jpg)
14
At(SM), Sells(SM,Milk)At(HWS), Sells(HWS,Drill) At(SM), Sells(SM,Bananas)
At(x)
Buy(Milk,SM) Buy(Bananas,SM)
At(l2)
Go(l2, SM)
At(l1)
Go(l1,HWS)
Buy(Drill,HWS)
Have(Drill), Have(Milk), Have(Bananas), At(Home)
Example (continued)
The only ways to establish At(HWS) and At(SM) Note the threats
![Page 15: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/15.jpg)
15
To resolve the third threat, make Buy(Drill) precede Go(SM) This resolves all three threats
Example (continued)
At(SM), Sells(SM,Milk)At(HWS), Sells(HWS,Drill) At(SM), Sells(SM,Bananas)
At(x)
Buy(Milk,SM) Buy(Bananas,SM)
At(l2)
Go(l2, SM)
At(l1)
Go(l1,HWS)
Buy(Drill,HWS)
Have(Drill), Have(Milk), Have(Bananas), At(Home)
![Page 16: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/16.jpg)
16
Example (continued)
Establish At(l1) with l1=Home
At(SM), Sells(SM,Milk)At(HWS), Sells(HWS,Drill) At(SM), Sells(SM,Bananas)
At(x)
Buy(Milk,SM) Buy(Bananas,SM)
At(l2)
Go(l2, SM)
At(Home)
Go(Home,HWS)
Buy(Drill,HWS)
Have(Drill), Have(Milk), Have(Bananas), At(Home)
![Page 17: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/17.jpg)
17
Example (continued)
Establish At(l2) with l2=HWS
Buy(Milk,SM) Buy(Bananas,SM)
At(x) At(HWS)
Go(HWS,SM)
At(Home)
Go(Home,HWS)
At(SM), Sells(SM,Milk)At(HWS), Sells(HWS,Drill) At(SM), Sells(SM,Bananas)
Buy(Drill,HWS)
Have(Drill), Have(Milk), Have(Bananas), At(Home)
![Page 18: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/18.jpg)
18
Example (continued)
Establish At(Home) for Finish
Buy(Milk,SM) Buy(Bananas,SM)
At(x) At(HWS)
Go(HWS,SM)
At(Home)
Go(Home,HWS)
At(SM), Sells(SM,Milk)At(HWS), Sells(HWS,Drill) At(SM), Sells(SM,Bananas)
Buy(Drill,HWS)
Have(Drill), Have(Milk), Have(Bananas), At(Home)
At(l3)
Go(l3, Home)
![Page 19: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/19.jpg)
19
Example (continued)
Constrain Go(Home) to remove threats to At(SM)
Buy(Milk,SM) Buy(Bananas,SM)
At(x) At(HWS)
Go(HWS,SM)
At(Home)
Go(Home,HWS)
At(SM), Sells(SM,Milk)At(HWS), Sells(HWS,Drill) At(SM), Sells(SM,Bananas)
Buy(Drill,HWS)
Have(Drill), Have(Milk), Have(Bananas), At(Home)
At(l3)
Go(l3, Home)
![Page 20: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/20.jpg)
20
Final Plan
Establish At(l3) with l3=SM
Buy(Milk,SM) Buy(Bananas,SM)
At(x) At(HWS)At(Home)
Go(Home,HWS)
At(SM), Sells(SM,Milk)At(HWS), Sells(HWS,Drill) At(SM), Sells(SM,Bananas)
Buy(Drill,HWS)
Have(Drill), Have(Milk), Have(Bananas), At(Home)
At(SM)
Go(SM,Home)
Go(HWS,SM)
![Page 21: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/21.jpg)
21
Comments
PSP doesn’t commit to orderings andinstantiations until necessary Avoids generating search trees like this one:
Problem: how to prune infinitely long paths? Loop detection is based on recognizing states
we’ve seen before In a partially ordered plan, we don’t know the states
Can we prune if we see the same action more than once?
a bc
b a
b a ba c
b c ac b
goal
go(b,a) go(a,b) go(b,a) at(a)• • •
No. Sometimes we might need the same action several times in different states of the world (see next slide)
![Page 22: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/22.jpg)
22
Example 3-digit binary counter starts at 000, want to get to 110
s0 = {d3=0, d2=0, d1=0}
g = {d3=1, d2=1, d1=0}
Operators to increment the counter by 1:
incr0
Precond: d1=0
Effects: d1=1
incr01
Precond: d2=0, d1=1
Effects: d2=1, d1=0
incr011
Precond: d3=0, d2=1, d1=1
Effects: d3=1, d2=0, d1=0
![Page 23: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/23.jpg)
23
A Weak Pruning Technique
Can prune all paths of length > n, where n = |{all possible states}| This doesn’t help very much
There’s not yet a good pruning technique for plan-space planning
Iterative deepening depth first search
![Page 24: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/24.jpg)
24
POP algorithm
POP((A, O, L), agenda, PossibleActions):1. If agenda is empty, return (A, O, L)2. Pick (Q, An) from agenda3. Ad = choose an action that adds Q.
a. If no such action exists, fail.b. Add the link Ad Ac to L and the ordering Ad < Ac to Oc. If Ad is new, add it to A.
4. Remove (Q, An) from agenda. If Ad is new, for each of its preconditions P add (P, Ad) to agenda.
5. For every action At that threatens any link Ap Ac1. Choose to add At < Ap or Ac < At to O.2. If neither choice is consistent, fail.
6. POP((A, O, L), agenda, PossibleActions)
Q
Q
![Page 25: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/25.jpg)
25
POP in the Blocks world
![Page 26: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/26.jpg)
26
POP in the Blocks world
![Page 27: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/27.jpg)
27
POP in the Blocks world
![Page 28: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/28.jpg)
28
POP in the Blocks world
![Page 29: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/29.jpg)
29
Conditional Effects & Disjunctions
![Page 30: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/30.jpg)
30
Universal Quantification
![Page 31: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/31.jpg)
31
Building Universal Base
![Page 32: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/32.jpg)
32
Building Universal Base (Cont.)
![Page 33: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/33.jpg)
33
An Example of Confrontation
![Page 34: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/34.jpg)
34
![Page 35: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/35.jpg)
35
Final Plan
![Page 36: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/36.jpg)
36
An Example of Universal Quantification
![Page 37: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/37.jpg)
37
![Page 38: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/38.jpg)
38
Final Plan
![Page 39: 1 Chapter 5 Plan-Space Planning. 2 Problem with state-space search In some cases we may try many different orderings of the same actions before realizing](https://reader035.vdocuments.site/reader035/viewer/2022070307/551a3f925503463e778b4ec1/html5/thumbnails/39.jpg)
39