PlanSpace Planning Sources Ch 5 Appendix A Slides

  • Slides: 25
Download presentation
Plan-Space Planning Sources: • Ch. 5 • Appendix A • Slides from Dana Nau’s

Plan-Space Planning Sources: • Ch. 5 • Appendix A • Slides from Dana Nau’s lecture Dr. Héctor Muñoz-Avila 1

Domains for Evaluations http: //members. deri. at/~joergh/ff-domains. html Choose one of the following: Assembly

Domains for Evaluations http: //members. deri. at/~joergh/ff-domains. html Choose one of the following: Assembly Freecell Fridge Logistics Miconic-STRIPS Schedule Tyreworld E-mail me your choice. First take, first get. You may need to adapt domain to run in a system. You need 30 problems. Create them manually, or Use a random problem generator (yours or create one) Problems must scale: 4 goals, 5 goals, …, 9 goals (5 problems each) 2

Remember the Sussman Anomaly? a c a b b Initial state c goal A

Remember the Sussman Anomaly? a c a b b Initial state c goal A set of goals G is serializable if: An ordering g 1, …, gn of the goals in G can be found such as: » Every plan P 1 satisfying g 1, can be extended to a plan P 2 satisfying g 1 and g 2, and so forth • Extend means that neither constraints nor steps in P 1 need to be removed to obtain P 2 Problem: Goals in the Sussman Anomaly are not serializable This is not an exception. Goals for many problems are not 3 serializable

Plan-Space Planning • Search is performed in the plan space Initial plan • Plan

Plan-Space Planning • Search is performed in the plan space Initial plan • Plan space • V: set of plans complete • E: plan refinement plan for transitions goals • As before: computed graph is a subset of plan space • Remember the number of states for DWR states? • Least commitment: • Does not commit on action ordering 4

Plan-Space Planning - Basic Idea Backward search from the goal Each node of the

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 Can this b(y) Make more and more refinements, x≠y link be made? Precond: p(y) until we have a solution Effects: … Types of constraints: a(x) precedence constraint: Precond: … a must precede b Effects: p(x) c(x) binding constraints: p(x) Precond: p(x) » inequality constraints, e. g. , v 1 ≠ v 2 or v ≠ c Effects: … » equality constraints (e. g. , v 1 = v 2 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 partial plan is complete if plan has no flaws Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 5

Open Goal Flaw: An action a has a precondition p that we haven’t decided

Open Goal Flaw: An action a has a precondition p that we haven’t decided how to establish a(y) Precond: … Effects: p(y) 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 a(x) Create a causal link Precond: … Effects: p(x) c(x) Precond: p(x) Effects: … c(x) p(x) Precond: p(x) Effects: … Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 6

Threat Flaw: a deleted-condition interaction Action a establishes a condition (e. g. , p(x))

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) » And action c is “parallel” to the causal link Resolving the flaw: impose a constraint to prevent c from deleting p(x) Three possibilities: a(x) b(x) Precond: … p(x) Precond: p(x) Make b precede c Effects: p(x) Effects: … Make c precede a Constrain variable(s) c(y) to prevent c from Precond: … deleting p(x) Effects: p(y) 7

The PSP Procedure PSP is both sound and complete See next slide Dana Nau:

The PSP Procedure PSP is both sound and complete See next slide Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 8

Solution: A Complete Partial Plan: any sequence of actions = a 1, a 2,

Solution: A Complete Partial Plan: any sequence of actions = a 1, a 2, …, an such that each ai is a ground instance of an operator in O The plan is a solution for P=(O, s 0, g) if it is executable and achieves g i. e. , if there are states s 0, s 1, …, sn such that » (s 0, a 1) = s 1 » (s 1, a 2) = s 2 » … » (sn– 1, an) = sn » sn satisfies g But in PSP returns a “complete partial plan”. Is this a solution in terms of the definition of plans above? 9

Example Similar (but not identical) to an example in Russell and Norvig’s Artificial Intelligence:

Example Similar (but not identical) to an example in Russell and Norvig’s Artificial Intelligence: A Modern Approach (1 st 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) Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 10

Example (continued) Initial plan At(Home), Sells(HWS, Drill), Have(Drill), Have(Milk), Sells(SM, Milk), Sells(SM, Bananas) Have(Bananas),

Example (continued) Initial plan At(Home), Sells(HWS, Drill), Have(Drill), Have(Milk), Sells(SM, Milk), Sells(SM, Bananas) Have(Bananas), At(Home) Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 11

Example (continued) The only possible ways to establish the “Have” preconditions “standardization” At(s 1),

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

Example (continued) The only possible way to establish the “Sells” preconditions At(HWS), Sells(HWS, Drill)

Example (continued) The only possible way to establish the “Sells” preconditions At(HWS), Sells(HWS, Drill) Buy(Drill, HWS) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Bananas) Buy(Milk, SM) Buy(Bananas, SM) Have(Drill), Have(Milk), Have(Bananas), At(Home) Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 13

Example (continued) The only ways to establish At(HWS) and At(SM) Let us enumerate threats

Example (continued) The only ways to establish At(HWS) and At(SM) Let us enumerate threats At(l 1) At(l 2) At(x) Go(l 1, HWS) Go(l 2, SM) At(HWS), Sells(HWS, Drill) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Bananas) Buy(Drill, HWS) How can we solve all these threats in one step? Buy(Milk, SM) Buy(Bananas, SM) Have(Drill), Have(Milk), Have(Bananas), At(Home) Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 14

