If you already know what PDDL is, skip to Post 3. If "heuristic search" sounds like a fancy way to say "guessing," this post is for you.
In Post 1, we saw RoboSort fail catastrophically when an LLM planned its tower assembly without checking constraints. The beam went last, the roof fell through, and two pieces crashed. The planning-enhanced agent got it right by formalizing support constraints and searching for a valid sequence.
But we hand-waved over a critical question: what does "formalizing" actually mean? How do you take a vague task description ā "build a tower from these five pieces" ā and turn it into something a computer can reason about with mathematical guarantees?
That's what this post answers. We'll take the RoboSort warehouse and turn it into a formal planning problem, piece by piece. By the end, you'll understand the mathematical model, read real PDDL code, and know why planning is computationally hard ā the essential vocabulary for everything that follows.
The Planning Problem, Through the Warehouse
Every planning problem answers the same three questions: Where are we now? What can we do? Where do we want to be?
For RoboSort, those questions become concrete. Where are we now? The robot is at its home position, five pieces sit on shelves, the build zone is empty. What can we do? Move to a shelf, pick up a piece, move to the build zone, place a piece ā but only if constraints are met (gripper must be empty to pick, piece must have support underneath to stay). Where do we want to be? All five pieces assembled into a stable tower: legs on the platform, beam on legs, roof on beam, flag on top.
The planning community captures this with a precise mathematical model. A planning problem is a tuple:
The six components of a planning problem. Every formal planning system ā from STRIPS (1971) to modern solvers ā works with some variant of this tuple.
Let's map each symbol to the warehouse:
- S ā State space: Every possible configuration of the warehouse. Where is the robot? What's in the gripper? Which pieces are on shelves? Which are in the build zone? Which are supported? Each unique combination is a state.
- sā ā Initial state: Robot at home, gripper empty, L1 and L2 on Shelf A, Beam on Shelf B, Roof and Flag on Shelf C, build zone empty.
- SG ā Goal states: Any state where all five pieces form a stable tower ā legs on platform, beam spanning both legs, roof on beam, flag on roof.
- A ā Actions:
move(from, to),pick(piece, location),place(piece, location). Each has preconditions (gripper must be empty to pick) and effects (after picking, gripper holds the piece and the shelf no longer does). - f ā Transition function: Given a state and an action, produces the next state. If RoboSort is at Shelf A with an empty gripper and executes
pick(L1), the new state has L1 in the gripper and no longer on Shelf A. - c ā Cost function: How expensive each action is. For RoboSort, each move or manipulation might cost 1 unit. An optimal planner minimizes total cost.
A plan is a sequence of actions that transforms the initial state into a goal state, with every precondition satisfied at every step. A sound planner guarantees every plan it returns is valid. An optimal planner guarantees the plan has minimum cost. This is what separates formal planning from "just prompting an LLM" ā mathematical certainty, not probabilistic hope.
This model is deceptively simple. Six symbols. But it's powerful enough to represent everything from warehouse logistics to spacecraft operations to the multi-step agentic tasks we care about. The question is: how do you write it down in a way a computer can process?
PDDL: The Map Format for Planning
The planning community's answer is PDDL ā the Planning Domain Definition Language. Think of it as the structured data format that turns the mathematical model into something a solver can read. Just as SQL lets you describe database queries without specifying how to search, PDDL lets you describe planning problems without specifying how to solve them.
A PDDL problem has two files: a domain file (what's possible ā the types, predicates, and actions) and a problem file (what's specific ā the objects, initial state, and goal). Let's build both for RoboSort's tower assembly.
The Domain File: Types, Predicates, Actions
The domain file defines the "physics" of the warehouse ā what kinds of things exist, what properties they can have, and what actions the robot can perform.
; RoboSort Tower Assembly Domain (define (domain robosort-tower) (:requirements :strips :typing) ; What kinds of things exist (:types location piece - object ) ; Properties that can be true or false (:predicates (robot-at ?loc - location) ; robot is at this location (piece-at ?p - piece ?loc - location) ; piece is at location (holding ?p - piece) ; robot is holding piece (gripper-empty) ; gripper has nothing (supports ?lower ?upper - piece) ; lower supports upper (on-platform ?p - piece) ; piece is on the base platform (placed ?p - piece) ; piece is in the build zone ) ; Action 1: Move between locations (:action move :parameters (?from ?to - location) :precondition (and (robot-at ?from)) :effect (and (robot-at ?to) (not (robot-at ?from))) ) ; Action 2: Pick up a piece (:action pick :parameters (?p - piece ?loc - location) :precondition (and (robot-at ?loc) (piece-at ?p ?loc) (gripper-empty)) :effect (and (holding ?p) (not (piece-at ?p ?loc)) (not (gripper-empty))) ) ; Action 3: Place piece (needs support!) (:action place-on-platform :parameters (?p - piece ?loc - location) :precondition (and (robot-at ?loc) (holding ?p)) :effect (and (on-platform ?p) (placed ?p) (gripper-empty) (not (holding ?p))) ) ; Action 4: Place piece on top of another (must be supported) (:action place-on-piece :parameters (?p ?support - piece ?loc - location) :precondition (and (robot-at ?loc) (holding ?p) (placed ?support) (supports ?support ?p)) :effect (and (placed ?p) (gripper-empty) (not (holding ?p))) ) )
The PDDL domain file for RoboSort's tower assembly. Four actions, each with explicit preconditions and effects. The supports predicate encodes the physics: a piece can only be placed if its support structure exists.
Read through the actions. Notice how each one has explicit preconditions (what must be true before the action can execute) and effects (what changes after it executes). The pick action requires the robot to be at the piece's location with an empty gripper. After picking, the robot holds the piece, the piece is no longer at that location, and the gripper is no longer empty. No ambiguity. No room for misinterpretation.
The key constraint is in place-on-piece: it requires (supports ?support ?p) to be true and the support piece to already be (placed ...). This is what prevents the naive ordering. You can't place the roof without the beam being placed first, because the domain says the beam supports the roof.
The Problem File: Objects, Init, Goal
The problem file describes this specific scenario ā our particular warehouse with its particular pieces and target tower.
; RoboSort Tower Assembly Problem ā 5 pieces (define (problem tower-5) (:domain robosort-tower) ; The specific objects in this scenario (:objects shelf-a shelf-b shelf-c build-zone home - location leg1 leg2 beam roof flag - piece ) ; Where everything starts (:init (robot-at home) (gripper-empty) (piece-at leg1 shelf-a) (piece-at leg2 shelf-a) (piece-at beam shelf-b) (piece-at roof shelf-c) (piece-at flag shelf-c) ; Support constraints (the "physics") (supports leg1 beam) ; legs support beam (supports leg2 beam) (supports beam roof) ; beam supports roof (supports roof flag) ; roof supports flag ) ; What we want to achieve (:goal (and (placed leg1) (placed leg2) (placed beam) (placed roof) (placed flag) )) )
The PDDL problem file for the 5-piece tower. The supports predicates in the initial state encode the structural constraints. A planner that respects preconditions will never try to place the roof before the beam.
The supports facts in the :init block are the crucial difference. They encode the physical reality that legs support the beam, the beam supports the roof, and the roof supports the flag. These aren't suggestions ā they're hard constraints. A planner working with this model will never generate a plan that places the roof before the beam, because the precondition for place-on-piece(roof, beam) requires (placed beam) to be true.
This is exactly what the naive LLM missed in Post 1. It had the right pieces and the right goal, but no formal model of support constraints. It treated "assemble a tower" as a sequence of independent actions rather than a constraint-satisfaction problem with ordering dependencies.
Why This is Hard: State Space Explosion
You might think: "Okay, so write the PDDL and feed it to a solver. Problem solved." And for five pieces, yes ā the solver finds the optimal plan almost instantly. But planning gets hard fast.
Consider what happens as we scale RoboSort's warehouse. With 5 pieces, each either on a shelf, in the gripper, or in the build zone, we have a manageable state space. But every piece we add roughly doubles the number of possible states, because each new piece can independently be in any of several locations.
Robot at home
5 on shelves
5 on shelves
5 on shelves
All 5 pieces placed
The search tree for RoboSort's tower assembly. Each level of the tree represents one action. With 5 pieces, the tree is manageable. With 50, it has more states than atoms in the universe.
With 5 pieces: a few hundred reachable states. A modern solver handles this in milliseconds.
With 10 pieces: tens of thousands of states. Still fast.
With 30 pieces: millions of states. The solver needs good heuristics to avoid exploring them all.
With 50 pieces: more reachable states than atoms in the observable universe. Brute-force search is impossible.
This exponential blowup is inherent. Classical planning is PSPACE-hard ā which means that in the worst case, determining whether a valid plan even exists is at least as hard as any problem solvable with polynomial memory. Optimal planning (finding the shortest or cheapest plan) is even harder.
The state space explosion is why we need algorithms, not just languages. PDDL describes the problem. But finding a plan within that astronomical search space requires heuristic search, constraint propagation, and decades of algorithmic innovation. That's Post 3.
This is why just having PDDL isn't enough. You need sophisticated search algorithms that can navigate enormous state spaces without exploring every state. The planning community has spent 50 years developing exactly these algorithms ā and the best ones solve problems with billions of reachable states in seconds. How? That's the next post.
The Broader Landscape: Beyond Classical Planning
Everything we've covered so far is classical planning ā deterministic, fully observable, single-agent. But the planning community has extended the framework in many directions. You don't need to learn all of these now, but knowing the landscape helps you appreciate how general the planning framework really is.
Classical (STRIPS)
Deterministic, fully observable. Our warehouse so far.
Temporal
Actions have durations. Parallel execution. Scheduling.
Probabilistic
Actions can fail. Stochastic transitions. MDPs.
HTN
Hierarchical task decomposition. Tasks break into subtasks.
Conformant
Uncertainty in initial state. Plan must work regardless.
FOND
Non-deterministic but fair. Contingency planning.
Classical planning is one slice of a rich landscape. Temporal planning handles time. Probabilistic planning handles uncertainty. HTN planning handles hierarchical task decomposition. Each extends the core model.
Classical planning covers RoboSort as described: deterministic actions, one robot, full knowledge of the world. But imagine extending the warehouse: the robot's gripper might slip (probabilistic), two robots work simultaneously (temporal), or the manager decomposes "organize aisle 3" into subtasks (HTN). Each formalism extends the mathematical model with new capabilities.
For this series, we'll focus primarily on classical planning ā it's the foundation everything builds on, and it's where most LLM-planning research operates today. But when we reach Posts 6 and 7, you'll see how LLMs are being used to handle natural language descriptions that implicitly require temporal, probabilistic, or hierarchical reasoning.
From PDDL to Plan: The Compilation Pipeline
When a solver receives your PDDL files, it doesn't search the PDDL directly. There's a compilation pipeline that transforms the lifted, human-readable PDDL into increasingly optimized representations.
The compilation pipeline. PDDL uses variables (?p, ?loc) ā grounding replaces these with all concrete objects (leg1, shelf-a). FDR compresses Boolean facts into multi-valued variables. The solver searches this compact representation.
Step 1: Grounding. PDDL actions use variables like ?p and ?loc. Grounding replaces every variable with every possible object. The action pick(?p, ?loc) becomes pick(leg1, shelf-a), pick(leg2, shelf-a), pick(beam, shelf-b), and so on. With 5 pieces and 5 locations, one action schema becomes 25 ground actions.
Step 2: FDR (Finite Domain Representation). PDDL uses Boolean predicates ā (robot-at shelf-a) is either true or false. FDR compresses these into multi-valued variables. Instead of five separate Boolean facts for the robot's location, FDR uses a single variable robot-location ā {home, shelf-a, shelf-b, shelf-c, build-zone}. This is more compact and enables more efficient search.
Step 3: Search. The solver explores the grounded, compressed state space using heuristic search. How these heuristics work ā and why they're the key to handling billion-state problems ā is the focus of Post 3.
Seeing the Formal Model in Action
Let's bring the formalization full circle. Here's the same PackBot Warehouse from Post 1 ā but this time, the interactive demo shows how the formal PDDL model maps onto the physical warehouse scene. Watch as each action fires with its preconditions checked and effects applied.
Interactive ā click "ā¶ Auto Demo" to watch the PDDL model formalize the warehouse step by step
English Description
Implicit constraints (support order)
No verification possible
A human understands. A machine can't verify.
PDDL Formalization
ā Each effect updates state precisely
ā Goal reachable via this sequence
A solver proves this plan is valid.
English descriptions are intuitive but ambiguous. PDDL formalizations are verbose but verifiable. The planning solver works with the formal model ā guaranteeing validity that no amount of natural language clarity can match.
The warehouse is the same one you saw in Post 1 ā same shelves, same five pieces, same RoboSort. But now you can see the formal model underneath: every action has a name, preconditions, and effects. Every state is a set of facts. The plan is a sequence of ground actions, and a solver can mathematically prove it reaches the goal.
This is the foundation everything else builds on. In Post 3, we'll see how heuristic search algorithms navigate the enormous state spaces these models create. In Posts 4-7, we'll see how LLMs interact with these formal models ā sometimes helping to solve them, sometimes generating them from scratch.
PDDL is the bridge between human intent and machine reasoning. It captures what's possible (actions), what's true (states), and what's desired (goals) in a format that enables mathematical proof. Every post in this series ā from classical algorithms to LLM-driven systems ā builds on this formal foundation.
Beyond the Warehouse: Planning in Agentic AI
The formalization we just walked through ā states, actions, preconditions, effects ā isn't unique to warehouse robots. Every agentic system that decomposes tasks into steps is implicitly building a plan. The formal framework just makes it explicit and verifiable.
What's Ahead
Now you know what a plan is ā formally. A planning problem is a tuple of states, actions, transitions, and goals. PDDL is the language that encodes it. And the state space explosion is why finding plans is computationally hard.
But knowing the formalism is only half the story. The other half is solving it. With five pieces, brute-force search works fine. With fifty, you need heuristics ā functions that estimate how far you are from the goal and guide the search toward promising paths. The planning community has spent five decades developing these algorithms, and the best modern solvers can handle problems with billions of reachable states.
Next, we'll see how.
References
- Fikes, R. E. & Nilsson, N. J. (1971). STRIPS: A New Approach to the Application of Theorem Proving to Problem Solving. Artificial Intelligence, 2(3-4), 189-208.
- Aeronautiques, C., et al. (1998). PDDL ā The Planning Domain Definition Language. Technical Report CVC TR-98-003.
- Helmert, M. (2006). The Fast Downward Planning System. JAIR, 26, 191-246.
- Katz, M., Kokel, H., & Muise, C. (2025). Planning in the Era of Language Models. NeurIPS 2025 Tutorial.
- Ghallab, M., Nau, D., & Traverso, P. (2004). Automated Planning: Theory and Practice. Morgan Kaufmann.
- Bylander, T. (1994). The Computational Complexity of Propositional STRIPS Planning. Artificial Intelligence, 69(1-2), 165-204.