Abstract
To apply hierarchical task network (HTN) planning to real-world planning problems, one needs to encode the HTN schemata and action models beforehand. However, acquiring such domain knowledge is difficult and time-consuming because the HTN domain definition involves a significant knowledge-engineering effort. A system that can learn the HTN planning domain knowledge automatically would save time and allow HTN planning to be used in domains where such knowledgeengineering effort is not feasible. In this paper, we present a formal framework and algorithms to acquire HTN planning domain knowledge, by learning the preconditions and effects of actions and preconditions of methods. Our algorithm, HTN-learner, first builds constraints from given observed decomposition trees to build action models and method preconditions. It then solves these constraints using a weighted MAX-SAT solver. The solution can be converted to action models and method preconditions. Unlike prior work on HTN learning, we do not depend on complete action models or state information. We test the algorithm on several domains, and show that our HTN-learner algorithm is both effective and efficient.
Introduction
Hierarchical Task Network (HTN) planning is a powerful paradigm for solving complex real-world problems by decomposing high-level goals into manageable subtasks. Despite its effectiveness, HTN planning suffers from a significant "knowledge engineering bottleneck." Planners require meticulously defined action models (preconditions and effects) and method preconditions (conditions for task decomposition). Manually encoding this domain knowledge is tedious, error-prone, and often impractical for large-scale applications.
Existing automated learning approaches often rely on complete observability of state transitions or pre-defined action models. This paper introduces HTN-learner, a novel algorithm designed to learn both action models and method preconditions simultaneously from partially observed plan traces, where intermediate states may be missing or incomplete.
Methodology
The HTN-learner framework operates in two primary stages to reconstruct the planning domain from observed decomposition trees.
Constraint Generation
The algorithm analyzes observed decomposition trees to generate three types of logical constraints: state constraints (SC), decomposition constraints (DC), and action constraints (AC). State constraints are derived from correlations between observed states and action execution, while decomposition constraints leverage the hierarchical structure of the tasks. Action constraints encode general planning principles.
Weighted MAX-SAT Optimization
Constraints are weighted based on their frequency and type. A weighted MAX-SAT solver identifies the truth assignment that satisfies the maximum weight of constraints, which is then translated into the final action models and method preconditions.
Experimental Evaluation
The algorithm was evaluated on three standard planning benchmarks: htn-blocks (classic blocks-world), htn-depots (logistics and stacking), and htn-driverlog (truck routing and delivery). For each domain, 200 decomposition trees were generated as training data. The performance was compared against a ground-truth model and a hybrid baseline, ARMS+, which learns actions and methods sequentially.
Results and Discussion
HTN-learner consistently outperformed the ARMS+ baseline across all tested domains. A key finding is the algorithm's resilience to missing data. Even when only 25% (1/4) of intermediate states are observed, HTN-learner maintains a low error rate, typically below 15%. In contrast, the baseline performance degrades significantly under partial observability.
The results demonstrate that simultaneous learning of action models and hierarchy is superior to sequential approaches. The hierarchical structure itself serves as a proxy for missing state information, providing implicit clues about the necessary preconditions for specific action sequences. Furthermore, the use of MAX-SAT allows the system to handle uncertainty and potential inconsistencies in real-world observations effectively.
Conclusion
HTN-learner successfully automates the acquisition of HTN domain knowledge from partial observations. By framing the problem as a weighted MAX-SAT optimization, it bridges the gap between raw plan traces and structured planning models. Future work will address the current dependency on pre-defined decomposition structures, explore sensitivity to weight-tuning parameters, and enhance robustness against noisy sensor data.
Summary updated