Syntax and Semantics of Operator Files for IP2 1.0 and 2.0


The operator file, as it's name suggests, contains the set of operators that may be applied in the planning domain. It must be a text file of the form (name).ops and IP2 will try to apply all the ops which are contained in it, i.e., you need to put different operator sets into different files.

Here's an EBNF for the .ops file:

  OP_FILE   ::=  OP  |  OP OP_FILE
OP ::= NAME
":v" VAR_LIST
":p" LIT_LIST
":e" EFF_LIST
VAR_LIST ::= VAR | VAR VAR_LIST
VAR ::= "?" NAME { "?" NAME } SPC NAME
LIT_LIST ::= LIT | LIT LIT_LIST
LIT ::= NAME "(" { NAME | "?" NAME } ")"
EFF_LIST ::= EFF "." | EFF ";" EFF_LIST
EFF ::= [ "ALL" VAR_LIST SPC ] [ LIT_LIST "=>" ]
"ADD" LIT_LIST [ "DEL" LIT_LIST ] | "DEL" LIT_LIST

NAME ::= small_letter { small_letter | "-" | digit }
SPC ::= " " { " " | newline }

VAR_LIST stands for a list of typed variables, for example: ?l1 ?l2 location ?p person
LIT_LIST stands for a list of literals, i.e. facts, like: on( ?b1 table ) arm-empty()
EFF_LIST stands for a list of conditional or unconditional effects,
which are separated by ";" . The last effect must be followed by "."

A simple example for a legal IP2 operator is:

  move
:v ?l1 ?l2 location
:p is-at( ?l1 )
:e ADD is-at( ?l2 ) DEL is-at( ?l1 ).
A little more sophisticated( as used in the briefcaseworld ):

  move
:v ?l1 ?l2 location
:p is-at( ?l1 )
:e ADD is-at( ?l2 ) DEL is-at( ?l1 );
ALL ?o object in( ?o ) => ADD at( ?o ?l2 ) DEL at( ?o ?l1 ).
NOTE:
Finally, a quite complicated example of an operator that we use in the Scheduling domain:


# schedworld operators for ipp
# corresponds to ucpop sched world ops
# by joerg hoffmann 11/4/97
roll
:v ?x object
:p is-at(sched)
:e ADD temperature(?x hot)
shape(?x cylindrical)
surface-condition(?x smooth)
DEL temperature(?x cold);
# the following are universally quantified conditional effects with # the quantifier ranging over ?old
ALL ?old paint-cond n-e(?old nil) => DEL painted(?x ?old);
ALL ?old shape-cond n-e(?old cylindrical) => DEL shape(?x ?old);
ALL ?old temp-cond n-e(?old hot) => DEL temperature(?x ?old);
ALL ?old surf-cond n-e(?old smooth) => DEL surface-condition(?x ?old);
# now we got an unconditional universally quantified effect with the # quantifier ranging over ?old and ?old-orient # note that we just leave out the "=>"
ALL ?old-width width ?old-orient orient
ADD no-hole(?x ?old-width ?old-orient)
DEL has-hole(?x ?old-width ?old-orient).
Space and newlines can be inserted wherever you like, except, of course, in names.
Comments go from "#" to newline.

Important: Do not use Tabulator signs, they cause syntax errors.