Inferensys

Glossary

Planning Problem (HTN)

A formal problem instance for a Hierarchical Task Network planner, consisting of a domain description, an initial world state, and an initial task network.
Product manager reviewing autonomous task execution dashboard on laptop, completed tasks visible, casual work session.
HIERARCHICAL TASK NETWORKS

What is a Planning Problem (HTN)?

A formal problem instance for a Hierarchical Task Network (HTN) planner, specifying what needs to be achieved and the knowledge available to achieve it.

A Planning Problem (HTN) is a formal specification comprising three core components: a domain description, an initial state, and an initial task network. The domain description is a library of primitive actions (operators) and compound tasks with associated decomposition methods. The initial state is a snapshot of the world before planning begins. The initial task network is a set of high-level, often compound, tasks that define the planner's objective, which is to decompose this network into a sequence of executable primitive actions.

This formalism is the input to an HTN planner, which searches through the space of possible task decompositions rather than action sequences. The planner recursively applies methods to compound tasks, expanding the task network until it consists solely of primitive actions whose preconditions are satisfied in the expected world state. A valid solution is a hierarchical plan—a fully decomposed, executable sequence that achieves the initial tasks from the initial state, respecting all ordering and causal constraints imposed by the methods.

PLANNING PROBLEM (HTN)

The Three Core Components

A Hierarchical Task Network (HTN) Planning Problem is a formal instance requiring a solution. It is defined by three mandatory components that together specify what needs to be accomplished, the rules for how to accomplish it, and the starting conditions.

01

Domain Description

The Domain Description is the rulebook and capability catalog for the planner. It formally defines:

  • Operators: The atomic, executable actions. Each operator has preconditions (logical conditions that must be true for it to run) and effects (how it changes the world state).
  • Task Schemas: Templates for both Primitive Tasks (which map directly to operators) and Compound Tasks (high-level, abstract goals).
  • Methods: The recipes for decomposition. Each method specifies how a single Compound Task can be broken down into a network of smaller subtasks (which can be compound or primitive), provided its preconditions are met. This description is reusable across many different planning problems within the same operational domain, such as logistics, manufacturing, or software deployment.
02

Initial World State

The Initial World State is a complete snapshot of the environment at the start of the planning process. It is a set of grounded logical propositions that describe what is true. For example:

  • (robot-at dock-1)
  • (package-loaded pkg-a truck-1)
  • (battery-level robot-1 85) The planner uses this state to evaluate the preconditions of operators and methods. A method or operator is only applicable if all its preconditions are logically satisfied by the current world state. This component grounds the abstract planning problem in a specific, concrete scenario.
03

Initial Task Network

The Initial Task Network is the 'to-do' list given to the planner. It specifies the high-level goal(s) that need to be accomplished, expressed as one or more Compound Tasks. This is not a simple goal state (a desired set of conditions); it is a task to be performed.

For instance, instead of a goal (delivered pkg-a warehouse-5), the initial task network would contain the compound task (deliver pkg-a warehouse-5). The planner's job is to recursively decompose this task using methods from the domain description until it produces a sequence of executable primitive actions (operators) that, when applied to the initial state, result in the package being delivered.

04

Formal Problem Statement

A Planning Problem P is formally defined as the triple: P = (D, s0, t0) where:

  • D is the Domain Description.
  • s0 is the Initial World State.
  • t0 is the Initial Task Network. The planner's algorithm searches for a Solution Plan—a fully decomposed network where all tasks are primitive and ordering constraints are satisfied. The plan is valid if, when the primitive actions are executed in sequence starting from s0, they successfully accomplish the decomposition of t0.
05

Contrast with Classical Planning

HTN planning fundamentally differs from Classical (STRIPS-style) Planning:

  • Classical: Given an initial state and a goal state, find any sequence of actions that transforms one into the other.
  • HTN: Given an initial state and an initial task network, find a sequence of actions by recursively decomposing tasks according to provided methods. HTN is not just about achieving a state; it's about performing tasks in a prescribed, often procedurally constrained, manner. This makes HTN more expressive for modeling complex, hierarchical procedures but requires more upfront knowledge engineering in the domain description.
06

Example: Logistics Domain

Consider a robot warehouse problem:

  • Domain (D): Contains operators like drive, load, unload. Contains compound tasks like transport-package. Contains a method: (transport-package ?p ?loc) can be decomposed into [navigate-to ?p, pick-up ?p, navigate-to ?loc, drop ?p].
  • Initial State (s0): (robot-at charging-station), (package-at pkg-1 shelf-a).
  • Initial Task (t0): (transport-package pkg-1 loading-dock). The HTN planner decomposes t0 using the method, checks preconditions for each new subtask (e.g., navigate-to requires knowing the robot's location), and eventually outputs a primitive sequence: [drive charging-station shelf-a, load pkg-1, drive shelf-a loading-dock, unload pkg-1].
PLANNING PROBLEM (HTN)

How an HTN Planner Solves a Planning Problem

A Hierarchical Task Network (HTN) planner solves a planning problem by recursively decomposing high-level, abstract tasks into executable primitive actions, guided by a domain-specific library of decomposition methods.

The planner begins with an initial task network, which contains the high-level goal tasks. It selects a compound task from this network and searches the domain description for an applicable method. A method is applicable if its preconditions are satisfied by the current world state. The planner applies the method, replacing the compound task with the method's specified network of subtasks. This task decomposition process repeats recursively on the new subtasks.

Decomposition continues until the network contains only primitive tasks, which correspond directly to executable operators. The planner ensures all ordering constraints and resource constraints are satisfied throughout this process. The final output is a solution plan: a totally ordered sequence of primitive actions guaranteed to be executable from the initial state and to achieve the original goals, as verified through plan verification. This hierarchical approach makes HTN planning highly efficient for complex, structured domains.

HIERARCHICAL TASK NETWORKS

Frequently Asked Questions

Common questions about the formal definition and components of a Planning Problem in Hierarchical Task Network (HTN) planning, a core concept for engineers building complex, multi-step autonomous agents.

A Planning Problem in Hierarchical Task Network (HTN) planning is a formal problem instance defined by three core components: a Domain Description, an Initial State, and an Initial Task Network. The planner's objective is to decompose the initial task network, using methods from the domain, into a sequence of primitive, executable actions that, when applied starting from the initial state, achieve the desired goal.

  • Domain Description: The 'knowledge base' containing all task schemas, methods for decomposing compound tasks, and operators (primitive actions with preconditions and effects).
  • Initial State: A complete snapshot of the world before planning begins, specifying all facts that are true.
  • Initial Task Network: The high-level goal, represented as one or more (often compound) tasks that need to be accomplished.

The planner solves this problem through task decomposition, recursively replacing abstract tasks with subtasks until only primitive operators remain, resulting in a solution plan.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.