Syntax of Fact Files for RIPP 0.1 with Resources
The fact file declares objects togehter with their types, the ranges
of resource variables, simulates a database, and specifies the initial
and the goal state. It must be a text file with arbitrary name. As for
the operator file, you need to put different planning problems into
different fact files.
Basic Name Conventions:
- Type names are arbitary strings of small and capital letters, the
numbers 0-9, underscores and dashes. Valid typenames are for example
111, p-11, G09-7_b1.
- Variable names start with "?" followed by an arbitrary string
of small and capital letters, the numbers 0-9, dashes and brackets
"[" and "]".
- Resource-variable names start with "$" followed by an arbitrary
string of small and capital letters, the numbers 0-9, and dashes. Then
braces "(" ")" must follow, which can contain variable or constant
names in arbitrary order as arguments. (terminalsymbol rvarname)
- Predicate names are arbitary strings of small and capital letters, the
numbers 0-9 and dashes. (terminalsymbol predicatename)
- Constant names can contain small and capital letters, the numbers
0-9, dashes and brackets "[" and "]". (terminalsymbol constantname)
- Numbers can have a minus sign and must always contain a dot ".",
i.e. they are at least of the form digit "." digit. (terminalsymbol
number)
- Equality is represented using the distinguished predicate name
"eq", for example "!eq(?x ?y)" means that the variables ?x and ?y must be
different and "eq(c ?z)" means that the variable ?z must be equal to the
constant c.
- The universal quantifier is represented with "ALL", the existential
quantifier with "EX", negation with "!". (terminalsymbols EX, ALL, !)
- Comments start at the beginning of a line with a "#" and end with a
newline. They can be put everywhere in a file.
Upper-case letters denote non-terminal symbols, lower-case letters
denote terminal symbols. + means one or arbitrarily many occurrances
of a symbol. * means zero or arbitrarily many occurrances of a
symbol. [symbol] means optional occurrance. % stands for infinity.
FACTFILE ::= TYPELIST RVAR-DEC DATABASE INITIAL GOALS
TYPELIST ::= /* empty */
| typename ":" constantname* ";" TYPELIST
RVAR-DEC ::= /* empty */
| rvarname BOUNDARY BOUNDARY ";" RVAR-DEC
BOUNDARY ::= number
| "%"
DATABASE ::= "database:" DB-ENTRY* ";"
DB-ENTRY ::= predicatename "(" constantname* ")" number
INITIAL ::= "initial:" PRECONDS ";"
GOALS ::= "goal:" GOAL+ ";"
GOAL ::= FACT
| FACT+ "=>" FACT+ ";"
| ALL PARDEC FACT* "=>" FACT+ ";"
| EX PARDEC FACT* "=>" FACT+ ";"
| RESOURCE-REQ
PRECONDS, PARDEC, RESOURCE-REQ, and FACT are defined as in the
operator syntax. GOALS can be existentially and unversially
quantified, and also be conditional with the semantics that the
condition is evaluated in the initial state. A predicate without
arguments still requires to use () as in in arm-empty() for
example. Similarly, resource-variable names without parameters have to
be written with (), e.g. ?balance(?account) or ?load().
An object can have several types, i.e., it can appear in more than one
TYPE definition. We do not pose any restrictions on the type
hierarchy. Each type should only be declared ones. No free variables
are allowed in goals. No overloading of predicate symbols should be
done, i.e. a predicate should always take the same number of
arguments.