Outline Searh vs. planning Planning STRIPS operators Partial-order planning Chapter 11 Artifiial Intelligene, lp4 2005/06, Reiner Hähnle, partly based on AIMA Slides Stuart Russell and Peter Norvig, 1998 Chapter 11 1 Artifiial Intelligene, lp4 2005/06, Reiner Hähnle, partly based on AIMA Slides Stuart Russell and Peter Norvig, 1998 Chapter 11 2 Searh vs. Planning Consider the task get milk, bananas, and a ordless drill Standard searh algorithms seem to fail miserably: Searh vs. Planning Cont d 1. Ations have requirements & onsequenes that should onstrain appliability in a given state: interation between ations and states needed 2. Most parts of the world are independent of most other parts: solve subgoals independently 3. Human beings plan goal-direted; they onstrut important intermediate solutions first: flexible sequene for onstrution of solution Artifiial Intelligene, lp4 2005/06, Reiner Hähnle, partly based on AIMA Slides Stuart Russell and Peter Norvig, 1998 Chapter 11 3 Artifiial Intelligene, lp4 2005/06, Reiner Hähnle, partly based on AIMA Slides Stuart Russell and Peter Norvig, 1998 Chapter 11 4
Searh vs. Planning Cont d Planning systems do the following: 1) unify ation and goal representation to allow seletion (use logial language for both) 2) divide-and-onquer by subgoaling 3) relax requirement for sequential onstrution of solutions Searh Planning States Data strutures Logial sentenes Ations Code Preonditions/outomes Goal Code Logial sentene (onjuntion) Plan Sequene from S 0 Constraints on sequene of ations STRIPS Operators Tidily arranged ation desriptions, restrited language (f.-free literals) State: At(Home), Have(Milk), Have(Bananas), Have(Drill) Ation: Buy(x) Preondition: At(p), Sells(p, x) Effet: Have(x) Restrited language effiient algorithm Artifiial Intelligene, lp4 2005/06, Reiner Hähnle, partly based on AIMA Slides Stuart Russell and Peter Norvig, 1998 Chapter 11 5 Artifiial Intelligene, lp4 2005/06, Reiner Hähnle, partly based on AIMA Slides Stuart Russell and Peter Norvig, 1998 Chapter 11 6 STRIPS Operators Cont d State: Conjuntion of ground (= variable-free) literals Ation Desription: positive literal Preondition: Conjuntion of positive literals Effet: Conjuntion of literals Goal: Conjuntion of literals Find a sequene of ations that make instane of Goal true, if exeuted. [Cf. Answers in Logial Dedution: instane of formula entailed by KB.] Strips operator: Op ation, preond, effet Operator shema: operator ontaining variables. Operator o appliable in state s if there is substitution σ with σ(preond(o)) s Resulting state: σ(effet(o)) {L s L σ(effet(o))} State Spae vs. Plan Spae Standard searh: node = onrete world state Planning searh: node = partial plan (Partial) Plan onsists of: 1. Set of operator shemas steps S i for the problem 2. Partial (temporal) order onstraints S i S j 3. Binding (substitution) for variables in the S i 4. Causal Links S i S j S i ahieves preond(s j ) reord purpose of steps Defn: open ondition is a preondition of a step not yet ausally linked Operators on partial plans: add a ausal link from an existing ation to an open ondition add a step to ahieve an open ondition order one step wrt another Gradually move from inomplete/vague plans to omplete, orret plans Artifiial Intelligene, lp4 2005/06, Reiner Hähnle, partly based on AIMA Slides Stuart Russell and Peter Norvig, 1998 Chapter 11 7 Artifiial Intelligene, lp4 2005/06, Reiner Hähnle, partly based on AIMA Slides Stuart Russell and Peter Norvig, 1998 Chapter 11 8
Partially ordered plans From Plan to Solution A plan is onsistent if, are partial orders and eah variable bound to exatly one onstant Complete and onsistent partially ordered plan used to ompute solution topologial sort of steps gives linear sequene of ations ayli order: linearizations well-defined different linearizations: same plan, but different ation sequene Speial steps with empty ation: Start (no preond, assumptions as effet); Finish (Goal as preond, no effet) all preonditions ahieved: preondition established by earlier step and not undone A plan is omplete iff every preondition is ahieved: A preondition of a step S j is ahieved (by S i ) if (i) S i S j, (ii) effet(s i ), and (iii) no linearization S i S k S j with effet(s k ) Artifiial Intelligene, lp4 2005/06, Reiner Hähnle, partly based on AIMA Slides Stuart Russell and Peter Norvig, 1998 Chapter 11 9 Artifiial Intelligene, lp4 2005/06, Reiner Hähnle, partly based on AIMA Slides Stuart Russell and Peter Norvig, 1998 Chapter 11 10 POP (Partial Order Planner) Algorithm Sketh POP Algorithm Cont d funtion POP(initial, goal, operators) returns plan plan Make-Minimal-Plan(initial, goal) loop do if Solution?( plan) then return plan % omplete and onsistent S need, Selet-Subgoal( plan) Choose-Operator( plan, operators, S need, ) Resolve-Threats( plan) end funtion Selet-Subgoal( plan) returns S need, pik a plan step S need from Steps( plan) with a preondition that has not been ahieved return S need, Depth-first searh with partially ordered plans as states Baktraks over hoies in Choose-Operator and Resolve-Threats proedure Choose-Operator(plan, operators, S need,) hoose a step S add from operators or Steps( plan) that has as an effet if there is no suh step then fail add the ausal link S add S need to Links( plan) add the ordering onstraint S add S need to Orderings( plan) if S add is a newly added step from operators then add S add to Steps( plan) add Start S add F inish to Orderings( plan) proedure Resolve-Threats(plan) for eah S threat that threatens a link S i S j in Links( plan) do hoose 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 Simple version for positive ground literals as ations Threat: ahieved preondition that an be undone in some linearization Artifiial Intelligene, lp4 2005/06, Reiner Hähnle, partly based on AIMA Slides Stuart Russell and Peter Norvig, 1998 Chapter 11 11 Artifiial Intelligene, lp4 2005/06, Reiner Hähnle, partly based on AIMA Slides Stuart Russell and Peter Norvig, 1998 Chapter 11 12
Clobbering and promotion/demotion A lobberer or threat is a potentially intervening step that destroys the ondition ahieved by a ausal link. E.g., Go(Home) lobbers At(HWS): Demotion: put before Go(HWS) Properties of POP Depth-first searh, baktraks over hoiepoints on failure: hoie of S add to ahieve S need hoie of promotion or demotion for lobberer All preond(s need ) have to be ahieved: no hoiepoint Promotion: put after Buy(Drill) POP is sound, omplete, and systemati (no repetition of plans) Language extensions for disjuntion, universals, negation, onditionals Effiient with good heuristis from problem desription Good for problems with loosely related subgoals Artifiial Intelligene, lp4 2005/06, Reiner Hähnle, partly based on AIMA Slides Stuart Russell and Peter Norvig, 1998 Chapter 11 13 Artifiial Intelligene, lp4 2005/06, Reiner Hähnle, partly based on AIMA Slides Stuart Russell and Peter Norvig, 1998 Chapter 11 14 Example: Bloks world Example Cont d Artifiial Intelligene, lp4 2005/06, Reiner Hähnle, partly based on AIMA Slides Stuart Russell and Peter Norvig, 1998 Chapter 11 15 Artifiial Intelligene, lp4 2005/06, Reiner Hähnle, partly based on AIMA Slides Stuart Russell and Peter Norvig, 1998 Chapter 11 16
Artifiial Intelligene, lp4 2005/06, Reiner Hähnle, partly based on AIMA Slides Stuart Russell and Peter Norvig, 1998 Chapter 11 17 Artifiial Intelligene, lp4 2005/06, Reiner Hähnle, partly based on AIMA Slides Stuart Russell and Peter Norvig, 1998 Chapter 11 18 Summary Differs from GP searh: (i) operations & states interat; (ii) subgoals solved independently; (iii) non-linear searh for solution STRIPS: restrited format for ations, logi-based Nodes in searh spae are partial plans POP algorithm, depth-first searh Artifiial Intelligene, lp4 2005/06, Reiner Hähnle, partly based on AIMA Slides Stuart Russell and Peter Norvig, 1998 Chapter 11 19 Artifiial Intelligene, lp4 2005/06, Reiner Hähnle, partly based on AIMA Slides Stuart Russell and Peter Norvig, 1998 Chapter 11 20