search vs planning
play

Search vs. planning Consider the task get milk, bananas, and a - PowerPoint PPT Presentation

Search vs. planning Consider the task get milk, bananas, and a cordless drill Standard search algorithms seem to fail miserably: Talk to Parrot Planning Go To Pet Store Buy a Dog Go To School Go To Class Go To Supermarket Buy Tuna Fish


  1. Search vs. planning Consider the task get milk, bananas, and a cordless drill Standard search algorithms seem to fail miserably: Talk to Parrot Planning Go To Pet Store Buy a Dog Go To School Go To Class Go To Supermarket Buy Tuna Fish Start Chapter 11 Go To Sleep Buy Arugula Read A Book Buy Milk ... Finish Sit in Chair Sit Some More Etc. Etc. ... Read A Book . . . After-the-fact heuristic/goal test inadequate Chapter 11 1 Chapter 11 3 Outline Search vs. planning contd. ♦ Search vs. planning Planning systems do the following: 1) open up action and goal representation to allow selection ♦ STRIPS operators 2) divide-and-conquer by subgoaling 3) relax requirement for sequential construction of solutions ♦ Partial-order planning Search Planning Lisp data structures Logical sentences States Actions Lisp code Preconditions/outcomes Goal Lisp code Logical sentence (conjunction) f Plan Sequence from S 0 Constraints on actions Chapter 11 2 Chapter 11 4

  2. STRIPS operators Backward State-space Search Tidily arranged actions descriptions, restricted language ♦ aka Regression Planning ♦ similar to Backward Chaining Action : Buy ( x ) At(p) Sells(p,x) Precondition : At ( p ) , Sells ( p, x ) ♦ Difficult if the goal is described as constraints (e.g. 4 gallons in the large Effect : Have ( x ) Buy(x) jug)—potentially many goal states. [Note: this abstracts away many important details!] Have(x) ♦ A goal can be divided into sub-goals (children). Restricted language ⇒ efficient algorithm ♦ State-space formulation • Precondition: conjunction of positive literals • Initial State: goal state • Effect: conjunction of literals • Actions: operations that can acheive the goal/sub-goal – postive effect: add literals – not undo any super-goals [parent goals/preconditions] – negative effect: remove literals (negated literals) – succesors: ∗ sub-goals (unsatisfied precoditions) • Goal test: no sub-goals (no unsatisfied preconditions) Chapter 11 5 Chapter 11 7 Forward State-space Search Admissible Heuristics ♦ Relaxed problem ♦ aka Progression Planning ♦ similar to Forward Chaining • remove all precoditions—every action is applicable • remove all negative effects—no action removes a literal ♦ State-space formulation (note that the goal is a conjuction of literals) • Initial State: initial KB • subgoal independence—achieving one subgoal does not affect achieving • Actions: operators whose preconditions are satisfied another subgoal – successors: ∗ postive effect: add literals ∗ negative effect: remove literals • Goal test: goal state • Step cost: typically 1 Chapter 11 6 Chapter 11 8

  3. Partial Order Planning Components of Partial Order Planning ♦ sequential planning: forward (or backward) step-by-step search • Actions – “Start” action: no preconditions, effects = initial state ♦ Consider planning a trip to New York by flying – “Finish” action: preconditions = goal state, no effects 1. start with finding how to get from home to the Melboune airport – (regular) actions with precondtions and effects • Ordering contraints between actions 2. start with finding how to get from the New York airport to hotel – A ≺ B : A is before B (partial order) 3. start with finding a plane ticket from Melbourne to New York – LeftSock ≺ LeftShoe ♦ least commitment strategy—delay making committments to steps that • Causal links from effect of one action to the precondition of another are less important/constrained – A → B : A acheives precondition c for B c − – LeftSock LeftSockOn LeftShoe − → – other actions cannot conflict with the causal link: ¬ LeftSockOn • Open preconditions – not acheived by any action yet – planner: add actions until there are no open preconditions Chapter 11 9 Chapter 11 11 Partial Order Planning Example Start At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.) Start Start Left Right Sock Sock LeftShoeOn, RightShoeOn LeftSockOn RightSockOn Left Right Finish Shoe Shoe LeftShoeOn, RightShoeOn Finish Have(Milk) At(Home) Have(Ban.) Have(Drill) Finish Chapter 11 10 Chapter 11 12

  4. Example Planning process Start Operators on partial plans: At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.) add a link from an existing action to an open condition add a step to fulfill an open condition order one step wrt another to remove possible conflicts At(HWS) Sells(HWS,Drill) Gradually move from incomplete/vague plans to complete, correct plans Buy(Drill) Backtrack if an open condition is unachievable or At(x) if a conflict is unresolvable Go(SM) Topological Sorting in graphs At(SM) Sells(SM,Milk) Buy(Milk) Have(Milk) At(Home) Have(Ban.) Have(Drill) Finish Chapter 11 13 Chapter 11 15 Example POP algorithm sketch Start function POP ( initial, goal, operators ) returns plan At(Home) plan ← Make-Minimal-Plan ( initial, goal ) loop do Go(HWS) if Solution? ( plan ) then return plan S need , c ← Select-Subgoal ( plan ) At(HWS) Sells(HWS,Drill) Choose-Operator ( plan, operators , S need , c ) Buy(Drill) Resolve-Threats ( plan ) end At(HWS) Go(SM) function Select-Subgoal ( plan ) returns S need , c At(SM) Sells(SM,Milk) At(SM) Sells(SM,Ban.) pick a plan step S need from Steps ( plan ) with a precondition c that has not been achieved Buy(Milk) Buy(Ban.) return S need , c At(SM) Go(Home) Have(Milk) At(Home) Have(Ban.) Have(Drill) Finish Chapter 11 14 Chapter 11 16

  5. POP algorithm contd. Properties of POP Nondeterministic algorithm: backtracks at choice points on failure: procedure Choose-Operator ( plan, operators, S need , c ) – choice of S add to achieve S need choose a step S add from operators or Steps ( plan ) that has c as an effect – choice of demotion or promotion for clobberer if there is no such step then fail – selection of S need is irrevocable c add the causal link S add → S need to Links ( plan ) − add the ordering constraint S add ≺ S need to Orderings ( plan ) POP is sound, complete, and systematic (no repetition) if S add is a newly added step from operators then add S add to Steps ( plan ) Extensions for disjunction, universals, negation, conditionals add Start ≺ S add ≺ Finish to Orderings ( plan ) Can be made efficient with good heuristics derived from problem description procedure Resolve-Threats ( plan ) Particularly good for problems with many loosely related subgoals c for each S threat that threatens a link S i → S j in Links ( plan ) do − choose either Demotion: Add S threat ≺ S i to Orderings ( plan ) Promotion: Add S j ≺ S threat to Orderings ( plan ) if not Consistent ( plan ) then fail end Chapter 11 17 Chapter 11 19 Example: Blocks world Clobbering and promotion/demotion A clobberer is a potentially intervening step that destroys the condition "Sussman anomaly" problem A achieved by a causal link. E.g., Go ( Home ) clobbers At ( Supermarket ) : C B DEMOTION B A C Demotion: put before Go ( Supermarket ) Go(Supermarket) Start State Goal State Go(Home) Clear(x) On(x,z) Clear(y) Clear(x) On(x,z) At(Home) PutOn(x,y) PutOnTable(x) At(Supermarket) ~On(x,z) ~Clear(y) ~On(x,z) Clear(z) On(x,Table) Promotion: put after Buy ( Milk ) Buy(Milk) Clear(z) On(x,y) + several inequality constraints PROMOTION At(Home) Finish [Linear planners (find a plan for each subgoal and concatenate the plans) can’t find a solution] Chapter 11 18 Chapter 11 20

  6. Example contd. Example contd. C C START START B A B A On(C,A) On(A,Table) Cl(B) On(B,Table) Cl(C) On(C,A) On(A,Table) Cl(B) On(B,Table) Cl(C) PutOn(A,B) clobbers Cl(B) => order after PutOn(B,C) Cl(B) On(B,z) Cl(C) Cl(A) On(A,z) Cl(B) PutOn(B,C) PutOn(A,B) A A On(A,B) On(B,C) On(A,B) On(B,C) B B FINISH FINISH C C Chapter 11 21 Chapter 11 23 Example contd. Example contd. C C START START B A B A On(C,A) On(A,Table) Cl(B) On(B,Table) Cl(C) On(C,A) On(A,Table) Cl(B) On(B,Table) Cl(C) PutOn(A,B) clobbers Cl(B) => order after PutOn(B,C) On(C,z) Cl(C) PutOn(B,C) PutOnTable(C) clobbers Cl(C) => order after PutOnTable(C) Cl(B) On(B,z) Cl(C) Cl(B) On(B,z) Cl(C) Cl(A) On(A,z) Cl(B) PutOn(B,C) PutOn(B,C) PutOn(A,B) A A On(A,B) On(B,C) On(A,B) On(B,C) B B FINISH FINISH C C Chapter 11 22 Chapter 11 24

  7. Heuristics ♦ Which open precondition to choose? • most constrained open precondition – can be satisfied in the fewest number of ways • can provide substantial speedups – if it can’t be satisfied, stop early and return fail – if it can be satisfied by only one way, no choice anyhow and can reduce the number of possibilities later on Chapter 11 25

Recommend


More recommend