[Top] [NuPDDL]
 

This nonsensical robot navigation domain shows many of the standard PDDL2.1 features present in NuPDDL.
 

(define (domain simple_robot)
  (:types x_coord y_coord package)
  (:constants east west - x_coord
              north south - y_coord
              pack1 pack2 - package)
  (:predicates
    (broken ?p - package))
  (:functions
      (robot_x) - x_coord
      (robot_y) - y_coord)
  (:action move_east
     :parameters ()
     :precondition (and
                     (=  (robot_x) west)
                     (exists (?p - package) (not (broken ?p))))
     :effect       (and
                      (assign (robot_x) east)
                      (when (= (robot_y) north)
                          (and
                            (forall (?p - package)
                              (when (not (broken ?p))
                                (broken ?p)))
                            (assign (robot_y) south)))))
  (:action move_west
     :parameters ()
     :precondition (=  (robot_x) east)
     :effect       (assign (robot_x) west))
  (:action move_north
     :parameters ()
     :precondition (and
                    (=  (robot_x) east)
                    (=  (robot_y) south))
     :effect       (assign (robot_y) north))
  (:action move_south
     :parameters ()
     :precondition (and
                    (=  (robot_x) east)
                    (=  (robot_y) north))
     :effect       (assign (robot_y) south))
)