Abstract
Generalized planning aims to find a single strategy that solves all instances of a problem domain. While Finite State Controllers (FSCs) are effective for this, they often lack the modularity and recursion needed for complex tasks. This paper introduces Hierarchical Finite State Controllers (HFSCs), which extend standard FSCs with a call stack and parameter passing. We propose a compilation that transforms the synthesis of HFSCs into a classical planning problem, enabling off-the-shelf planners to automatically generate recursive and modular programs. Our approach successfully synthesizes controllers for challenging benchmarks like binary tree traversal and multi-digit addition.
Introduction
A significant challenge in AI planning is the synthesis of generalized plans—strategies that remain valid across different problem instances, such as clearing a block tower regardless of the number of blocks. Standard FSCs are "flat" and struggle with tasks that are inherently recursive or modular. For example, traversing a binary tree or building a multi-digit adder by reusing a single-bit adder logic typically requires manual definition of observation functions or hierarchical structures. This research addresses the automatic synthesis of these hierarchical and recursive controllers without requiring predefined observation functions.
Methods: Hierarchical Finite State Controllers
The core contribution is the HFSC formalism and its compilation into classical planning. HFSCs extend standard controllers by incorporating a call stack. This allows a controller to execute a call(C, params) action, pushing the current state onto the stack and initiating a sub-controller (or itself, in the case of recursion).
The synthesis process is framed as a "meta-planning" problem in PDDL:
- Program Actions: The planner "writes" the controller by assigning actions and transitions to controller states.
- Execute Actions: The planner validates the synthesized strategy by running it on sample instances.
- Observation Synthesis: Unlike previous methods, the planner autonomously decides which world properties (fluents) the controller should branch on.
- Symmetry Breaking: Mechanisms are included to prune redundant permutations of the controller, keeping the search space manageable.
Evaluation and Results
The approach was evaluated on diverse benchmarks, including recursive tasks like Tree/DFS and AnBn, and modular tasks like the Serial Binary Adder (SBA).
Key results include:
- Successful Synthesis: The system generated recursive controllers for tree traversal and modular controllers for binary addition.
- Efficiency: Using planners like Best-First Width Search (BFWS), solutions were often found within seconds or minutes.
- Compactness: HFSCs proved more expressive and compact than alternative formalisms like "Planning Programs," sometimes being up to 5x smaller.
- Generalization: Controllers synthesized on small samples generalized perfectly to much larger problem instances.
Conclusion
By modeling program design as a sequence of choices in a higher-level planning space, this work bridges the gap between reactive controllers and recursive algorithms. While the method requires user-provided bounds on states and stack depth, it represents a significant step toward autonomous program synthesis in planning. Future work will explore incremental synthesis and applications in non-deterministic environments.
Summary updated