Example (continued) To resolve third threat, make Buy(Drill) precede Go(SM) This resolves all three

Example (continued) To resolve third threat, make Buy(Drill) precede Go(SM) This resolves all three threats At(l 1) At(l 2) At(x) Go(l 1, HWS) Go(l 2, SM) At(HWS), Sells(HWS, Drill) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Bananas) Buy(Drill, HWS) Buy(Milk, SM) Buy(Bananas, SM) Have(Drill), Have(Milk), Have(Bananas), At(Home) Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 15

Example (continued) Establish At(l 1) with l 1=Home At(Home) At(l 2) At(x) Go(Home, HWS)

Example (continued) Establish At(l 1) with l 1=Home At(Home) At(l 2) At(x) Go(Home, HWS) Go(l 2, SM) At(HWS), Sells(HWS, Drill) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Bananas) Buy(Drill, HWS) Buy(Milk, SM) Buy(Bananas, SM) Have(Drill), Have(Milk), Have(Bananas), At(Home) Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 16

Example (continued) Establish At(l 2) with l 2=HWS At(Home) At(HWS) At(x) Go(Home, HWS) Go(HWS,

Example (continued) Establish At(l 2) with l 2=HWS At(Home) At(HWS) At(x) Go(Home, HWS) Go(HWS, SM) At(HWS), Sells(HWS, Drill) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Bananas) Buy(Drill, HWS) Buy(Milk, SM) Buy(Bananas, SM) Have(Drill), Have(Milk), Have(Bananas), At(Home) Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 17

Example (continued) Establish At(Home) for Finish At(Home) At(HWS) At(x) Go(Home, HWS) Go(HWS, SM) At(HWS),

Example (continued) Establish At(Home) for Finish At(Home) At(HWS) At(x) Go(Home, HWS) Go(HWS, SM) At(HWS), Sells(HWS, Drill) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Bananas) Buy(Drill, HWS) Buy(Milk, SM) Buy(Bananas, SM) At(l 3) Go(l 3, Home) Have(Drill), Have(Milk), Have(Bananas), At(Home) Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 18

Example (continued) Constrain Go(Home) to remove threats to At(SM) At(Home) At(HWS) At(x) Go(Home, HWS)

Example (continued) Constrain Go(Home) to remove threats to At(SM) At(Home) At(HWS) At(x) Go(Home, HWS) Go(HWS, SM) At(HWS), Sells(HWS, Drill) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Bananas) Buy(Drill, HWS) Buy(Milk, SM) Buy(Bananas, SM) At(l 3) Go(l 3, Home) Have(Drill), Have(Milk), Have(Bananas), At(Home) Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 19

Complete Partial Plan Establish At(l 3) with l 3=SM At(Home) At(HWS) At(x) Go(Home, HWS)

Complete Partial Plan Establish At(l 3) with l 3=SM At(Home) At(HWS) At(x) Go(Home, HWS) Go(HWS, SM) At(HWS), Sells(HWS, Drill) At(SM), Sells(SM, Milk) At(SM), Sells(SM, Bananas) Buy(Drill, HWS) Buy(Milk, SM) Buy(Bananas, SM) At(SM) Go(SM, Home) Have(Drill), Have(Milk), Have(Bananas), At(Home) Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-Non. Commercial-Share. Alike License: http: //creativecommons. org/licenses/by-nc-sa/2. 0/ 20

Comments PSP doesn’t commit to orderings and instantiations until necessary Avoids generating search trees

Comments PSP doesn’t commit to orderings and instantiations until necessary Avoids generating search trees like this one: a b b a a c b c c b 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 » Computing an state is NP complete Can we prune if we see the same action more than once? • • • go(b, a) go(a, b) go(b, a) c b goal a at(a) No. Sometimes we might need the same action several times in different states of the world (see next slide) 21

Example 3 -digit binary counter starts at 000, want to get to 110 s

Example 3 -digit binary counter starts at 000, want to get to 110 s 0 = {d 3=0, d 2=0, d 1=0} g = {d 3=1, d 2=1, d 1=0} Operators to increment the counter by 1: incr 0 Precond: d 1=0 Effects: d 1=1 incr 01 Precond: d 2=0, d 1=1 Effects: d 2=1, d 1=0 Veloso call this “linkiability” incr 011 Precond: d 3=0, d 2=1, d 1=1 Effects: d 3=1, d 2=0, d 1=0 22

Comments (II) Note a potential combinatorial problem when solving threats Can someone explain? Why

Comments (II) Note a potential combinatorial problem when solving threats Can someone explain? Why does PSP solves the Sussman Anomaly? Heuristics for PSP might be harder to formulate than with state space planning Why? Universal Classical Planning Combines state-space and plan-space planning in an unified framework 23

Reminder: STRIPS and the Sussman Anomaly a b c a c b A Pick

Reminder: STRIPS and the Sussman Anomaly a b c a c b A Pick up C Put C on table Pick up A Put A on B B C C A B Pick up B Put B on C B C A 24

POP and the Sussman Anomaly a b c a c b A Pick up

POP and the Sussman Anomaly a b c a c b A Pick up C Put C on table Can we sort these steps to achieve these two goals? C A B Put A on B Pick up A Pick up B Put B on C B B C 25