Classical Planning
🎯 Learning Objectives
- Distinguish planning from general search
- Describe the state-space representation used in classical planning
- Understand PDDL as a standard planning language
- Explain the closed-world assumption and the frame problem
- Compare forward and backward state-space search
- Apply planning heuristics such as the ignore-delete-list and relaxed plan graph
- Evaluate plan quality using standard metrics
1. Planning vs. Search
📚 What Is Planning?
Planning is the process of selecting a sequence of actions to achieve a goal from a given initial state. Unlike generic search, planning exploits the logical structure of the problem — actions are described in terms of preconditions and effects on state variables, enabling powerful domain-independent heuristics.
In classical search (Chapters 2–3), the successor function is a black box: the algorithm can generate successors but cannot inspect why a state changes. Planning opens this black box:
| Feature | Generic Search | Classical Planning |
|---|---|---|
| State representation | Atomic / opaque | Set of propositional fluents |
| Actions | Black-box successor function | Structured: preconditions + effects |
| Goal | Goal test (boolean) | Conjunction of fluents |
| Heuristics | Domain-specific | Derived automatically from action schemas |
| Decomposability | Generally no | Sub-goals can often be solved independently |
💡 Key Insight
Because planning uses a factored representation of states (sets of propositions), it can reason about sub-goals independently, apply relaxation heuristics automatically, and scale to much larger problems than uninformed or informed search with opaque states.
2. State-Space Representation
📚 Classical Planning State
A state is a set of ground atomic propositions (called fluents) that are true. Everything not in the set is assumed false (closed-world assumption).
Example fluents: On(A,B), Clear(A), OnTable(C), Holding(Nothing)
A classical planning problem is specified by three components:
- Initial state s0: a complete set of fluents describing the world at the start.
- Goal g: a partial set of fluents that must all be true in the final state.
- Actions A: a set of action schemas, each with preconditions and effects.
🔬 Example — Simple Logistics
Initial state: {At(Package1, CityA), At(Truck1, CityA), Road(CityA, CityB)}
Goal: {At(Package1, CityB)}
Actions:
- Load(pkg, truck, city) — Pre: At(pkg, city) ∧ At(truck, city); Effect: In(pkg, truck) ∧ ¬At(pkg, city)
- Drive(truck, from, to) — Pre: At(truck, from) ∧ Road(from, to); Effect: At(truck, to) ∧ ¬At(truck, from)
- Unload(pkg, truck, city) — Pre: In(pkg, truck) ∧ At(truck, city); Effect: At(pkg, city) ∧ ¬In(pkg, truck)
Plan: Load(Package1, Truck1, CityA) → Drive(Truck1, CityA, CityB) → Unload(Package1, Truck1, CityB)
3. PDDL — Planning Domain Definition Language
📚 PDDL
PDDL (Planning Domain Definition Language) is the standard input language for automated planners. It separates a planning problem into two files:
- Domain file: defines predicates, action schemas (with parameters, preconditions, effects)
- Problem file: defines the objects, initial state, and goal condition
PDDL Action Schema Template
(:action <action-name>
:parameters (?x - type1 ?y - type2 ...)
:precondition (and (pred1 ?x) (pred2 ?x ?y) ...)
:effect (and (pred3 ?x)
(not (pred1 ?x))
...)
)
PDDL fluents follow the STRIPS convention: effects are split into an add list (positive literals) and a delete list (negated literals). Any fluent not mentioned in the effect is unchanged — this is the STRIPS assumption, which solves the frame problem within this restricted language.
4. Closed-World Assumption & Frame Problem
📚 Closed-World Assumption (CWA)
Any fluent not explicitly stated in a state description is assumed to be false. This eliminates the need to list all negative facts.
📚 Frame Problem
The frame problem asks: how do we represent the fact that most things in the world do not change when an action is performed? Without a solution, every action would need explicit “frame axioms” for every unchanged fluent, leading to a combinatorial explosion.
Solutions to the frame problem:
- STRIPS assumption: only fluents in the add/delete list change; everything else persists. Simple and effective for classical planning.
- Successor-state axioms (situation calculus): a fluent is true in the next situation iff an action made it true, or it was already true and no action made it false.
- Effect axioms only: in PDDL, only effects are specified; the planner infers persistence automatically.
⚠ GATE Tip
Questions about the frame problem often appear in the context of knowledge representation. Remember: the frame problem is about representing non-change efficiently, not about reasoning speed.
5. Forward (Progression) State-Space Search
📚 Forward Search
Start from the initial state s0, apply all applicable actions to generate successor states, and search forward until a state satisfying the goal is reached.
Forward State-Space Search
function ForwardSearch(s₀, goal, actions):
frontier ← {s₀}
explored ← ∅
while frontier ≠ ∅:
s ← frontier.pop()
if goal ⊆ s: return plan
explored ← explored ∪ {s}
for each action a in actions:
if a.preconditions ⊆ s:
s' ← (s \ a.delete_list) ∪ a.add_list
if s' ∉ explored:
frontier.add(s')
return failure
Properties:
- Sound and complete (with graph search)
- Large branching factor: many actions may be applicable but irrelevant to the goal
- Works well with good heuristics that prune the search space
6. Backward (Regression) State-Space Search
📚 Backward Search
Start from the goal and work backwards. At each step, find actions whose effects include at least one goal literal, then compute the regression of the goal through that action to obtain a new sub-goal.
Regression of Goal g Through Action a
regress(g, a):
// a is relevant if it adds at least one fluent in g
// a is consistent if it does not delete any fluent in g
g' ← (g \ a.add_list) ∪ a.preconditions
return g'
Advantages over forward search:
- Considers only relevant actions (those that achieve a goal literal), reducing branching factor
- Operates on partial states (belief sets), potentially much smaller than full states
Disadvantage: defining consistent and non-redundant regression sets can be complex; also harder to compute good heuristics for partial states.
7. Heuristics for Planning
A major advantage of the factored representation is that we can derive domain-independent heuristics automatically.
📚 Ignore-Delete-List Heuristic (h+)
Remove all delete effects from every action. In the resulting relaxed problem, fluents once achieved are never lost. Solving this relaxed problem gives an admissible heuristic (never over-estimates) because the relaxed problem is strictly easier.
Computing h+ exactly is still NP-hard, but practical approximations exist:
| Heuristic | Idea | Admissible? | Informative? |
|---|---|---|---|
| hmax | Cost of the single hardest goal fluent to achieve | Yes | Low |
| hadd | Sum of individual costs to achieve each goal fluent | No (over-estimates due to positive interactions) | High |
| hFF | Length of a relaxed plan extracted from a relaxed planning graph | Not guaranteed | Very high |
| hLM-cut | Landmark-based lower bound using cost-partitioning | Yes | High |
📚 Relaxed Planning Graph (RPG)
Build a planning graph (see GraphPlan chapter) without mutex propagation. The level at which all goal propositions first appear gives an admissible heuristic. The FF heuristic extracts an actual relaxed plan and counts its actions — more informative but not necessarily admissible.
🔬 Example — Ignore-Delete-List
Consider two actions:
- Move(A, Table, B): Pre={Clear(A), On(A,Table), Clear(B)}; Add={On(A,B)}; Del={On(A,Table), Clear(B)}
- Move(C, D, Table): Pre={Clear(C), On(C,D)}; Add={On(C,Table), Clear(D)}; Del={On(C,D)}
Relaxed versions (delete lists removed): after Move(A, Table, B), both On(A,Table) and On(A,B) are true simultaneously. This makes the problem easier — the cost of the relaxed solution lower-bounds the true cost.
8. Plan Quality Metrics
Not all valid plans are equally good. Common metrics include:
- Plan length: total number of actions (minimised in optimal planning)
- Plan cost: ∑ cost(ai) where each action has a numeric cost
- Makespan: number of time steps when actions can execute in parallel
💡 Optimal vs. Satisficing Planning
Optimal planners (e.g., A* with admissible heuristic) guarantee minimal cost but are slower. Satisficing planners (e.g., FF, LAMA) find good plans quickly without optimality guarantees. GATE questions usually focus on understanding the algorithms rather than implementation-level optimisation.
Summary
- Classical planning uses a factored state representation (set of fluents) rather than atomic states.
- The closed-world assumption treats unlisted fluents as false; the frame problem is solved by only specifying effects.
- PDDL is the standard language for expressing planning domains and problems.
- Forward search (progression) starts from s0; backward search (regression) starts from the goal — each has trade-offs in branching factor and heuristic availability.
- Planning heuristics like hadd, hmax, hFF, and hLM-cut are derived by relaxing the problem (e.g., ignoring delete lists).
- Plan quality is measured by length, cost, or makespan.