PDDL: the Planning Domain Definition Language

PDDL, the Planning Domain Definition Language, is the standard language for writing down AI Planning problems. You describe what the world looks like, what can be done and what you want, and a planner works out how.

PDDL was written for the 1998 International Planning Competition, to give planners one common input language. It has grown with the competition since, from simple actions to numbers, time and constraints, and most research planners read some part of it. It is a language for describing problems, not a program: you say nothing about how to solve them.

A first example

A PDDL task comes in two files. The domain describes a kind of world: its types, the facts that can be true in it, and the actions available. Here a van carries parcels along roads.

demos/pddl-guide/courier/domain.pddl
; A van carries parcels along roads. PDDL 1.2: STRIPS with types.
(define (domain courier)
  (:requirements :strips :typing)
  (:types van parcel location)
  (:predicates
    (road ?from ?to - location)
    (van-at ?v - van ?l - location)
    (parcel-at ?p - parcel ?l - location)
    (in ?p - parcel ?v - van))

  (:action drive
    :parameters (?v - van ?from ?to - location)
    :precondition (and (van-at ?v ?from) (road ?from ?to))
    :effect (and (not (van-at ?v ?from)) (van-at ?v ?to)))

  (:action load
    :parameters (?p - parcel ?v - van ?l - location)
    :precondition (and (van-at ?v ?l) (parcel-at ?p ?l))
    :effect (and (not (parcel-at ?p ?l)) (in ?p ?v)))

  (:action unload
    :parameters (?p - parcel ?v - van ?l - location)
    :precondition (and (van-at ?v ?l) (in ?p ?v))
    :effect (and (not (in ?p ?v)) (parcel-at ?p ?l))))

The problem describes one situation in that world: the objects, what is true at the start, and the goal.

demos/pddl-guide/courier/problem.pddl
; Two parcels at the depot, one for the market, one for the harbour.
(define (problem two-parcels)
  (:domain courier)
  (:objects
    van1 - van
    book lamp - parcel
    depot market harbour - location)
  (:init
    (van-at van1 depot)
    (parcel-at book depot)
    (parcel-at lamp depot)
    (road depot market) (road market depot)
    (road market harbour) (road harbour market))
  (:goal (and (parcel-at book market) (parcel-at lamp harbour))))

Given these two files, Autoplan finds this plan:

(load book van1 depot)
(load lamp van1 depot)
(drive van1 depot market)
(unload book van1 market)
(drive van1 market harbour)
(unload lamp van1 harbour)

Nothing in the files says to load before driving. The planner found that from the preconditions and effects alone, and the same domain works unchanged for a hundred parcels and fifty towns.

Try it. Every new workspace in Autoplan Studio has this example under demos/pddl-guide/courier. In an older workspace, copy the two files into your own and open them. The walkthrough goes through it step by step.

In this guide

PDDL syntax

Every part of a domain and a problem file, with the common mistakes.

Walkthrough

Write a domain and a problem, solve them and extend the model.

PDDL versions

What changed between PDDL 1.2, 2.1, 2.2, 3.0, 3.1 and PDDL+.

Each version has its own page, with runnable examples: PDDL 1.2, PDDL 2.1, PDDL 2.2, PDDL 3.0, PDDL 3.1 and PDDL+. New to the field? Start with What is AI Planning?

Related languages

  • PPDDL adds probabilistic effects, and was the input language of the probabilistic track of IPC 2004.
  • RDDL, the Relational Dynamic Influence Diagram Language, describes a problem as a dynamic Bayes net with a utility.
  • HDDL extends PDDL to hierarchical planning, with tasks and methods.

Further reading

  1. Patrik Haslum, Nir Lipovetzky, Daniele Magazzeni, Christian Muise. An Introduction to the Planning Domain Definition Language. Morgan & Claypool, 2019. A book-length introduction.
  2. planning.wiki, a community guide and reference to PDDL and its planners.
  3. Håkan L. S. Younes, Michael L. Littman. PPDDL1.0: An extension to PDDL for expressing planning domains with probabilistic effects. Technical Report CMU-CS-04-167, Carnegie Mellon University, 2004.
  4. Scott Sanner. Relational Dynamic Influence Diagram Language (RDDL): Language Description.
  5. Daniel Höller, Gregor Behnke, Pascal Bercher, Susanne Biundo, Humbert Fiorino, Damien Pellier, Ron Alford. HDDL: An Extension to PDDL for Expressing Hierarchical Planning Problems. AAAI 2020.