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:
- We adopt the unique name assumption, i.e., different variables stand
for different objects in the world.
- The effect representation of an operator must first contain
the list of facts that are unconditionally added (preceeded by one
single ADD), then followed by the list of all facts that are
unconditionally deleted (preceeded by one single DEL).
- Everything that is deleted by the operator has to be mentioned
explicitly, i.e., our operators do not automatically delete their
preconditions.
- The names of the variables in the condition lists must be different
from the names of the op's variables, but not necessarily different
from the names of variables in other effect condition lists.
- There can be a possibly infinite number of different
conditional effects.
- Condition lists can be empty.
- So can be the variable list, the precondition list and the
effect list.
- As you have seen in the move operator, variables of the same type
can be defined in one list, like: ?b1 ?b2 ?b3 block ?t1 ?t2 table etc. .
- If you have a literal without any parameters, you still have to
add the "()", as in arm-empty().
- Names should not be longer than 256 characters.
- As in Graphplan, there is no explicit atomic negation. It can be
modeled by introducing additional predicates, e.g. not-inside()
or outside() if not inside() is needed.
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.