-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
base: master
Are you sure you want to change the base?
Conversation
pddl/Pddl.g4
Outdated
: (domain | problem) EOF | ||
; | ||
|
||
pddlDoc : domain | problem; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All Antlr4 grammars need an EOF-terminated start rule. Add EOF back in so the tester can find the rule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
There is not a single test file for this grammar. I went to http://www.plg.inf.uc3m.es/ipc2011-deterministic/Resources , downloaded the .bz2 file (http://www.plg.inf.uc3m.es/ipc2011-deterministic/attachments/Resources/ipc2008-no-cybersec.tar.bz2), extracted the demos, and tried every single .pddl file. Some parsed (about 30 files in It's time to try to get this grammar up to a basic level of usability that people expect. Currently, I'm not sure how usable it is. |
pddl/Pddl.g4
Outdated
// $antlr-format alignTrailingComments true, columnLimit 150, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments false, useTab false | ||
// $antlr-format allowShortRulesOnASingleLine false, allowShortBlocksOnASingleLine true, alignSemicolons hanging, alignColons hanging | ||
// $antlr-format alignTrailingComments true, columnLimit 150, minEmptyLines 1, maxEmptyLinesToKeep 1, reflowComments false, useTab false | ||
// $antlr-format allowShortRulesOnASingleLine false, allowShortBlocksOnASingleLine true, alignSemicolons hanging, alignColons hanging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why these formatting rules were changed. Please go to https://github.com/mike-lischke/antlr-format/blob/main/cli/ReadMe.md and install the antlr-formatter. Then, reformat this grammar antlr-format *.g4
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The formatting rules weren't changed - they just moved down ~15 lines?
Apologies for not formatting, I've now formatted the file.
If it's not a problem, could you "fast forward" the branch for this PR with the current "master" branch in https://github.com/antlr/grammars-v4.git ?? It'll help me see how my new "perf" scripts handle your PR. Thanks! |
Considering that there were no prior instances provided alongside the PDDL parser or its application to domains (i.e., their specification), I am perplexed as to why - particularly in light of the lack of examples initially presented in the folder - this seems to have become an apparent issue. Could you kindly clarify why the previous author was not prompted to include examples, or why none were included here initially? I have taken the liberty of incorporating examples of the contrived "single-agent" problems, along with the contrived "multi-agent" domains that this file can parse, and they do align with some aspects of the Kovacs implementation. As articulated in my comment within the parser file itself, further refinement is necessary to bring it up to par with this standard. Nevertheless, this should serve as a commendable starting point towards achieving that objective. Furthermore, the branch has been fast-forwarded to accommodate your new scripts. |
@teverett added the grammar 9 years ago, probably as a task of translating the grammar from Antlr3 into Antlr4. But, he didn't have any sample input. I added the desc.xml last year in order to support testing of all targets, but again, I punted on finding any tests because I really don't have expertise in the language.
Ty, Ty, Ty!! |
pddl/MultiAgentPDDL.g4
Outdated
; | ||
|
||
objectDeclaration | ||
: objectName '-' objectType |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change to objectName+
. See http://www.plg.inf.uc3m.es/ipc2011-deterministic/attachments/Resources/kovacs-pddl-3.1-2011.pdf , specifically the rule <function typed list (x)> ::= x+ - <function type> <function typed list(x)>
. Notice the "+" for "x", where it is used in rule <object declaration> ::= (:objects <typed list (name)>)
. Some of the tests don't parse without this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A single character escaped me - apologies. Resolved!
Please change desc.xml to this so we can test both grammars.
|
All files should now parse under the one grammar file. See my latest commit. I've updated the test in desc.xml to reflect that. |
Yes, better. Looks like still a few problems.
|
Still parses standard PDDL files, as well as new MA-PDDL files (which are almost up to the full specification of Kovacs, 2012).