Inferensys

Glossary

Method (HTN)

In Hierarchical Task Network (HTN) planning, a Method is a schema that defines a possible way to decompose a compound task into a network of subtasks, given certain preconditions are met.
Product manager reviewing autonomous task execution dashboard on laptop, completed tasks visible, casual work session.
HIERARCHICAL TASK NETWORKS

What is Method (HTN)?

A Method is the core decomposition rule in Hierarchical Task Network (HTN) planning, defining how to break down an abstract, high-level task into a structured network of subtasks.

In Hierarchical Task Network (HTN) planning, a Method is a schema that specifies a possible way to decompose a compound task into a network of subtasks, but only if certain preconditions are met in the current world state. It is the fundamental rule that encodes domain-specific knowledge about how to achieve complex goals, transforming abstract intentions into concrete, executable steps. Each method provides one valid recipe for task reduction, and a planner selects among applicable methods to find a workable plan.

A method formally consists of a task head (the compound task it decomposes), a set of preconditions (logical conditions that must be true for it to be applicable), and a task network (the resulting set of subtasks with ordering constraints). This structure allows HTN planners to perform task decomposition recursively, replacing high-level objectives with increasingly specific actions until only primitive tasks (directly executable operators) remain, forming a complete solution plan.

DEFINITIONAL BREAKDOWN

Key Components of an HTN Method

A Method in Hierarchical Task Network planning is a schema that defines a single, conditional way to decompose a compound task into a network of subtasks. It is the core mechanism that encodes procedural knowledge.

01

Compound Task Head

Every method is associated with a specific compound task it can decompose. The method's head matches the name and parameters of this abstract, high-level task. For example, a method with the head Transport(Package, CityA, CityB) provides a way to achieve the goal of transporting a package between two cities. A single compound task may have multiple methods, each representing a different strategy for accomplishing it.

02

Precondition

A logical expression that must evaluate to true in the current world state for the method to be applicable. Preconditions gate the use of a specific decomposition strategy.

  • Example: A Fly(Passenger, AirportA, AirportB) method may have the precondition HasTicket(Passenger) AND Operational(Airplane). If the passenger has no ticket, this method is invalid, and the planner must seek an alternative (e.g., a Drive method).
  • Preconditions are evaluated during planning, enabling context-sensitive decomposition.
03

Subtasks (Task Network)

The core body of the method: a partially ordered network of new tasks that replace the original compound task. These subtasks can be:

  • Primitive Tasks: Directly executable actions (operators).
  • Compound Tasks: Requiring further decomposition by other methods.
  • The network can include ordering constraints (e.g., Subtask1 BEFORE Subtask2) and causal links to ensure the preconditions of later tasks are met by the effects of earlier ones.
04

Decomposition Process

The planner applies a method by instantiating its subtask network and inserting it into the evolving plan in place of the matched compound task. This process is recursive: new compound subtasks are selected and decomposed until the plan contains only primitive, executable actions. This recursion builds a decomposition tree, which is later flattened into a linear sequence of actions for execution.

05

Method vs. Operator

It is critical to distinguish a Method from an Operator in HTN planning.

  • Operator: Represents a single, atomic, executable action in the world (e.g., PickUp(Object), NavigateTo(Location)). Defined by its preconditions and direct effects on the world state.
  • Method: A decomposition rule for an abstract task. It has no direct world effects. Its "effect" is to introduce more plan structure. Methods provide the "how-to" knowledge, while operators provide the "what-can-be-done" knowledge.
06

Domain-Specific Knowledge Encoding

The collection of methods in an HTN domain description encodes expert procedural knowledge, making HTN planning highly efficient for known domains. For instance, methods for AssembleProduct would encode the specific, correct assembly steps for that product. This contrasts with classical planners that search through all possible action sequences; HTN planners search through known, sensible decomposition paths, which is often far more constrained and directed.

HIERARCHICAL TASK NETWORKS

How Does a Method Work in HTN Planning?

A method is the core decomposition rule in Hierarchical Task Network planning, defining how to break down an abstract, compound task into a network of subtasks.

A method is a schema that defines a single, valid way to decompose a specific compound task into a network of smaller subtasks, provided its preconditions are satisfied in the current world state. It acts as a procedural recipe, encoding domain-specific knowledge about how to achieve a high-level objective. Each method essentially answers the question: "Given these conditions, here is one way to accomplish this abstract task." The planner selects applicable methods to recursively replace compound tasks until only primitive tasks (executable actions) remain.

The structure of a method includes a head (the compound task it decomposes), a set of logical preconditions, and a body (the resulting task network). This network can contain new compound or primitive tasks with ordering constraints between them. During planning, the algorithm searches through the space of possible method applications. The choice of method determines the plan's structure, making methods the primary mechanism for injecting expert knowledge and controlling the planner's search, leading to highly efficient and domain-appropriate solutions.

HIERARCHICAL TASK NETWORKS

Frequently Asked Questions

Common questions about Methods, the core decomposition rules in Hierarchical Task Network (HTN) planning that define how abstract tasks are broken down into executable actions.

A Method in Hierarchical Task Network (HTN) planning is a schema that defines a possible way to decompose a compound task into a network of subtasks, provided certain preconditions in the current world state are satisfied. It is the core procedural knowledge that drives the task decomposition process, transforming high-level goals into executable plans. Each method consists of a head (the compound task it decomposes), a set of preconditions, and a body (the resulting network of subtasks, which can be other compound or primitive tasks). The planner selects applicable methods to recursively break down tasks until only primitive, directly executable actions remain.

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.