A tool that, given as input the domain.pddl and problem.pddl files, generates the grounded translation of the problem
- Python version: 3.7 or higher
- Antlr4
- Antlr4 Python3 runtime target
- Click Python Library: Package for creating command line interfaces
-
pddl.g4 - The grammar file. It currently supports a simplified version of PDDL+.
For example domain.pddl problem-1.pddl. -
antlr4_directory - The folder generated by antlr4 using the pddl.g4 grammar with the command:
antlr4 -Dlanguage=python3 pddl.g4 -o antlr4_directory
-
grounder.py - The main module
-
Domain_parser.py - It contains the functions needed to traverse the parse-tree of the domain generated by the antlr4 parser and to represent the tree in JSON format.
For example domain.json. -
Problem_parser.py - It contains the functions needed to traverse the parse-tree of the problem generated by the antlr4 parser and to represent the tree in JSON format.
For example problem.json. -
Grounding.py - Contains functions for grounding actions, processes, and events of a domain represented in JSON, given a problem represented in JSON. The result is a JSON file.
For example Inputs: domain.json, problem.json Output: grounding_result.json -
Writer.py - Contains the function to write the grounded translation of the domain.pddl file
For example domain_grounded.pddl.
To run the script simply run the command above, where --domain
takes the name of the PDDL domain file and --problem
takes the name of the PDDL problem file. These files MUST be present in the PDDL_Files folder.
python grounder.py --domain domain.pddl --problem problem-1.pddl
If some changes to the grammar file pddl.g4 are needed, the new parser and lexer are generated with the command:
antlr4 -Dlanguage=python3 pddl.g4 -o antlr4_directory
- A grammar that supports more complex domains in PDDL 3 BUT in antlr3
- [PDDL documentation] (https://planning.wiki/)
- A simple PDDL+ domain and some problems
- Online Syntactic Tree Viewer: Very useful during the development phase to graphically visualize the tree generated by the antlr4 parser