The "complete" PDDL3.1 BNF version that is typically used specifically states that what you are trying is not allowed. However, it is most probably a mistake that got carried over from the original grammar definition, that propagated down to the parser implementations (or maybe vice-versa?)
A durative action effect <da-effect>
is defined as follows:
<da-effect> ::= (and <da-effect>*)
<da-effect> ::= <timed-effect>
<da-effect> ::= (forall (<typed list (variable)>) <da-effect>)
<da-effect> ::= (when <da-GD> <timed-effect>)
So you can have a plain <timed-effect>
, a conjunction of <da-effect>
or wrap the <da-effect>
in a forall
or when
(if the :conditional-effects
requirement is supported by the planner.)
So technically you can have nested forall
too.
<timed-effect>
is then defined as follows:
<timed-effect> ::= (at <time-specifier> <cond-effect>)
<timed-effect> ::= (at <time-specifier> <f-assign-da>)
<timed-effect> ::= (<assign-op-t> <f-head> <f-exp-t>)
with <cond-effect>
defined as:
<cond-effect> ::= (and <p-effect>*)
<cond-effect> ::= <p-effect>
But <p-effect>
does not support conditional-effects:
<p-effect> ::= (not <atomic formula(term)>)
<p-effect> ::= <atomic formula(term)>
<p-effect> ::= (<assign-op> <f-head> <f-exp>)
<p-effect> ::= (assign <function-term> <term>)
<p-effect> ::= (assign <function-term> undefined)
However, interestingly, in the original PDDL2.1 (Fox and Long, 2003) definition <timed-effect>
is defined as follows:
<timed-effect> ::= (at <time-specifier> <a-effect>)
<timed-effect> ::= (at <time-specifier> <f-assign-da>)
<timed-effect> ::= (<assign-op-t> <f-head> <f-exp-t>)
Now <a-effect>
is not defined anywhere, and it was probably just a typo, where it mostly likely was supposed to be <da-effect>
. In which case, the syntax you are trying would have worked.
This mistake got carried forward up to PDDL3.1 and "corrected" to <cond-effect>
(presumably instead of <da-effect>
), which gives rise to your issue.