Chapter 11
|

Planning Graphs
Consider only environments that are:
- fully observable
- deterministic
- finite
- static
- discrete


The language of planning problems
Syntax
Representation of states
- conjunction of positive literals
- ground and function free
- closed world assumption (any condition not mentioned is false)
state: At(Plane1, Melbourne) Ù At(Plane2, Sydney)
Representation of goals
- conjunction of positive ground literals
- state s satisfies a goal g if s contains all the atoms in g. The following goal is satisfied by the state above.
goal: At(Plane1, Melbourne)
Representation of actions
- action name and parameter list variables
Action( Fly( p, from, to))
- preconditions must hold before action executed; a conjunction of function-free positive literals, any variables must be in action parameter list.
At(p,from) Ù Plane(p) Ù Airport(from) Ù Airport(to)
- effects resulting from action execution; a conjunction of function-free literals, any variables must be in action parameter list. Positive literal P asserted true in new result state, negative literal ØP asserted false in result state.
ØAt(p,from) Ù At(p,to)
Example:
- Action( Fly( p, from, to),
Precondition: At(p,from) Ù Plane(p) Ù Airport(from) Ù Airport(to),
Effect: ØAt(p,from) Ù At(p,to)
Fly( P1, SDF, SFO)
- Action( Fly( P1, SDF, SFO),
Precondition: At(P1,SDF) Ù Plane(P1) Ù Airport(SDF) Ù Airport(SFO),
Effect: ØAt(P1,SDF) Ù At(P1,SFO) )Semantics
Describe how actions affect states.
- applicable is any action that satisfies the precondition. Establishing in FOL requires substitution of precondition literals and precondition variables.
Current state:
At(P1,JFK) Ù At(P2,SFO) Ù Plane(P1) Ù Plane(P2) Ù Airport(JFK) Ù Airport(SFO)Precondition:
At(p,from) Ù Plane(p) Ù Airport(from) Ù Airport(to)Action( Fly( p, from, to),
Precondition: At(p,from) Ù Plane(p) Ù Airport(from) Ù Airport(to),
Effect: ØAt(p,from) Ù At(p,to)satisified by substitution:
{p/P1, from/JFK, to/SFO}
Action( Fly( P1, JFK, SFO)
Precondition: At(P1,JFK) Ù Plane(P1) Ù Airport(JFK) Ù Airport(SFO)
Effect: ØAt(P1,JFK) Ù At(P1,SFO)
- result of executing action:
- adds positive literal P of effect to state
- removes any negative literal ØP from state
- negative effect is ignored if not in state.
Current state:
At(P1,JFK) Ù At(P2,SFO) Ù Plane(P1) Ù Plane(P2) Ù Airport(JFK) Ù Airport(SFO)Action:
Fly( P1, JFK, SFO)Effect:
ØAt(P1,JFK) Ù At(P1,SFO)Result:
At(P1,SFO) Ù At(P2,SFO) Ù Plane(P1) Ù Plane(P2) Ù Airport(JFK) Ù Airport(SFO)
- solution an action sequence that when executed from the initial state satisfies the goal state.
For the goal of: At(P1,JFK) Ù At(P2,SFO) Ù Plane(P1) Ù Plane(P2) Ù Airport(JFK) Ù Airport(SFO)
action:
Action( Fly( p, from, to),
Precondition: At(p,from) Ù Plane(p) Ù Airport(from) Ù Airport(to),
Effect: ØAt(p,from) Ù At(p,to)and the current state of:
At(P1,SFO) Ù At(P2,JFK) Ù Plane(P1) Ù Plane(P2) Ù Airport(JFK) Ù Airport(SFO)
what sequence of actions produce a solution?

Example: Blocks world

Consists of:
Operators
- On( b, x) - Block b is on top of block x.
- Clear( x ) - Block x has no block on top of it.
- Block( b ) - b is a block
Actions
- Action( Move(b, x, y), Move block b from x to y
Precond: On(b, x) Ù Clear(b) Ù Clear(y) Ù Block(b)
Ù (b≠x) Ù (b≠y) Ù (x≠y),
Effect: On(b, y) Ù Clear(x) Ù ØOn(b, x) Ù ØClear(y))
- Action( MoveToTable(b, x), Move block b to Table
Precond: On(b, x) Ù Clear(b) Ù Block(b) Ù (b≠x),
Effect: On(b, Table) Ù Clear(x) Ù ØOn(b, x))Plan
- Initial( On(A, Table) Ù On(B, Table) Ù On(C, Table)
Ù Block(A) Ù Block(B) Ù Block(C)
Ù Clear(A) Ù Clear(B) Ù Clear(C)- Goal( On(A, B) Ù On(B, C))
- Action( Move(b, x, y),
Precond: On(b, x) Ù Clear(b) Ù Clear(y) Ù Block(b)
Ù (b≠x) Ù (b≠y) Ù (x≠y),
Effect: On(b, y) Ù Clear(x) Ù ØOn(b, x) Ù ØClear(y))
- Action( MoveToTable(b, x), Move block b to Table
Precond: On(b, x) Ù Clear(b) Ù Block(b) Ù (b≠x),
Effect: On(b, Table) Ù Clear(x) Ù ØOn(b, x))
Solution
- Move(B, Table, C) {b/B, x/Table, y/C}
- Move(A, Table, B) {b/A, x/Table, y/B}
Initial: On(A, Table) Ù On(B, Table) Ù On(C, Table)
Ù Block(A) Ù Block(B) Ù Block(C)
Ù Clear(A) Ù Clear(B) Ù Clear(C)Substitutions for: Move(B, Table, C)
{ b/B, x/Table, y/C }
Effects:
On(B, C) Ù Clear(Table) Ù ØOn(B, Table) Ù ØClear(C)
New state:
On(A, Table)
Ù On(B, Table)Ù On(C, Table)
Ù Block(A) Ù Block(B) Ù Block(C)
Ù Clear(A) Ù Clear(B)Ù Clear(C)
Ù On(B, C) Ù Clear(Table)Ù ØOn(B, Table) Ù ØClear(C)
- Give the next state resulting from:
Move(A, Table, B)
- Is Move(A, B, B) allowed under the Move preconditions?
- Action( Move(b, x, y),
Precond: On(b, x) Ù Clear(b) Ù Clear(y) Ù Block(b)
Ù (b≠x) Ù (b≠y) Ù (x≠y),
Effect: On(b, y) Ù Clear(x) Ù ØOn(b, x) Ù ØClear(y))
- Action( MoveToTable(b, x), Move block b to Table
Precond: On(b, x) Ù Clear(b) Ù Block(b) Ù (b≠x),
Effect: On(b, Table) Ù Clear(x) Ù ØOn(b, x))

Forward state-space search
The figure at right is a partial state-space for the blocks world with only three blocks. It indicates some of the problems with planning:
- the state-space is potentially large
- loops are possible
- requires good heuristic to limit search
- Initial state
On(A, Table) Ù On(B, Table) Ù On(C, Table)
Ù Block(A) Ù Block(B) Ù Block(C)
Ù Clear(A) Ù Clear(B) Ù Clear(C)- What are the possible valid states from the given initial state under the action:
- Move(b, x, y)
Remember that the preconditions for the actions must be met.
- What is the branching factor for 3 blocks at level 1?
- What is the minimum solution depth for stacking 3 blocks?
- What is wrong with the figure at right?
Action( Move(b, x, y),
Precond: On(b, x) Ù Clear(b) Ù Clear(y) Ù Block(b)
Ù (b≠x) Ù (b≠y) Ù (x≠y),
Effect: On(b, y) Ù Clear(x) Ù ØOn(b, x) Ù ØClear(y))
Backward state-space search
Forward search must examine many irrelevant actions that also lead to goal state as illustrated in the above diagram.
Backward search reduces the state space by allowing only relevant states leading from the goal back to the initial state.
Regression - actions are selected that achieve some part of the goal, the goal is regressed through the actions back to the initial state.
Relevant and consistent requirements:
- Action must achieve some part of the goal.
- Predecessor state must include action preconditions.
- Action must not undo any desired literal in goal.
Algorithm
Given a goal G and action A that is relevant and consistent:
- Delete positive effects of A from G; ignore negative effects.
- Add each new precondition literal from A to G.
- Terminate when G is satisfied by initial state.
Example - Develop plan to move
to
- Action( Move(b, x, y),
Precond: On(b, x) Ù Clear(b) Ù Clear(y) Ù Block(b)
Ù (b≠x) Ù (b≠y) Ù (x≠y),
Effect: On(b, y) Ù Clear(x) Ù ØOn(b, x) Ù ØClear(y))
- Action( MoveToTable(b, x), Move block b to Table
Precond: On(b, x) Ù Clear(b) Ù Block(b) Ù (b≠x),
Effect: On(b, Table) Ù Clear(x) Ù ØOn(b, x))
- Initial state
On(A, Table) Ù On(B, Table) Ù On(C, Table)
Ù Block(A) Ù Block(B) Ù Block(C)
Ù Clear(A) Ù Clear(B) Ù Clear(C)- Goal
On(A,B) Ù On(B,C) Ù On(C, Table)
Ù Block(A) Ù Block(B) Ù Block(C)
Ù Clear(A)- Regress through any operator that achieves one or more goal conjuncts.
- Move(A, Table, B)
- Remove positive effects from goal:
On(A, B) ÙOn(B,C) Ù On(C, Table)
Ù Block(A) Ù Block(B) Ù Block(C)
Ù Clear(A)- Add new preconditions to produce new subgoal:
On(B, C) Ù On(C, Table)
Ù Block(A) Ù Block(B) Ù Block(C)
Ù Clear(A)
Ù On(A, Table)ÙClear(A)Ù Clear(B)Ù Block(A)- Move(B, Table, C)
- Remove positive effects from goal:
On(B, C) ÙOn(C, Table)
Ù Block(A) Ù Block(B) Ù Block(C)
Ù Clear(A)
Ù On(A, Table) Ù Clear(A) Ù Clear(B)- Add preconditions to produce new subgoal:
On(C, Table)
Ù Block(A) Ù Block(B) Ù Block(C)
Ù Clear(A)
Ù On(A, Table)Ù Clear(A)Ù Clear(B)
Ù On(B, Table)Ù Clear(B)Ù Clear(C)Ù Block(B)- Terminate
- Initial state:
On(A, Table) Ù On(B, Table) Ù On(C, Table)
Ù Block(A) Ù Block(B) Ù Block(C)
Ù Clear(A) Ù Clear(B) Ù Clear(C)- Goal:
On(A, Table) Ù On(B, Table) Ù On(C, Table)
Ù Block(A) Ù Block(B) Ù Block(C)
Ù Clear(A) Ù Clear(B) Ù Clear(C)
- What is the initial state for the diagram at right?
- For the goal state below, regress actions that produce the initial state.
- Action( Move(b, x, y),
Precond: On(b, x) Ù Clear(b) Ù Clear(y) Ù Block(b)
Effect: On(b, y) Ù Clear(x) Ù ØOn(b, x) Ù ØClear(y))
- Action( MoveToTable(b, x), Move block b to Table
Precond: On(b, x) Ù Clear(b) Ù Block(b),
Effect: On(b, Table) Ù Clear(x) Ù ØOn(b, x))

Example:
A partial-order plan for putting on shoes and socks and the six corresponding linearizations.

State and plan spaces
Operators transform plans by:
Example
Graphical representation of Move(b,x,y)
Action( Move(b, x, y),
Preconditions: On(b, x) Ù Clear(b) Ù Clear(y)
Effect: On(b, y) Ù Clear(x) )
Operators:
- finish
- Preconditions: the overall goal
On(A,B) Ù On(B,C) Ù On(C, Table) Ù Clear(A)
- Effect: Nothing
- initial
- Preconditions: True
- Effects: All literals in initial state.
On(A, Table) Ù On(B, Table) Ù On(C, A)
Ù Clear(B) Ù Clear(C) Ù Clear(Table)
Graphical representation of finish and initial operators in an unfinished plan.
![]() |
![]()
|
|
![]() |
|
![]() |
|
![]() |
|
![]() |
|
b
c
a ![]() |








Planning graphs
Example - "have cake and eat cake too"
Initial( Have(Cake) Ù ØEaten(Cake) )
Goal( Have(Cake) Ù Eat(Cake) )
Action: (Eat(Cake),
Precondition: Have(Cake),
Effect: ØHave(Cake) Ù Eaten(Cake) )Action: (Bake(Cake),
Precondition: ØHave(Cake),
Effect: Have(Cake) )
- S0 state level 0, initial state
- Literals: Have(Cake), ØEaten(Cake) )
- A0 action level.
- Action: Eat(Cake).
- Precondition: Have(Cake) Ù ØEaten(Cake)
- Effect: ØHave(Cake) Ù Eaten(Cake)
- Persistent actions effect (small boxes): Have(Cake) and ØEaten(Cake)
- Mutex: Persistent actions (grayed arcs) in conflict with Eat(Cake)
- S1 state level.
- Possible literals from any subset of A0 effects: Have(Cake), ØEaten(Cake), ØHave(Cake), Eaten(Cake)
- Mutex: indicates conflicting literals regardless the choice of actions.
- ØEaten(Cake), Eaten(Cake)
- Have(Cake), ØHave(Cake)
- Have(Cake), Eaten(Cake)
- ØEaten(Cake), ØHave(Cake)
- A1 action level.
- Action: Eat(Cake).
- Precondition: Have(Cake) Ù ØEaten(Cake)
- Effect: ØHave(Cake) Ù Eaten(Cake)
- Action: Bake(Cake),
Precondition: ØHave(Cake),
Effect: Have(Cake)- Persistent actions effect: Have(Cake), ØEaten(Cake), ØHave(Cake), Eaten(Cake)
- Mutex: All persistent actions and Bake(Cake) in conflict with Eat(Cake).
Note that complementary literals conflict: Have(Cake) conflicts with ØHave(Cake), Eaten(Cake) with ØEaten(Cake).
Action mutex - holds if any of the following three conditions hold at the same action level:
- Inconsistent effects: one action effect negates the an effect of another action.
Eat(Cake) and persistence Have(Cake) have inconsistent effects because disagree on effect Have(Cake).
- Interference: effect of one action is a negation of a precondition of the other.
Eat(Cake) effect ØHave(Cake) interferes with persistence of Have(Cake) by negating precondition Have(Cake).
- Competing needs: precondition of one action is mutually exclusive with precondition of another.
Bake(Cake) and Eat(Cake) compete over precondition Have(Cake).
- S2 state level.
- Possible literals from any subset of A1 effects: Have(Cake), ØEaten(Cake), ØHave(Cake), Eaten(Cake)
- Mutex: indicates conflicting literals regardless the choice of actions.
- ØEaten(Cake), Eaten(Cake)
- Have(Cake), ØHave(Cake)
- ØEaten(Cake), ØHave(Cake)
- Have(Cake) and Eaten(Cake) are not mutually exclusive as noted below in 2.
Literal mutex - holds at a level where either:
- two literals are negation of the other, Have(Cake) and ØHave(Cake)
- or each possible pair of actions that could achieve the two literals are mutually exclusive.
In S1 Have(Cake) and Eaten(Cake) are mutually exclusive because the persistence action Have(Cake) is mutex with Eat(Cake), the only way of achieving Eaten(Cake).
In S2 Have(Cake) and Eaten(Cake) are not mutually exclusive because there are actions for achieving them are not mutex, action Bake(Cake) achieves Have(Cake) and persistence of Eaten(Cake) are not mutex.
