Skip to content

Domains

Victor Mataré edited this page Dec 15, 2019 · 9 revisions

A domain is a typified set of values that can be used to restrict the possible arguments of an action or a fluent. It can be defined a verbatim set of values, or as composition of domain expression. It is only allowed at the global scope.

Global definition

TYPE domain NAME = DOMAIN_EXPRESSION

After this, NAME denotes the subset of TYPE that is specified by DOMAIN_EXPRESSION, and NAME is usable as any other type keyword.

Domain expressions

Verbatim set expression

{ ELEM1 [ , ELEM2 ... ] }

All elements must be of the type of the domain, and they must be verbatim values (i.e. no function calls etc.).

Domain composition

DOMAIN_LHS | DOMAIN_RHS // Union
DOMAIN_LHS & DOMAIN_RHS // Intersection
DOMAIN_LHS \ DOMAIN_RHS // Difference

DOMAIN_LHS and DOMAIN_RHS can be arbitrary domain expressions, but they must be of the same type.

Example

symbol domain blocks = {a, b, c}
symbol domain locations = blocks | {table}

This defines the domain blocks to contain the symbols a, b and c, and the domain locations as the domain blocks with an additional element table.

Clone this wiki locally