PDDL 3.0
PDDL3, by Alfonso Gerevini and Derek Long, was the language of the fifth planning competition. It lets a model say how a plan may reach its goal, with constraints on the whole plan, and what would make it better, with preferences.
State-trajectory constraints
In the report's words, these "assert conditions that must be met by the entire sequence of states visited during the execution of a plan". They go in a :constraints section of the problem or the domain.
; The first example's domain: PDDL3 constraints live in the problem here,
; though they may also be written in the domain, for all its problems.
(define (domain courier-constraints)
(:requirements :strips :typing :constraints)
(: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))))(define (problem medicine-first)
(:domain courier-constraints)
(:objects
van1 - van
medicine lamp - parcel
depot market clinic harbour - location)
(:init
(van-at van1 depot)
(parcel-at medicine depot) (parcel-at lamp depot)
(road depot market) (road market depot)
(road depot clinic) (road clinic depot)
(road depot harbour) (road harbour depot)
(road market harbour) (road harbour market))
(:goal (and (parcel-at medicine clinic) (parcel-at lamp harbour)))
(:constraints (and
; Never in the market, in any state of the plan.
(always (not (van-at van1 market)))
; The lamp reaches the harbour only after the medicine reaches the clinic.
(sometime-before (parcel-at lamp harbour) (parcel-at medicine clinic)))))The market is off limits, and the lamp has to wait for the medicine, so Autoplan goes to the clinic first:
(load lamp van1 depot)
(load medicine van1 depot)
(drive van1 depot clinic)
(unload medicine van1 clinic)
(drive van1 clinic depot)
(drive van1 depot harbour)
(unload lamp van1 harbour)The operators
| Form | Means |
|---|---|
(at end g) | g holds in the final state |
(always g) | g holds in every state |
(sometime g) | g holds in at least one state |
(within t g) | g holds by time t |
(at-most-once g) | g becomes true at most once |
(sometime-after a b) | If a holds, b holds then or later |
(sometime-before a b) | If a holds, b held earlier |
(always-within t a b) | Whenever a holds, b follows within t |
(hold-during t1 t2 g) | g holds from t1 to t2 |
(hold-after t g) | g holds after t |
These operators may not appear in action preconditions. The competition did not allow them to be nested.
Preferences
A preference is a soft constraint: a plan may break it, at a price. Preferences can be named, and (is-violated name) in the metric counts how many of that name were not satisfied.
(:goal (and (parcel-at book market)
(parcel-at lamp harbour)
(preference van-home (van-at van1 depot))))
(:metric minimize (is-violated van-home))Autoplan does not support preferences yet, and refuses a file that uses them. We checked that this example parses and solves with OPTIC, which does.
Preferences may appear in goals, constraints and action preconditions, and nest only inside conjunctions and universal quantifiers.
Requirement flags
:constraints: constraint sections in domain and problem files.:preferences: preferences in action preconditions and goals.
Sources
- Alfonso Gerevini, Derek Long. Plan Constraints and Preferences in PDDL3: The Language of the Fifth International Planning Competition. Technical Report, Department of Electronics for Automation, University of Brescia, 2005.
- Alfonso Gerevini, Derek Long. BNF Description of PDDL3.0. 2005.
- Alfonso E. Gerevini, Patrik Haslum, Derek Long, Alessandro Saetti, Yannis Dimopoulos. Deterministic planning in the fifth international planning competition: PDDL3 and experimental evaluation of the planners. Artificial Intelligence 173(5-6), 619-668, 2009.