PDDL forall with when condition in durative-action

Viewed 447

This question builds on a previous question about forall clauses. I would like to limit the forall with a 'when' statement as shown below:

(:durative-action finish
  :parameters (?r - robot ?p - part)
  :duration ( = ?duration 1)
  :condition (and
      (at start (robot_free ?r))
      (at start (forall (?f - fastener_loc)
                    when (part_fastener ?p ?f)
                     (loc_not_fastened ?f)
                )
      )
     )
  :effect (and
      (at start(not (robot_free ?r)))
      (at end (part_free ?p))
      (at end (robot_free ?r))
     )
)

This works without the 'when' statement. When I include the 'when' statement, I receive several errors:

Error: Syntax error in durative-action declaration.
Error: Unreadable structure
Error: Syntax error in domain

Thanks in advance for any help.

2 Answers

I was able to get this to work with an imply statement.

(:durative-action finish
  :parameters (?r - robot ?p - part)
  :duration ( = ?duration 1)
  :condition (and
      (at start (robot_free ?r))
      (at start (forall (?f - fastener_loc)
                    (imply (part_fastener ?p ?f)(loc_not_fastened ?f))
                )
      )
     )
  :effect (and
      (at start(not (robot_free ?r)))
      (at end (part_free ?p))
      (at end (robot_free ?r))
     )
)

Not sure if this could also work the the when syntax.

The when clause needs to be wrapped in (brackets)

Related