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 10 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 10 1 Chapter 10 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) Sequence from S 0 Constraints on actions Plan Chapter 10 2 Chapter 10 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) – successors: ∗ sub-goals (unsatisfied precoditions) • Goal test: no sub-goals (no unsatisfied preconditions) Chapter 10 5 Chapter 10 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 10 6 Chapter 10 8

  3. Keeping track of change–Situation Calculus Describing actions II Facts hold in situations, rather than eternally Successor-state axioms solve the representational frame problem E.g., Holding ( Gold, Now ) rather than just Holding ( Gold ) Each axiom is “about” a predicate (not an action per se): Situation calculus is one way to represent change in FOL: P true afterwards ⇔ [ an action made P true Adds a situation argument to each non-eternal predicate ∨ P true already and no action made P false ] E.g., Now in Holding ( Gold, Now ) denotes a situation Situations are connected by the Result function Result ( a, s ) is the situation that results from doing a in s For holding the gold: ∀ a, s Holding ( Gold, Result ( a, s )) ⇔ PIT [( a = Grab ∧ AtGold ( s )) PIT G o l d ∨ ( Holding ( Gold, s ) ∧ a � = Release )] PIT PIT PIT G o l d S 1 PIT Forward S 0 Chapter 10 9 Chapter 10 11 Describing actions I Making Plans “Effect” axiom—describe changes due to action Initial condition in KB: ∀ s AtGold ( s ) ⇒ Holding ( Gold, Result ( Grab, s )) At ( Agent, [1 , 1] , S 0 ) At ( Gold, [1 , 2] , S 0 ) “Frame” axiom—describe non-changes due to action ∀ s HaveArrow ( s ) ⇒ HaveArrow ( Result ( Grab, s )) Query: Ask ( KB, ∃ s Holding ( Gold, s )) i.e., in what situation will I be holding the gold? Frame problem: find an elegant way to handle non-change (a) representation—avoid frame axioms Answer: { s/Result ( Grab, Result ( Forward, S 0 )) } (b) inference—avoid repeated “copy-overs” to keep track of state i.e., go forward and then grab the gold Qualification problem: true descriptions of real actions require endless caveats— This assumes that the agent is interested in plans starting at S 0 and that S 0 what if gold is slippery or nailed down or . . . is the only situation described in the KB Ramification problem: real actions have many secondary consequences— what about the dust on the gold, wear and tear on gloves, . . . Chapter 10 10 Chapter 10 12

  4. Making plans: A better way Partial Order Planning Represent plans as action sequences [ a 1 , a 2 , . . . , a n ] PlanResult ( p, s ) is the result of executing p in s Start Then the query Ask ( KB, ∃ p Holding ( Gold, PlanResult ( p, S 0 ))) has the solution { p/ [ Forward, Grab ] } Start Left Right Definition of PlanResult in terms of Result : Sock Sock ∀ s PlanResult ([ ] , s ) = s ∀ a, p, s PlanResult ([ a | p ] , s ) = PlanResult ( p, Result ( a, s )) LeftShoeOn, RightShoeOn LeftSockOn RightSockOn Planning systems are special-purpose reasoners designed to do this type of Left Right inference more efficiently than a general-purpose reasoner Finish Shoe Shoe LeftShoeOn, RightShoeOn Finish Chapter 10 13 Chapter 10 15 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 c – A → B : A acheives precondition c for B − – 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 10 14 Chapter 10 16

  5. Example Example Start Start At(Home) Sells(HWS,Drill) Sells(SM,Milk) Sells(SM,Ban.) At(Home) Go(HWS) At(HWS) Sells(HWS,Drill) Buy(Drill) At(HWS) Go(SM) At(SM) Sells(SM,Milk) At(SM) Sells(SM,Ban.) Buy(Milk) Buy(Ban.) At(SM) Go(Home) Have(Milk) At(Home) Have(Ban.) Have(Drill) Have(Milk) At(Home) Have(Ban.) Have(Drill) Finish Finish Chapter 10 17 Chapter 10 19 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 10 18 Chapter 10 20

  6. POP algorithm sketch Clobbering and promotion/demotion A clobberer is a potentially intervening step that destroys the condition function POP ( initial, goal, operators ) returns plan achieved by a causal link. E.g., Go ( Home ) clobbers At ( Supermarket ) : plan ← Make-Minimal-Plan ( initial, goal ) loop do DEMOTION if Solution? ( plan ) then return plan Demotion: put before Go ( Supermarket ) S need , c ← Select-Subgoal ( plan ) Go(Supermarket) Choose-Operator ( plan, operators , S need , c ) Resolve-Threats ( plan ) Go(Home) end At(Home) function Select-Subgoal ( plan ) returns S need , c At(Supermarket) pick a plan step S need from Steps ( plan ) Promotion: put after Buy ( Milk ) Buy(Milk) with a precondition c that has not been achieved return S need , c PROMOTION At(Home) Finish Chapter 10 21 Chapter 10 23 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 10 22 Chapter 10 24

Recommend


More recommend