Abstract
Generalized planning aims to synthesize a single solution—a "generalized plan"—capable of solving an entire class of tasks within a domain, regardless of problem size or initial configuration. This paper presents a novel approach to this challenge by representing plans as programs with nested and recursive procedures. By compiling these programming constructs into standard Planning Domain Definition Language (PDDL), the authors enable off-the-shelf classical planners to automatically generate sophisticated algorithms for complex tasks such as list sorting and tree traversal.
1. Introduction
In classical planning, the objective is typically to find a sequence of actions to reach a goal state from a specific initial state. Generalized planning is significantly more difficult: it seeks a single algorithm (a generalized plan) that can solve any problem in a domain. For example, instead of finding a path for one specific grid, a generalized plan would be an algorithm that navigates any grid.
The primary challenge is that the search space for these programs grows exponentially with the number of lines of code. Previous attempts were often limited to very short, simple programs or required human experts to hand-code the "control knowledge." This research bridges this gap by allowing planners to automatically discover and use hierarchical, procedural knowledge to solve complex tasks that were previously out of reach.
2. Methodology
The authors represent generalized plans as planning programs: numbered lists of instructions including basic actions, conditional "gotos" (for loops and branching), and termination markers.
2.1 Stack-Based PDDL Compilation
A key technical contribution is the development of a stack-based PDDL compilation. By modeling a call stack using fluents (state variables), the authors allow a standard planner to "call" auxiliary procedures and handle recursion, where a procedure calls itself. This is a significant engineering feat, as PDDL was not originally designed for general-purpose programming logic.
2.2 Hierarchical Decomposition and DCK
Instead of attempting to generate a monolithic program from scratch, the system employs a "divide and conquer" approach. It solves smaller subtasks first to generate "Procedural Domain Control Knowledge" (DCK). These subtasks are then compiled as callable procedures that the planner can use to solve the main, more complex problem. This hierarchical structure allows for compact representations of complex behaviors.
2.3 Optimization and Parameter Passing
To improve search efficiency, complex conditional jump instructions were split into two simpler steps (eval and jmp), significantly reducing the branching factor during planning. Furthermore, a mechanism to pass variables between procedures using the stack was implemented, allowing for more generic and reusable code.
3. Experimental Evaluation
The approach was evaluated on a variety of benchmark domains, ranging from classic AI planning to algorithmic tasks:
- Classic Planning: Blocks World, Gripper, and navigation tasks (Hall-A, Grid, Visit-All).
- Mathematical/Algorithmic: Summatory (calculating sums) and Fibonacci sequence generation.
- Data Structures: Reversing a linked list, Selection Sort, and Tree traversal (Depth-First Search).
4. Results and Discussion
The experimental results demonstrate the superiority of the "Nested Procedures" (NP) approach over single-procedure (OP) methods. In domains like Grid, Hall-A, and Sorting, the OP approach often resulted in memory errors (ME) or timeouts, whereas the NP approach successfully synthesized solutions.
Key insights from the results include:
- Recursion Success: The system successfully generated a recursive Depth-First Search (DFS) algorithm for the Tree domain and a recursive solution for the List domain.
- Efficiency: In the Fibonacci domain, using nested procedures reduced the plan length from 56 steps to just 12 and significantly cut down planning time compared to a flat, single-procedure search.
- Compactness: The generated programs are remarkably small; for instance, the selection sort algorithm was synthesized using two procedures of only 4 lines each.
5. Conclusion and Future Work
This work demonstrates that treating plans as hierarchical programs allows for extremely compact and general solutions to infinite problem sets. While the current approach relies on user-provided subtask decompositions, the authors identify the automatic discovery of these subtasks and high-level state features as critical next steps for making the system fully autonomous.
Summary updated