Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Addition of Multi-Agent PDDL to ANTLR v4 #4034

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
05cd15e
add ma-pddl
refracc Mar 29, 2024
dd4c749
update script
refracc Mar 29, 2024
97d941e
Merge pull request #1 from antlr/master
refracc Apr 3, 2024
f8e92e3
Merge remote-tracking branch 'origin/master' into mapddl
refracc Apr 3, 2024
92a12a0
format Pddl.g4
refracc Apr 3, 2024
9df768b
Add multi-agent examples
refracc Apr 3, 2024
00e1ef3
remove unnecessary text files
refracc Apr 3, 2024
d4eba75
Add example domains
refracc Apr 3, 2024
fb4e1c4
remove parse trees
refracc Apr 3, 2024
9c04ca0
update comment in pddl parser file
refracc Apr 3, 2024
e0f8d00
re-format for sanity
refracc Apr 3, 2024
0d3a0ac
remove auxilliary PDDL files from testing parser
refracc Apr 3, 2024
6071d82
Separate into single agent and multi-agent acceptable grammars
refracc Apr 4, 2024
8e2fa28
re-format files
refracc Apr 4, 2024
4006f66
PDDL updated to work with one file instead of two (assuming my tests …
refracc Apr 5, 2024
8d78b0a
Merge branch 'antlr:master' into master
refracc Apr 30, 2024
965315c
add ma-pddl
refracc Mar 29, 2024
0eef201
update script
refracc Mar 29, 2024
e0157c2
format Pddl.g4
refracc Apr 3, 2024
9bc280c
Add multi-agent examples
refracc Apr 3, 2024
6748d0e
remove unnecessary text files
refracc Apr 3, 2024
9879619
Add example domains
refracc Apr 3, 2024
8fc3609
remove parse trees
refracc Apr 3, 2024
faee6a6
update comment in pddl parser file
refracc Apr 3, 2024
f38e424
re-format for sanity
refracc Apr 3, 2024
6c3c9ea
remove auxilliary PDDL files from testing parser
refracc Apr 3, 2024
cadd6ef
Separate into single agent and multi-agent acceptable grammars
refracc Apr 4, 2024
0c8c24e
re-format files
refracc Apr 4, 2024
e29842e
PDDL updated to work with one file instead of two (assuming my tests …
refracc Apr 5, 2024
a818cf5
Merge branch 'mapddl' of github.com:refracc/grammars-v4 into mapddl
refracc Apr 30, 2024
8a7898a
resolved errors w/ total-time (should've been total-cost)
refracc Apr 30, 2024
64e55aa
move files into parent dir
refracc Apr 30, 2024
079e61a
fix wireless domain
refracc Apr 30, 2024
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
595 changes: 595 additions & 0 deletions pddl/MultiAgentPDDL.g4

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pddl/Pddl.g4 → pddl/SingleAgentPDDL.g4
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// $antlr-format alignTrailingComments true, columnLimit 150, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments false, useTab false
// $antlr-format allowShortRulesOnASingleLine false, allowShortBlocksOnASingleLine true, alignSemicolons hanging, alignColons hanging

grammar Pddl;
grammar SingleAgentPDDL;

/************* Start of grammar *******************/
pddlDoc
Expand Down
82 changes: 82 additions & 0 deletions pddl/multi-agent-examples/blocksworld/domain.pddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
(define (domain blocks)
(:requirements :typing :multi-agent :unfactored-privacy)
(:types
agent block - object
)
(:predicates
(on ?x - block ?y - block)
(ontable ?x - block)
(clear ?x - block)

(:private ?agent - agent
(holding ?agent - agent ?x - block)
(handempty ?agent - agent)
)
)

(:action pick-up
:agent ?a - agent
:parameters (?x - block)
:precondition (and
(clear ?x)
(ontable ?x)
(handempty ?a)
)
:effect (and
(not (ontable ?x))
(not (clear ?x))
(not (handempty ?a))
(holding ?a ?x)
)
)


(:action put-down
:agent ?a - agent
:parameters (?x - block)
:precondition
(holding ?a ?x)
:effect (and
(not (holding ?a ?x))
(clear ?x)
(handempty ?a)
(ontable ?x)
)
)


(:action stack
:agent ?a - agent
:parameters (?x - block ?y - block)
:precondition (and
(holding ?a ?x)
(clear ?y)
)
:effect (and
(not (holding ?a ?x))
(not (clear ?y))
(clear ?x)
(handempty ?a)
(on ?x ?y)
)
)


(:action unstack
:agent ?a - agent
:parameters (?x - block ?y - block)
:precondition (and
(on ?x ?y)
(clear ?x)
(handempty ?a)
)
:effect (and
(holding ?a ?x)
(clear ?y)
(not (clear ?x))
(not (handempty ?a))
(not (on ?x ?y))
)
)

)
80 changes: 80 additions & 0 deletions pddl/multi-agent-examples/blocksworld/probBLOCKS-16-1.pddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
(define (problem BLOCKS-4-0) (:domain blocks)
(:objects
a - block
c - block
b - block
e - block
d - block
g - block
f - block
i - block
h - block
k - block
j - block
m - block
l - block
o - block
n - block
p - block

(:private a1
a1 - agent
)

(:private a2
a2 - agent
)

(:private a3
a3 - agent
)

(:private a4
a4 - agent
)
)
(:init
(handempty a1)
(handempty a2)
(handempty a3)
(handempty a4)
(clear f)
(clear h)
(clear o)
(ontable a)
(ontable e)
(ontable g)
(on f l)
(on l m)
(on m j)
(on j p)
(on p n)
(on n i)
(on i b)
(on b d)
(on d c)
(on c k)
(on k a)
(on h e)
(on o g)
)
(:goal
(and
(on d b)
(on b p)
(on p f)
(on f g)
(on g k)
(on k i)
(on i l)
(on l j)
(on j h)
(on h a)
(on a n)
(on n e)
(on e m)
(on m c)
(on c o)
)
)
)
45 changes: 45 additions & 0 deletions pddl/multi-agent-examples/blocksworld/probBLOCKS-4-0.pddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
(define (problem BLOCKS-4-0) (:domain blocks)
(:objects
a - block
c - block
b - block
d - block

(:private a1
a1 - agent
)

(:private a2
a2 - agent
)

(:private a3
a3 - agent
)

(:private a4
a4 - agent
)
)
(:init
(handempty a1)
(handempty a2)
(handempty a3)
(handempty a4)
(clear c)
(clear a)
(clear b)
(clear d)
(ontable c)
(ontable a)
(ontable b)
(ontable d)
)
(:goal
(and
(on d c)
(on c b)
(on b a)
)
)
)
111 changes: 111 additions & 0 deletions pddl/multi-agent-examples/depot/domain.pddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
(define (domain depot)
(:requirements :typing :multi-agent :unfactored-privacy)
(:types
place locatable driver - object
depot distributor - place
truck hoist surface - locatable
pallet crate - surface
)
(:predicates
(at ?x - locatable ?y - place)
(on ?x - crate ?y - surface)
(in ?x - crate ?y - truck)
(clear ?x - surface)

(:private ?agent - place
(lifting ?agent - place ?x - hoist ?y - crate)
(available ?agent - place ?x - hoist)
)

(:private ?agent - driver
(driving ?agent - driver ?t - truck)
)

)

(:action drive
:agent ?a - driver
:parameters (?x - truck ?y - place ?z - place)
:precondition
(and (at ?x ?y) (driving ?a ?x))
:effect (and
(at ?x ?z)
(not (at ?x ?y))
)
)


(:action lift
:agent ?p - place
:parameters (?x - hoist ?y - crate ?z - surface)
:precondition (and
(at ?x ?p)
(available ?p ?x)
(at ?y ?p)
(on ?y ?z)
(clear ?y)
)
:effect (and
(lifting ?p ?x ?y)
(clear ?z)
(not (at ?y ?p))
(not (clear ?y))
(not (available ?p ?x))
(not (on ?y ?z))
)
)


(:action drop
:agent ?p - place
:parameters (?x - hoist ?y - crate ?z - surface)
:precondition (and
(at ?x ?p)
(at ?z ?p)
(clear ?z)
(lifting ?p ?x ?y)
)
:effect (and
(available ?p ?x)
(at ?y ?p)
(clear ?y)
(on ?y ?z)
(not (lifting ?p ?x ?y))
(not (clear ?z))
)
)


(:action load
:agent ?p - place
:parameters (?x - hoist ?y - crate ?z - truck)
:precondition (and
(at ?x ?p)
(at ?z ?p)
(lifting ?p ?x ?y)
)
:effect (and
(in ?y ?z)
(available ?p ?x)
(not (lifting ?p ?x ?y))
)
)


(:action unload
:agent ?p - place
:parameters (?x - hoist ?y - crate ?z - truck)
:precondition (and
(at ?x ?p)
(at ?z ?p)
(available ?p ?x)
(in ?y ?z)
)
:effect (and
(lifting ?p ?x ?y)
(not (in ?y ?z))
(not (available ?p ?x))
)
)

)
62 changes: 62 additions & 0 deletions pddl/multi-agent-examples/depot/pfile1.pddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
(define (problem depotprob1818) (:domain depot)
(:objects
truck1 - truck
truck0 - truck
depot0 - depot
crate1 - crate
crate0 - crate
pallet1 - pallet
pallet0 - pallet
pallet2 - pallet
distributor1 - distributor
distributor0 - distributor

(:private depot0
hoist0 - hoist
)

(:private distributor0
hoist1 - hoist
)

(:private distributor1
hoist2 - hoist
)

(:private driver1
driver1 - driver
)

(:private driver0
driver0 - driver
)
)
(:init
(driving driver0 truck0)
(driving driver1 truck1)
(at pallet0 depot0)
(clear crate1)
(at pallet1 distributor0)
(clear crate0)
(at pallet2 distributor1)
(clear pallet2)
(at truck0 distributor1)
(at truck1 depot0)
(at hoist0 depot0)
(available depot0 hoist0)
(at hoist1 distributor0)
(available distributor0 hoist1)
(at hoist2 distributor1)
(available distributor1 hoist2)
(at crate0 distributor0)
(on crate0 pallet1)
(at crate1 depot0)
(on crate1 pallet0)
)
(:goal
(and
(on crate0 pallet2)
(on crate1 pallet1)
)
)
)
Loading