Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:

Similar presentations


Presentation on theme: "Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:"— Presentation transcript:

1 Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 1 Chapter 5 Plan-Space Planning Dana S. Nau CMSC 722, AI Planning University of Maryland, Fall 2004 Lecture slides for Automated Planning: Theory and Practice

2 Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 2 l Problem with state-space search u In some cases we may try many different orderings of the same actions before realizing there is no solution l Least-commitment strategy: don’t commit to orderings, instantiations, etc., until necessary Motivation a b c b a b a b a c b c a c b goal … … … … … … dead end

3 Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 3 Outline l Basic idea l Open goals l Threats l The PSP algorithm l Long example l Comments

4 Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 4 Plan-Space Planning - Basic Idea l Backward search from the goal l Each node of the search space is a partial plan »A set of partially-instantiated actions »A set of constraints u Make more and more refinements, until we have a solution l Types of constraints: u precedence constraint: a must precede b u binding constraints: »inequality constraints, e.g., v 1 ≠ v 2 or v ≠ c »equality constraints (e.g., v 1 = v 2 or v = c) or substitutions u causal link: »use action a to establish the precondition p needed by action b l How to tell we have a solution: no more flaws in the plan u 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

5 Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 5 l Flaw: u An action a has a precondition p that we haven’t decided how to establish l Resolving the flaw: u Find an action b (either already in the plan, or insert it) u that can be used to establish p can precede a and produce p u Instantiate variables u 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

6 Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 6 Threat l Flaw: a deleted-condition interaction u Action a establishes a condition (e.g., p(x)) for action b u Another action c is capable of deleting this condition p(x) l Resolving the flaw: u impose a constraint to prevent c from deleting p(x) l Three possibilities: u Make b precede c u Make c precede a u Constrain variable(s) to prevent c from deleting p(x) a(x) Precond: … Effects: p(x) c(y) Precond: … Effects:  p(y) b(x) Precond: p(x) Effects: … p(x)

7 Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 7 The PSP Procedure l PSP is both sound and complete

8 Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 8 Example l Similar (but not identical) to an example in Russell and Norvig’s Artificial Intelligence: A Modern Approach (1st edition) l Operators: u Start Precond: none Effects: At(Home), sells(HWS,Drill), Sells(SM,Milk), Sells(SM,Banana) u Finish Precond: Have(Drill), Have(Milk), Have(Banana), At(Home) u Go(l,m) Precond: At(l) Effects: At(m),  At(l) u Buy(p,s) Precond: At(s), Sells(s,p) Effects: Have(p)

9 Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 9 Example (continued) l Initial plan Sells(SM,Milk), Sells(SM,Bananas) At(Home), Sells(HWS,Drill), Have(Bananas), At(Home) Have(Drill), Have(Milk),

10 Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 10 Example (continued) l The only possible ways to establish the “Have” preconditions At(s 1 ), Sells(s 1,Drill) At(s 2 ), Sells(s 2,Milk)At(s 3 ), Sells(s 3,Bananas) Buy(Drill, s 1 ) Buy(Milk, s 2 ) Buy(Bananas, s 2 ) Have(Drill), Have(Milk), Have(Bananas), At(Home)

11 Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 11 Example (continued) l 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)

12 Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 12 At(SM), Sells(SM,Milk) At(HWS), Sells(HWS,Drill) At(SM), Sells(SM,Bananas) At(x) Buy(Milk,SM)Buy(Bananas,SM) At(l 2 ) Go(l 2, SM) At(l 1 ) Go(l 1,HWS) Buy(Drill,HWS) Have(Drill), Have(Milk), Have(Bananas), At(Home) Example (continued) l The only ways to establish At(HWS) and At(SM) u Note the threats

13 Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 13 l To resolve the third threat, make Buy(Drill) precede Go(SM) u 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(l 2 ) Go(l 2, SM) At(l 1 ) Go(l 1,HWS) Buy(Drill,HWS) Have(Drill), Have(Milk), Have(Bananas), At(Home)

14 Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 14 Example (continued) l Establish At(l 1 ) with l 1 =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(l 2 ) Go(l 2, SM) At(Home) Go(Home,HWS) Buy(Drill,HWS) Have(Drill), Have(Milk), Have(Bananas), At(Home)

15 Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 15 Example (continued) l Establish At(l 2 ) with l 2 =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)

16 Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 16 Example (continued) l 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(l 3 ) Go(l 3, Home)

17 Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 17 Example (continued) l 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(l 3 ) Go(l 3, Home)

18 Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 18 Final Plan l Establish At(l 3 ) with l 3 =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)

19 Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 19 Comments l PSP doesn’t commit to orderings and instantiations until necessary u Avoids generating search trees like this one: l Problem: how to prune infinitely long paths? u Loop detection is based on recognizing states we’ve seen before u In a partially ordered plan, we don’t know the states l Can we prune if we see the same action more than once? a b c b a b a b a c b c a c 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)

20 Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 20 Example l 3-digit binary counter starts at 000, want to get to 110 s 0 = {d3=0, d2=0, d1=0} g = {d3=1, d2=1, d1=0} l Operators to increment the counter by 1: incr0 Precond: d 1 =0 Effects: d 1 =1 incr01 Precond: d 2 =0, d 1 =1 Effects: d 2 =1, d 1 =0 incr011 Precond: d 3 =0, d 2 =1, d 1 =1 Effects: d 3 =1, d 2 =0, d 1 =0

21 Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License: http://creativecommons.org/licenses/by-nc-sa/2.0/ 21 A Weak Pruning Technique l Can prune all paths of length > n, where n = |{all possible states}| u This doesn’t help very much l I’m not sure whether there’s a good pruning technique for plan- space planning


Download ppt "Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:"

Similar presentations


Ads by Google