1

Planning^{Chapter 11}

Outline

♢ Search vs. planning ♢ STRIPS operators ♢ Partial-order planning

Search vs. planning

Consider the task get milk, bananas, and a cordless drill Standard search algorithms seem to fail miserably:

After-the-fact heuristic/goal test inadequate

Search vs. planning contd.

Planning systems do the following: 1) open up action and goal representation to allow selection 2) divide-and-conquer by subgoaling

3) relax requirement for sequential construction of solutions

Search  Planning
States Lisp data structures Logical sentences
Actions Lisp code  Preconditions/outcomes
Goal Lisp code Logical sentence (conjunction)
Plan  Sequence from S_{0} Constraints on actions

Planning in situation calculus

P lanResult(p, s) is the situation resulting from executing p in s P lanResult([], s) = s

P lanResult([a|p], s) = P lanResult(p, Result(a, s))

Initial state At(Home, S_{0}) ∧ ¬Have(Milk, S_{0}) ∧ … Actions as Successor State axioms Have(Milk, Result(a, s)) ⇔ [(a = Buy(Milk) ∧ At(Supermarket, s)) ∨ (Have(Milk, s) ∧ a ≠ …)] Query

s = P lanResult(p, S_{0}) ∧ At(Home, s) ∧ Have(Milk, s) ∧ … Solution

p = [Go(Supermarket), Buy(Milk), Buy(Bananas), Go(HW S), …] Principal difficulty: unconstrained branching, hard to apply heuristics

STRIPS operators

Tidily arranged actions descriptions, restricted language

Action: Buy(x) Precondition: At(p), Sells(p, x) Effect: Have(x)

[Note: this abstracts away many important details!]

Restricted language ⇒ efficient algorithm Precondition: conjunction of positive literals Effect: conjunction of literals

State space vs. plan space

Standard search: node = concrete world state Planning search: node = \underline{partial plan}

Defn: \underline{open condition} is a precondition of a step not yet fulfilled

Operators on partial plans:

\underline{add a link} from an existing action to an open condition \underline{add a step} to fulfill an open condition \underline{order} one step wrt another

Gradually move from incomplete/vague plans to complete, correct plans

Partially ordered plans

A plan is \underline{complete} iff every precondition is achieved A precondition is \underline{achieved} iff it is the effect of an earlier step and no \underline{possibly intervening} step undoes it

POP algorithm sketch

function POP(initial, goal, operators) returns plan

plan ← Make-Minimal-Plan(initial, goal) loop do

if Solution?( plan) then return plan S_{need}, c ← Select-Subgoal( plan) Choose-Operator( plan, operators, S_{need}, c) Resolve-Threats( plan)

end

function Select-Subgoal( plan) returns S_{need}, c

pick a plan step S_{need} from Steps( plan)

with a precondition c that has not been achieved return S_{need}, c

POP algorithm contd.

procedure Choose-Operator(plan, operators, S_{need}, c)

choose a step S_{add} from operators or Steps( plan) that has c as an effect if there is no such step then fail add the causal link S_{add} ⟶^{c} S_{need} to Links( plan) add the ordering constraint 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)

procedure Resolve-Threats(plan)

for each S_{threat} that threatens a link S_{i} ⟶^{c} 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

POP is sound, complete, and \underline{systematic} (no repetition)

Extensions for disjunction, universals, negation, conditionals

Clobbering and promotion/demotion

A \underline{clobberer} is a potentially intervening step that destroys the condition achieved by a causal link. E.g., Go(Home) clobbers At(HW S):

\underline{Demotion}: put before Go(HW S)

\underline{Promotion}: put after Buy(Drill)

12

Example: Blocks world

13

Example contd.

14 15 16