Week 8: Planning
Search gave us paths through state spaces. Planning shifts the lens from states to actions. Instead of asking "which node do I visit next?" we ask "which action should I apply, and under what conditions?" This week covers the full arc: from the STRIPS formalism and Blocks World, through forward and backward state-space planning, to goal-stack planning and its failure on non-serializable subgoals, and finally plan-space (partial-order) planning that resolves those failures by reasoning about causal links and threats.
Automated Domain-Independent Planning [Lecture 1]
So far our view of problem solving has been state-centered: the state space is the arena, solutions are sequences of states. The planning community takes an action-centric view. Actions have names, preconditions, and effects. Even when we do state-space planning, solutions are expressed as sequences of actions.
Planning = "the reasoning side of acting." An autonomous agent senses its environment, deliberates to find a plan, and acts by executing planned actions.
Dimensions of planning domains
| Dimension | Simple end | Complex end |
|---|---|---|
| Perception | Complete information | Partial information |
| Goals | Satisfaction (hard constraints on end state) | Soft constraints, trajectory constraints |
| Actions | Deterministic, instantaneous | Stochastic, durative |
| Agents | Single agent | Multi-agent (collaborative / adversarial / competing) |
| Cost | No cost model | Action costs, plan optimization |
STRIPS domains
The simplest planning domains follow the STRIPS assumption (Stanford Research Institute Planning System):
- Finite, static, fully observable environments
- Only the agent changes the world
- Goals are hard constraints on the final state only
- Actions are deterministic and instantaneous
- No explicit notion of time
A STRIPS domain can be modeled as a state transition system where:
- = finite set of states
- = finite set of actions
- = state transition function (if is applicable in )
Planning Domain Description Languages (PDDL)
Since the mid-1990s, a series of standardized languages with increasing expressivity has been defined. PDDL lets researchers describe domains uniformly and compete on the same test problems. The simplest is PDDL 1.0, which matches the STRIPS assumptions. More expressive variants add durative actions, numeric fluents, derived predicates, and more.
Even in the simplest domains, planning is PSPACE-complete (polynomial space, exponential time).
The Blocks World Domain [Lecture 2]
Blocks World is the classic toy domain for planning. A one-armed robot manipulates blocks on an infinitely large table.
State predicates
| Predicate | Meaning |
|---|---|
| Block is on block | |
| Block is on the table | |
| Nothing is on top of | |
| Robot arm holds | |
| Robot arm is empty |
A state is the set of all predicates that are true. Everything not in the set is false (closed-world / negation-by-failure).
STRIPS operators
Each operator has a name with arguments, preconditions, positive effects (add list), and negative effects (delete list).
Unstack and Pickup are the two ways to acquire a block (from another block or from the table). Stack and Putdown are their inverses (placing onto another block or onto the table).
Key observations
- The start state is completely described (every predicate is known to be true or false)
- The goal state is partially described (we only care about certain predicates)
- Applying an action: delete negative-effect predicates from the state, add positive-effect predicates
State Space Planning [Lecture 3]
Forward state-space planning (FSSP)
Start from the start state, apply applicable actions, search toward the goal.
Applicability: Action is applicable in state if .
Progression: When applicable action is applied in :
This is always sound: is always a valid state.
Plan validity: A plan is valid in if, after progressing through all actions, the goal .
Drawback: High branching factor. Since the full state is known, many actions are applicable in every state, and most are irrelevant to the goal.
Backward state-space planning (BSSP)
Start from the goal description, search backward toward the start state.
Relevance: Action is relevant to goal if:
- (it achieves at least one goal literal)
- (it deletes nothing from the goal)
Regression: When relevant action is used to regress goal :
Remove what the action will achieve anyway; add what must be true for the action to be applicable.
Termination: Regress until (the start state).
Critical drawback: Regression is not closed over the state space. The resulting sub-goal may describe an infeasible state. For example, both and could appear in , which is impossible with a one-armed robot. This means every plan found by BSSP must be validated by forward-simulating it from the start state.
Forward vs Backward State Space Planning [Lecture 4]
Side-by-side comparison
| Aspect | Forward (FSSP) | Backward (BSSP) |
|---|---|---|
| Search direction | Start → Goal | Goal → Start |
| Action criterion | Applicable in current state () | Relevant to current goal (, ) |
| Transition | Progression: | Regression: |
| Resulting description | Always a valid state | May be infeasible |
| Branching factor | High (many applicable actions) | Low (few relevant actions) |
| Plan validity | Guaranteed (sound) | Must be checked by forward simulation |
| Plan construction | First action found = first in plan | First action found = last in plan |
The fundamental asymmetry: planning operators are designed for progression. They specify what becomes true and what becomes false when an action is applied forward. When used in reverse for regression, the semantics break down. The preconditions and effects do not constrain the backward direction the same way.
This motivates an algorithm that combines the best of both worlds: goal-stack planning.
Goal Stack Planning [Lecture 5]
Goal-stack planning strives to combine the low branching of BSSP with the soundness of FSSP. It works in a goal-directed, backward manner (low branching) but constructs plans forward (always valid states).
Linear planning
Goal-stack planning is a form of linear planning: decompose the compound goal into individual sub-goals and solve them one at a time in sequence.
The push-set operation
For a goal set , PushSet(G):
- Push the compound goal
- Push each individual goal (in some order)
The compound goal serves as a check: after solving each sub-goal independently, verify the conjunction is still satisfied. If not, push it back and resolve.
The algorithm
Input: Planning problem (s₀, G, O)
Stack ← ∅, Plan ← ∅, State ← s₀
PushSet(G)
while Stack ≠ ∅:
x ← Pop(Stack)
if x is an action a:
Plan ← Plan ∘ a
State ← Progress(State, a)
else if x is a compound goal G' and G' ⊄ State:
PushSet(G')
else if x is an individual goal g and g ∉ State:
Choose a relevant action a that achieves g
Push a onto Stack
PushSet(Pre(a))
return Plan
Key property: actions are only added to the plan when their preconditions have been satisfied, so the plan is always valid (no spurious states).
Worked example: stack A on B, B on C
Starting state: A, B, C all on the table. Goal: .
With the correct goal order (solve first, then ):
Four-step optimal plan: Pickup(B) → Stack(B,C) → Pickup(A) → Stack(A,B).
Non-serializable Subgoals [Lecture 6]
Goal ordering matters
With the wrong order (solve first, then ):
- Pickup(A) → Stack(A,B) → achieves ✓
- Unstack(A,B) → Putdown(A) → Pickup(B) → Stack(B,C) → achieves but undid
- Must re-achieve : Pickup(A) → Stack(A,B)
Six-step plan instead of four. The compound goal catches the violation and forces re-planning.
The Sussman Anomaly
Some problems have no correct goal order. The classic example:
Start: C on A, B on table. Goal: .
Try first:
- Pickup(B) → Stack(B,C) → ✓
- Unstack(B,C)? No. Unstack requires B to be on C (true) and clear (true) and arm empty. But A must go on B, which requires clearing C from A first.
- End up with but is undone.
Try first:
- Unstack(C,A) → Putdown(C) → Pickup(A) → Stack(A,B) → ✓
- Unstack(A,B) → Putdown(A) → Pickup(B) → Stack(B,C) → ✓ but is undone.
Neither order gives the optimal plan. The optimal 6-step plan requires interleaving: first clear the table (unstack C from A, put down C), then stack B on C, then stack A on B. This means shifting focus mid-stream, something linear planning cannot do.
Non-serializable subgoals
Sub-goals are non-serializable when there is no order in which solving them sequentially produces the optimal plan. Solving one may undo the other, regardless of order. This appears in:
- Blocks World (Sussman anomaly)
- 8-puzzle (moving one tile can displace others)
- Rubik's Cube (solving one layer disrupts the previous)
Linear planners like goal-stack planning cannot handle these problems optimally. We need a more flexible approach: plan-space planning.
Plan Space Planning [Lecture 7]
Instead of searching through states, search through the space of partial plans. The plan is the primary object; states are a byproduct.
Partial plan definition
A partial plan is a 4-tuple :
| Component | Meaning |
|---|---|
| Set of partially instantiated operators (actions) in the plan | |
| Set of ordering links of the form (action must come before ) | |
| Set of causal links of the form (action produces proposition , consumed by ) | |
| Set of binding constraints on variables (e.g., , , ) |
Variables are prefixed with ? (e.g., ?x) to distinguish them from constants.
The initial plan
Every plan-space search begins with exactly two actions:
- (the start action): no preconditions, positive effects = the start state predicates
- (the end action): preconditions = the goal predicates, no effects
- One ordering link:
This "empty plan" represents all possible plans for the given problem.
Flaws
A partial plan is a solution only if it has no flaws. There are two kinds:
1. Open goals: A precondition of some action in the plan that is not supported by any causal link.
2. Threats: An action in the plan that potentially deletes a proposition protected by a causal link (i.e., has in its negative effects, and could be ordered between and ).
Resolving flaws
Open goals are resolved in two ways:
- An existing action in the plan produces → add causal link and ordering link
- No existing action produces → insert a new action that produces , add causal and ordering links
Threats are resolved by:
- Promotion: Add ordering link (move the threatening action before the producer)
- Demotion: Add ordering link (move the threatening action after the consumer)
- Separation: Add binding constraint so the threatened variable cannot equal the threatening variable (only when variables are present)
Algorithm sketch
Π ← Π₀
while Π has flaws:
Choose a flaw f
if f is an open goal p for action aⱼ:
Find or insert action aᵢ that produces p
Add causal link aᵢ → aⱼ and ordering link aᵢ ≺ aⱼ
else if f is a threat by aₜ on causal link aᵢ → aⱼ:
Resolve by promotion, demotion, or separation
if Π has no flaws: return Π (a solution plan)
else: backtrack
Partial Order Planning: An Example [Lecture 8]
Problem setup
Start state: B on C, C on table, A on table, Clear(A), Clear(B), ArmEmpty.
Goal: .
Step 1: Initial plan
Two open goals: and .
Step 2: Resolve On(A,B)
No existing action produces . Insert Stack(A,B):
- Causal link:
- Open goals created: ,
Step 3: Resolve Clear(B)
is true in the start state → establish causal link from :
Step 4: Resolve Holding(A)
Insert Pickup(A) (simpler than unstack, since A is on the table):
- Causal link:
- Open goals created: , ,
Step 5: Resolve Pickup(A)'s preconditions
All three (, , ) are true in the start state → causal links from .
Step 6: Resolve OnTable(B)
B is on C, not on the table. Insert Putdown(B):
- Causal link:
- Open goal:
Step 7: Resolve Holding(B)
Insert Unstack(B,C) (B is on C in the start state):
- Causal link:
- Open goals: , , - all true in start state → causal links from .
Step 8: All open goals resolved. Now check threats.
Three threats identified:
| Threat | Threatening action | Causal link threatened | Reason |
|---|---|---|---|
| Stack(A,B) | Unstack(B,C) | Stack(A,B) deletes Clear(B) | |
| Pickup(A) | Unstack(B,C) | Pickup(A) deletes ArmEmpty | |
| Putdown(B) | Pickup(A) | Putdown(B) deletes ArmEmpty |
Step 9: Resolve threats by promotion
All three resolved by adding ordering links that move the threatening action after the consumer:
- Unstack(B,C) Stack(A,B)
- Unstack(B,C) Pickup(A)
- Putdown(B) Pickup(A)
These ordering links produce the linear sequence:
Final plan (4 steps): Unstack(B,C) → Putdown(B) → Pickup(A) → Stack(A,B).
Key insight
Plan-space planning found the correct plan without committing to a linear goal order. The threats naturally forced an ordering that avoids the Sussman anomaly. Unlike goal-stack planning, POP does not require sub-goals to be serializable. It resolves conflicts through causal links and ordering constraints, only linearizing when threats force it to.
Week 8 Summary
| Algorithm | Direction | Branching | Sound? | Handles non-serializable goals? |
|---|---|---|---|---|
| FSSP | Forward | High | Yes | Yes (but slow) |
| BSSP | Backward | Low | Must validate | Yes (but may produce spurious sub-goals) |
| Goal-Stack | Backward goals, forward actions | Low | Yes | No (linear, Sussman anomaly) |
| Plan-Space (POP) | Refines partial plans | Variable | Yes | Yes (threat resolution interleaves sub-goals) |
The progression this week: from state-centric search to action-centric planning, from linear to non-linear reasoning, from committing to a fixed goal order to letting causal links and threat resolution determine the plan structure organically.