Automated Planning and Decision Making Prof. Ronen Brafman Automated Planning and Decision Making Graphplan Based on slides by: Ambite, Blyth and Weld
Automated Planning and Decision Making2 Basic Idea Construct a graph that encodes constraints on possible plans based on smart reachability analysis (Reachable-2) Use this “planning graph” to constrain search for a valid plan: ○If a valid plan exists, it’s a subgraph of the planning graph. A planning graph can be built for any problem in polynomial time.
Automated Planning and Decision Making3 Properties: Finds “shortest parallel plan”. Sound, complete and will terminate with failure if no plan exists.
Automated Planning and Decision Making4 Planning Graph Directed, leveled graph ○2 types of nodes: Proposition: P Action: A ○3 types of edges (between levels) Precondition: P -> A Add: A -> P Delete: A -> P Proposition and action levels alternate. Action level includes actions whose preconditions are satisfied in previous level plus no-op actions (to solve frame problem).
Automated Planning and Decision Making5 Planning Graph … … … Proposition Action No-Op Precondition Effect
Automated Planning and Decision Making6 Rocket Domain
Automated Planning and Decision Making7 Planning Graph Example - Rocket Problem
Automated Planning and Decision Making8 Constructing The Graphplan Level P 1 : all literals from the initial state. Add an action in level A i if all its preconditions are present in level P i. Add a precondition in level P i if it is the effect of some action in level A i-1 (including no-ops). Maintain a set of exclusion relations to eliminate incompatible propositions and actions (thus reducing the graph size). P 1 A 1 P 2 A 2 … P n-1 A n-1 P n
Automated Planning and Decision Making9 Mutual Exclusion Relations Idea: if two actions (or literals) are mutually exclusive (mutex) at some stage, no valid plan could contain both. Two actions are mutex if: ○Interference: one destroys the others’ effect or precondition. ○Competing needs: mutex preconditions. Two propositions are mutex if: ○All ways of achieving them are mutex.
Automated Planning and Decision Making10 Mutual Exclusion Relations Inconsistent Effects Inconsistent Support Competing Needs Interference (prec-effect)
Automated Planning and Decision Making11 Dinner Date Example Initial Conditions: (and (garbage) (cleanHands) (quiet)) Goal: (and (dinner) (present) (not (garbage)) Actions: ○Cook :precondition (cleanHands) :effect (dinner) ○Wrap :precondition (quiet) :effect (present) ○Carry :precondition :effect (and (not (garbage)) (not (cleanHands)) ○Dolly :precondition :effect (and (not (garbage)) (not (quiet)))
Automated Planning and Decision Making12 Dinner Date Example cleanHands Carry garb quiet ¬garb cleanHands ¬cleanHands quiet ¬quiet dinner present Dolly Cook Wrap No-Op
Automated Planning and Decision Making13 Dinner Date Example Carry garb quiet Dolly Cook Wrap No-Op garb ¬garb cleanHands ¬cleanHands quiet ¬quiet dinner present No-Op garb ¬garb cleanHands ¬cleanHands quiet ¬quiet dinner present No-Op Carry Dolly Cook Wrap cleanHands
Automated Planning and Decision Making14 Observation 1 A1A1 p ¬r No-Op p ¬p ¬q ¬r No-Op p ¬p ¬q ¬r No-Op A1A1 A2A2 ¬q q Propositions monotonically increase (always carried forward by no-ops)
Automated Planning and Decision Making15 Observation 2 A1A1 p ¬r No-Op p ¬p ¬q ¬r No-Op p ¬p ¬q ¬r No-Op A1A1 A2A2 ¬q q Actions monotonically increase
Automated Planning and Decision Making16 Observation 3 A1A1 p ¬r No-Op p ¬q ¬r ¬q Proposition mutex relationships monotonically decrease
Automated Planning and Decision Making17 Observation 4 A1A1 p No-Op p ¬p q ¬r No-Op p ¬p q ¬r No-Op A3A3 A2A2 q Action mutex relationships monotonically decrease
Automated Planning and Decision Making18 Observation 5 Planning Graph ‘levels off’. After some time k all levels are identical. Because it’s a finite space, the set of literals never decreases and mutexes don’t reappear.
Automated Planning and Decision Making19 Valid Plan A valid plan is a sub-graph of the planning graph where: Actions at the same level don’t interfere. Each action’s preconditions are made true by the plan. Goals are made true by some action.
Automated Planning and Decision Making20 Searching For A Solution Plan Backward chain on the planning graph. Achieve goals level by level. At level k, pick a subset of non-mutex actions to achieve current goals. Their preconditions become the goals for k-1 level. Build goal subset by picking each goal and choosing an action to add. Use one already selected if possible. Do forward checking on remaining goals (backtrack if can’t pick non-mutex action).
Automated Planning and Decision Making21 Plan Graph Search If goals are present & non-mutex: Choose action to achieve each goal. Add preconditions to next goal set.
Automated Planning and Decision Making22 Dinner Date Example Initial Conditions: (and (garbage) (cleanHands) (quiet)) Goal: (and (dinner) (present) (not (garbage)) Actions: ○Cook :precondition (cleanHands) :effect (dinner) ○Wrap :precondition (quiet) :effect (present) ○Carry :precondition :effect (and (not (garbage)) (not (cleanHands)) ○Dolly :precondition :effect (and (not (garbage)) (not (quiet)))
Automated Planning and Decision Making23 Dinner Date Example cleanHands Carry garb quiet ¬garb cleanHands ¬cleanHands quiet ¬quiet dinner present Dolly Cook Wrap No-Op
Automated Planning and Decision Making24 Dinner Date Example Carry garb quiet Dolly Cook Wrap No-Op garb ¬garb cleanHands ¬cleanHands quiet ¬quiet dinner present No-Op garb ¬garb cleanHands ¬cleanHands quiet ¬quiet dinner present No-Op Carry Dolly Cook Wrap cleanHands
Automated Planning and Decision Making25 Dinner Date Example Carry garb quiet Dolly Cook Wrap No-Op garb ¬garb cleanHands ¬cleanHands quiet ¬quiet dinner present No-Op garb ¬garb cleanHands ¬cleanHands quiet ¬quiet present No-Op Carry Dolly Cook Wrap cleanHands dinner No-Op
Automated Planning and Decision Making26 Graphplan Creation - Polynomial Theorem 1: The size of the t-level PG and the time to create it are polynomial in: ○t = number of levels ○n = number of objects ○m = number of operators ○k = largest arity of actions and predicates Max nodes proposition level: O((t+1) mn k ) Max nodes action level: O(tmn k )
Automated Planning and Decision Making27 GraphPlan algorithm Grow the planning graph (PG) until all goals are reachable and not mutex. (If PG levels off first, fail) Search the PG for a valid plan… If none found, add a level to the PG and try again.
Automated Planning and Decision Making28 Termination For Unsolvable Problems Graphplan records (memoizes) sets of unsolvable goals: ○U(i,t) = unsolvable goals at level i after stage t. More efficient: early backtracking… Also provides necessary and sufficient conditions for termination: ○Assume plan graph levels off at level n, stage t > n. ○If U(n, t-1) = U(n, t) then we know no plan exists.
Automated Planning and Decision Making29 In-place plan graph expansion A1A1 B3B3 C3C3 D5D5 p0p0 q2q2 r4r4 s4s Props & actions: an integer that denotes start level Mutex relations: end level ® end time
Automated Planning and Decision Making30 Perverting Graphplan ADL Gazen & Knoblock Koehler Anderson, Smith & Weld Boutilier Uncertainty Rao Graphplan Time Smith & Weld Koehler ? PGP Blum & Langford Conformant Smith & Weld Sensory/Contingent Weld, Anderson & Smith ?
Automated Planning and Decision Making31 Expressive Languages Negated preconditions Disjunctive preconditions Universally quantified preconditions, effects Conditional effects
Automated Planning and Decision Making32 Negated Preconditions Graph expansion ○P, P mutex. ○Action deleting P must add P at next level. Solution extraction
Automated Planning and Decision Making33 Disjunctive Preconditions Convert precondition to DNF ○Disjunction of conjunctions. Graph expansion ○Add action if any disjunct is present, non mutex. Solution extraction ○Consider all disjuncts.
Automated Planning and Decision Making34 Universal Quantification Graph Expansion ○Expand action with Herbrand universe replace ∀ block x P(x) with P(o 17 ) P(o 74 ) … P(o 126 ) Solution Extraction ○No changes necessary
Automated Planning and Decision Making35 Conditional Effects
Automated Planning and Decision Making36 Full Expansion in-keys in-pay
Automated Planning and Decision Making37 Factored Expansion Treat conditional effects as primitive ○“component” = pair STRIPS action has one component Consider action A ○Precond: p ○Effect: e (when q (f g)) (when (r s) q) A has three components: antecedentconsequent pe p qf g p r s qq
Automated Planning and Decision Making38 Changes to Expansion Components C 1 and C 2 are mutex at level I if ○The antecedants of C 1 and C 2 are mutex at I-1 ○C 1, C 2 come from different action instances, and the consequent of C 1 deletes the antecedant of C 2, or vice versa. ○ ∃ C, C 1 induces C and C is mutex with C 2 Intuitively, C 1 induces C if it is impossible to execute C 1 without executing C. ○C 1 and C are parts of same action instance. ○C 1 and C aren’t mutex (antecedants not inconsistent). ○The negation of C’s antecedant can’t be satisfied at level I-1.
Automated Planning and Decision Making39 Induced Mutex ∃ C, C 1 induces C and C is mutex with C 2
Automated Planning and Decision Making40 Revised Backchaining Confrontation ○Subgoaling on negation of something.