220 likes | 361 Views
Planning. Tuomas Sandholm Carnegie Mellon University Computer Science Department. Planning. Search-based problem solving. Actions: generate successor states States: completely described & only used for successor generation, heuristic fn. Evaluation & goal testing.
E N D
Planning Tuomas Sandholm Carnegie Mellon University Computer Science Department
Search-based problem solving Actions: generate successor states States: completely described & only used for successor generation, heuristic fn. Evaluation & goal testing. Goals: represented via goal test & heuristic fn. Black boxes: cannot look inside to select actions that might be useful Representation of plans: unbroken sequences of actions forward from initial states (or backward from goal state)
“Get a quart of milk, a bunch of bananas and a variable-speed cordless drill.”
From problem solving to planning • “Open up” the representation (usually FOL or a subset) • State & goals : set of sentences • Actions: preconditions & effects • Direct connections between state & actions used in choice of actions • Actions can be added to the plan whenever needed. (Also, actions operate on partial state descriptions) • Most part of the world are independent divide the plan into subplans. Real world vs. puzzles
STRIPS language States are conjunctions of function-free ground literals At (home) ^ Have(milk) ^ Have(bananas) ^ Have(drill) ^ … Often assumed that if a positive literal does not appear, then the negation can be assumed (aka. closed world assumption) Goals are also conjunctions of literals, but may contain variables At(x) ^ Sells(x, Milk)
STRIPS language … Actions Precondition: conjunctions of positive literals At(here), Path(here, there) operator Go (there) effects: conjunction of literals At(there), At(here) “add list” & “delete list” An operator is applicable in states if there is some way to instantiate the variables in the operator s.t. every one of the preconditions is true.
Planning Situation-space planning Progression planning (forward from initial state) high branching factor Regression planning (backward from goal) But often need to achieve a conjunction of goals. STRIPS was incomplete. Fixing it with an adequate method for handling conjunction goals is inefficient. Plan-space planning Refinement ops vs. modification ops … instantiate a var fully vs. partially instantiated plan add op Least-commitment planning Impose ordering between 2 ops Partial vs. total order
Start Start Initial State Goal State LeftShoeOn RightShoeOn Finish Finish (a) (b)
Planning • Plan has • Set of steps (one op per step) • Set of binary ordering constraints on steps • A set of variable binding constraints • A set of causal links. Si Sj “Si achieves preconditions c for Sj” • The planner only considers adding steps that serve to achieve a precondition that has not yet been achieved. A solution is a complete consistent plan. Every precondition is achieved by some other step. No contradiction in the ordering or binding constraints
Planning E.g. Actions: Op(ACTION: Go(there), PRECOND: At(here), EFFECT: At(there) ^ At(here)) Op(ACTION: Buy(x), PRECOND: At(store) ^ Sells(store,x) EFFECT: Have(x)) Start At(Home) Sells(SM, Banana) Sells(SM,Milk) Sells(HWS,Drill) Have(Drill) Have(Milk) Have(Banana) At(Home) Finish
Planning Ordering constraints Start At(s), Sells(s,Drill) At(s), Sells(s,Milk) At(s), Sells(s,Bananas) Buy(Drill) Buy(Milk) Buy(Bananas) Have(Drill), Have(Milk), Have(Bananas), At(Home) Finish Causal links (protected) Have light arrows at every bold arrow. Start At(HWS), Sells(HWS,Drill) At(SM), Sells(SM,Milk) At(SM), Sells(SM,Bananas) Buy(Drill) Buy(Milk) Buy(Bananas) Have(Drill), Have(Milk), Have(Bananas), At(Home) Finish
Planning Start At(x) At (x) Go(HWS) Go(SM) At(HWS), Sells(HWS,Drill) At(SM), Sells(SM,Milk) At(SM), Sells(SM,Bananas) Buy(Drill) Buy(Milk) Buy(Bananas) Have(Drill), Have(Milk), Have(Bananas), At(Home) Finish
Planning Impasse must backtrack & make another choice Start At(Home) At (Home) Go(HWS) Go(SM) At(HWS), Sells(HWS,Drill) At(SM), Sells(SM,Milk) At(SM), Sells(SM,Bananas) Buy(Drill) Buy(Milk) Buy(Bananas) Have(Drill), Have(Milk), Have(Bananas), At(Home) Finish
S3 c S1 S1 S1 S3 c c c c S2 S2 S2 S3 c How to identify a dead end? (c) Promotion (a) (b) Demotion
Finish Planning 1. Try to go from HWS to SM (i.e. a different way of achieving At(x)) Start At(Home) At (HWS) Go(HWS) Go(SM) 2. by promotion At(HWS), Sells(HWS,Drill) At(SM), Sells(SM,Milk) At(SM), Sells(SM,Bananas) At(SM) Buy(Drill) Buy(Milk) Buy(Bananas) Go(Home) Have(Drill), Have(Milk), Have(Bananas), At(Home)
Planning If 2 would try At(HWS) or At(Home), threats could not be resolved.
Do not backtrack on this Choose from existing steps or op pool. Presented as nondeterministic (choose and fail) POP is a regression planner. Sound & complete Assuming BFS or iterative deepening
Planning with partially instantiated operators Keep track of binding lists & unify right expressions at right time. • Effect At(x) is a possible threat for condition At(Home) • Resolve now with an equality constraint, e.g. x=HWS • Resolve now with an inequality constraint, e.g. xHWS • Resolve later (only deal with it if it becomes a necessary threat) <- we will now give a POP algorithm for this Less commitment
Planning with partially instantiated operators … • New definition of achievement: • A step Si achieves a precondition c of step Sj if • (1) Si < Sj and Si has an effect that necessarily unifies with c, and • (2) there is no step Sk such that Si < Sk< Sj in some linearization of the plan, and Sk has an effect that possibly unifies with c
Can use bookkeeping to avoid going through this triply nested loop every time. Planning with partially instantiated operators … Sound & complete