Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 55 additions & 55 deletions data/domains/keygrid/ground.pddl
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
(define (domain keygrid)
(:requirements :strips :typing)
;; ADDED TO THE ORIGINAL PDDL
(:types place key shape)
;; ADDED TO THE ORIGINAL PDDL END
(:predicates
(conn ?x ?y - place)
(key-shape ?k - key ?s - shape)
(lock-shape ?x - place ?s - shape)
(at ?r - key ?x - place)
(at-robot ?x - place)
(locked ?x - place)
(holding ?k - key)
(open ?x - place)
(arm-empty)
)
(:action unlock
:parameters (?curpos ?lockpos - place ?key - key ?shape - shape)
:precondition (and
(conn ?curpos ?lockpos)
(key-shape ?key ?shape)
(lock-shape ?lockpos ?shape)
(at-robot ?curpos)
(locked ?lockpos)
(holding ?key))
:effect (and (open ?lockpos) (not (locked ?lockpos))))
(:action move
:parameters (?curpos ?nextpos - place)
:precondition (and (at-robot ?curpos)
(conn ?curpos ?nextpos) (open ?nextpos))
:effect (and (at-robot ?nextpos) (not (at-robot ?curpos))))
(:action pickup
:parameters (?curpos - place ?key - key)
:precondition (and (at-robot ?curpos)
(at ?key ?curpos) (arm-empty ))
:effect (and (holding ?key) (not (at ?key ?curpos)) (not (arm-empty ))))
(:action pickup-and-loose
:parameters (?curpos - place ?newkey - key ?oldkey - key)
:precondition (and (at-robot ?curpos) (holding ?oldkey)
(at ?newkey ?curpos))
:effect (and (holding ?newkey) (at ?oldkey ?curpos)
(not (holding ?oldkey)) (not (at ?newkey ?curpos))))
(:action putdown
:parameters (?curpos - place ?key - key)
:precondition (and (at-robot ?curpos) (holding ?key))
:effect (and (arm-empty) (at ?key ?curpos) (not (holding ?key))))
)
(define (domain keygrid)
(:requirements :strips :typing)


;; ADDED TO THE ORIGINAL PDDL
(:types place key shape)
;; ADDED TO THE ORIGINAL PDDL END

(:predicates
(conn ?x ?y - place)
(key-shape ?k - key ?s - shape)
(lock-shape ?x - place ?s - shape)
(at ?r - key ?x - place)
(at-robot ?x - place)
(locked ?x - place)
(holding ?k - key)
(open ?x - place)
(arm-empty)
)

(:action unlock
:parameters (?curpos ?lockpos - place ?key - key ?shape - shape)
:precondition (and
(conn ?curpos ?lockpos)
(key-shape ?key ?shape)
(lock-shape ?lockpos ?shape)
(at-robot ?curpos)
(locked ?lockpos)
(holding ?key))
:effect (and (open ?lockpos) (not (locked ?lockpos))))

(:action move
:parameters (?curpos ?nextpos - place)
:precondition (and (at-robot ?curpos)
(conn ?curpos ?nextpos) (open ?nextpos))
:effect (and (at-robot ?nextpos) (not (at-robot ?curpos))))

(:action pickup
:parameters (?curpos - place ?key - key)
:precondition (and (at-robot ?curpos)
(at ?key ?curpos) (arm-empty ))
:effect (and (holding ?key) (not (at ?key ?curpos)) (not (arm-empty ))))

(:action pickup-and-loose
:parameters (?curpos - place ?newkey - key ?oldkey - key)
:precondition (and (at-robot ?curpos) (holding ?oldkey)
(at ?newkey ?curpos))
:effect (and (holding ?newkey) (at ?oldkey ?curpos)
(not (holding ?oldkey)) (not (at ?newkey ?curpos))))

(:action putdown
:parameters (?curpos - place ?key - key)
:precondition (and (at-robot ?curpos) (holding ?key))
:effect (and (arm-empty) (at ?key ?curpos) (not (holding ?key))))
)
124 changes: 62 additions & 62 deletions data/domains/keygrid/nl.json
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
{
"overall": {
"first": "The Grid domain models a robot navigating between connected locations while collecting keys to unlock locked areas.",
"detailed-first": "This domain consists of a finite set of interconnected places. The robot can move between places if they are connected, pick up keys, and unlock locked locations whose locks match the shape of the key it carries. The robot starts at one location and must reach a goal location, possibly requiring it to collect and use keys along the way to unlock passages."
},
"predicates": {
"at-robot": {
"first": "The robot is at a specific place.",
"detailed-first": "Indicates the robot’s current position within the grid. At any time, the robot can be located at exactly one place."
},
"at": {
"first": "A key is at a specific place.",
"detailed-first": "Represents that a key is lying at a certain location within the grid. The robot can move to this place to pick up the key."
},
"conn": {
"first": "Two places are connected.",
"detailed-first": "Defines a bidirectional connection between two places, meaning the robot can move directly between them if no lock blocks the way."
},
"locked": {
"first": "A place is locked.",
"detailed-first": "Marks a place as locked, preventing the robot from entering until it is unlocked using a matching key."
},
"open": {
"first": "A place is open.",
"detailed-first": "Indicates that the place is unlocked and accessible for the robot to enter or move through."
},
"key-shape": {
"first": "A key has a particular shape.",
"detailed-first": "Each key is associated with a shape that determines which locks it can open. Only a key whose shape matches a lock’s shape can unlock that place."
},
"lock-shape": {
"first": "A place’s lock has a particular shape.",
"detailed-first": "Defines the shape of the lock associated with a specific place. The place can only be unlocked by a key with the same shape."
},
"holding": {
"first": "The robot is holding a key.",
"detailed-first": "Indicates that the robot is currently carrying a specific key. While holding a key, the robot cannot pick up another one unless it drops the current one."
},
"arm-empty": {
"first": "The robot is not holding anything.",
"detailed-first": "Shows that the robot’s gripper is empty and can pick up a new key."
}
},
"actions": {
"move": {
"first": "The robot moves from one place to another connected place.",
"detailed-first": "This action represents basic navigation in the grid. The robot can move between two connected places if the destination is open or has been unlocked. The effect is that the robot changes its position to the new place."
},
"pickup": {
"first": "The robot picks up a key.",
"detailed-first": "If the robot is at a place containing a key and its arm is empty, it can pick up that key. The effect is that the key is now held by the robot and no longer at the place."
},
"unlock": {
"first": "The robot unlocks a locked place using a key.",
"detailed-first": "If the robot is holding a key whose shape matches a locked place’s lock-shape, it can perform the unlock action. The effect is that the place becomes open and accessible."
},
"drop": {
"first": "The robot drops the key it is holding.",
"detailed-first": "This action allows the robot to place a held key down at its current location, freeing its gripper for another key."
}
}
}
{
"overall": {
"first": "The Grid domain models a robot navigating between connected locations while collecting keys to unlock locked areas.",
"detailed-first": "This domain consists of a finite set of interconnected places. The robot can move between places if they are connected, pick up keys, and unlock locked locations whose locks match the shape of the key it carries. The robot starts at one location and must reach a goal location, possibly requiring it to collect and use keys along the way to unlock passages."
},
"predicates": {
"at-robot": {
"first": "The robot is at a specific place.",
"detailed-first": "Indicates the robot’s current position within the grid. At any time, the robot can be located at exactly one place."
},
"at": {
"first": "A key is at a specific place.",
"detailed-first": "Represents that a key is lying at a certain location within the grid. The robot can move to this place to pick up the key."
},
"conn": {
"first": "Two places are connected.",
"detailed-first": "Defines a bidirectional connection between two places, meaning the robot can move directly between them if no lock blocks the way."
},
"locked": {
"first": "A place is locked.",
"detailed-first": "Marks a place as locked, preventing the robot from entering until it is unlocked using a matching key."
},
"open": {
"first": "A place is open.",
"detailed-first": "Indicates that the place is unlocked and accessible for the robot to enter or move through."
},
"key-shape": {
"first": "A key has a particular shape.",
"detailed-first": "Each key is associated with a shape that determines which locks it can open. Only a key whose shape matches a lock’s shape can unlock that place."
},
"lock-shape": {
"first": "A place’s lock has a particular shape.",
"detailed-first": "Defines the shape of the lock associated with a specific place. The place can only be unlocked by a key with the same shape."
},
"holding": {
"first": "The robot is holding a key.",
"detailed-first": "Indicates that the robot is currently carrying a specific key. While holding a key, the robot cannot pick up another one unless it drops the current one."
},
"arm-empty": {
"first": "The robot is not holding anything.",
"detailed-first": "Shows that the robot’s gripper is empty and can pick up a new key."
}
},
"actions": {
"move": {
"first": "The robot moves from one place to another connected place.",
"detailed-first": "This action represents basic navigation in the grid. The robot can move between two connected places if the destination is open or has been unlocked. The effect is that the robot changes its position to the new place."
},
"pickup": {
"first": "The robot picks up a key.",
"detailed-first": "If the robot is at a place containing a key and its arm is empty, it can pick up that key. The effect is that the key is now held by the robot and no longer at the place."
},
"unlock": {
"first": "The robot unlocks a locked place using a key.",
"detailed-first": "If the robot is holding a key whose shape matches a locked place’s lock-shape, it can perform the unlock action. The effect is that the place becomes open and accessible."
},
"drop": {
"first": "The robot drops the key it is holding.",
"detailed-first": "This action allows the robot to place a held key down at its current location, freeing its gripper for another key."
}
}
}
66 changes: 33 additions & 33 deletions data/domains/keygrid/problem_example_human.pddl
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
(define (problem simple-grid-problem)
(:domain keygrid)
(:objects
place1 place2 - place
key1 - key
square - shape
)
(:init
;; connectivity
(conn place1 place2)
;; shapes
(shape square)
(key-shape key1 square)
(lock-shape place2 square)
;; initial states
(at-robot place1)
(at key1 place1)
(locked place2)
(arm-empty)
;; by default, place1 is open
(open place1)
)
(:goal
(at-robot place2)
)
(define (problem simple-grid-problem)
(:domain keygrid)

(:objects
place1 place2 - place
key1 - key
square - shape
)

(:init

;; connectivity
(conn place1 place2)

;; shapes
(shape square)
(key-shape key1 square)
(lock-shape place2 square)

;; initial states
(at-robot place1)
(at key1 place1)
(locked place2)
(arm-empty)

;; by default, place1 is open
(open place1)

)

(:goal
(at-robot place2)
)
)
6 changes: 1 addition & 5 deletions data/domains/pacman-63/ground.pddl
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,22 @@
(:predicates
(has_food ?location - node)
(no_food ?location - node)
(is_safe ?location - node) ; complement of is_opponent_ghost
(is_safe ?location - node) ; No ghosts present
(is_visited ?location - node)
(at ?location - node)
(not_at ?location - node)
(connected ?n1 ?n2 - node)
)

(:action move_pacman
:parameters (?start ?end - node)
:precondition (and
(at ?start)
(not_at ?end)
(no_food ?end)
(connected ?start ?end)
(is_safe ?end)
)
:effect (and
(at ?end)
(not_at ?start)
(is_visited ?end)
)
)
Expand All @@ -38,7 +35,6 @@
)
:effect (and
(at ?end)
(not_at ?start)
(no_food ?end)
(is_visited ?end)
)
Expand Down
6 changes: 1 addition & 5 deletions data/domains/pacman-63/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@
},
"at": {
"first": "Pacman is currently at a node.",
"detailed-first": "Shows Pacman’s current position in the environment."
},
"not_at": {
"first": "Pacman is not at this node.",
"detailed-first": "Indicates that Pacman is not currently at the node."
"detailed-first": "Shows Pacman's current position in the environment."
},
"connected": {
"first": "Two nodes are connected.",
Expand Down
4 changes: 1 addition & 3 deletions nl3pddl/problem_generators/pacman_63.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,10 @@ def generate_pacman_63_problem(n, output_file, seed=None):
# Initial state
problem += " (:init\n"

# Pacman's position
# Pacman's starting position
for node in nodes:
if node == start_node:
problem += f" (at {node})\n"
else:
problem += f" (not_at {node})\n"

# Food distribution
for node in nodes:
Expand Down
Loading