From 1727113a8b9f495219e4f231a6ec17df8d714950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20L=C3=BChne?= Date: Sat, 13 Aug 2016 18:05:58 +0200 Subject: [PATCH] Documented types. --- doc/output-format.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/doc/output-format.md b/doc/output-format.md index fe176a3..a7619ad 100644 --- a/doc/output-format.md +++ b/doc/output-format.md @@ -34,3 +34,42 @@ The following specifies that the input problem has the two requirements `actionC requiresFeature(actionCosts). requiresFeature(conditionalEffects). ``` + +## Types (PDDL Only) + +Specifies all object types used by the PDDL problem (only if typing is enabled). + +### Syntax + +syntax | description +-------|------------ +`type(type()).` | declares the type `type()` +`has(, type()).` | declares `` to be of type `type()` + +### Example + +The following declares the type `type(block)` for later usage by the problem: + +```prolog +% types +type(type(block)). +``` + +[Constants](#constants) may have associated types (here, `constant(a)`): + +```prolog +constant(constant(a)). +has(constant(a), type(block)). +``` + +If there is typing information, [variables](#variables) are derived only for the allowed types (here, `variable(clear(X))` with `type(block)`): + +```prolog +variable(variable(clear(X))) :- has(X, type(block)). +``` + +Similarly, [actions](#actions) are derived in a type-safe way (here, `action(stack(X, Y))` is only applicable to arguments of `type(block)`): + +```prolog +action(action(stack(X, Y))) :- has(X, type(block)), has(Y, type(block)). +```