- Notifications
You must be signed in to change notification settings - Fork3
Classical and FOND Planning for Pure-Past Linear Temporal Logic Goals
License
whitemech/Plan4Past
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
An award-winning tool for Classical and FOND Planning for Pure-Past Linear Temporal Logic (PPLTL) Goals.
- from PyPI:
pip install plan4past- from source (
mainbranch):
pip install git+https://github.com/whitemech/Plan4Past.gitor, clone the repository and install:
git clone https://github.com/whitemech/Plan4Past.gitcd Plan4Pastpip install .You can use theplan4past package in two ways: as a library, and as a CLI tool.
This is an example of how you can encode a PPLTL goal formula into a PDDL domain and problem programmatically.
frompathlibimportPathfrompddl.formatterimportdomain_to_string,problem_to_stringfrompddl.parser.domainimportDomainParserfrompddl.parser.problemimportProblemParserfrompylogics.parsersimportparse_pltlfromplan4past.compilerimportCompilerdomain_path=Path("tests/benchmarks/deterministic/BF/blocksworld_ppltl/domain.pddl")problem_path=Path("tests/benchmarks/deterministic/BF/blocksworld_ppltl/p2.pddl")formula="on_b_a & O(ontable_c)"domain_parser=DomainParser()problem_parser=ProblemParser()domain=domain_parser(domain_path.read_text(encoding="utf-8"))problem=problem_parser(problem_path.read_text(encoding="utf-8"))goal=parse_pltl(formula)compiler=Compiler(domain,problem,goal)compiler.compile()compiled_domain,compiled_problem=compiler.resulttry:withopen("./new-domain.pddl","w+",encoding="utf-8")asd:d.write(domain_to_string(compiled_domain))withopen("./new-problem.pddl","w+",encoding="utf-8")asp:p.write(problem_to_string(compiled_problem))exceptExceptionase:raiseIOError("[ERROR]: Something wrong occurred while writing the compiled domain and problem." )frome
By executing the code above, you will obtain anew-domain.pddl as well as anew-problem.pddl in output.
The package can also be used as a CLI tool. The supported command is:
plan4past -d DOMAIN_FILE -p PROBLEM_FILE -g "PPLTL_FORMULA" [-m MAPPING]whereDOMAIN_FILE andPROBLEM_FILE are the PDDL domain and problem files, respectively, andPPLTL_FORMULA is thegoal formula expressed in Pure-Past Linear Temporal Logic.The optionalMAPPING file is a mapping between the PDDL objects and the PPLTL formula's atomic propositions.
For instance:
plan4past -d examples/pddl/domain.pddl -p examples/pddl/p-0.pddl -g "ontable_c & O(on_b_a)"A Docker image as well as an Apptainer image are available for Plan4Past.
To use Docker:
docker build -t plan4past .anddocker run --rm -it plan4pastTo use Apptainer:
apptainer build plan4past.sif plan4past.def# to launch the tool:./plan4past.sif -d examples/pddl/domain.pddl -p examples/pddl/p-0.pddl -g "ontable_c & O(on_b_a)"If you want to contribute, set up your development environment as follows:
- IntallPoetry
- Clone the repository:
git clone https://github.com/whitemech/Plan4Past.git && cd Plan4Past - Install the dependencies:
poetry shell && poetry install
To build the docs:mkdocs build
To view documentation in a browser:mkdocs serveand then go tohttp://localhost:8000
Plan4Past is released under the GNU Lesser General Public License v3.0 or later (LGPLv3+).
Copyright 2021 -- 2023 WhiteMech
If you use Plan4Past in your research, please consider citing the following papers.
- For deterministic (classical) planning:
@inproceedings{icaps2023bdffgs, author = {Luigi Bonassi and Giuseppe {De Giacomo} and Marco Favorito and Francesco Fuggitti and {Alfonso Emilio} Gerevini and Enrico Scala}, title = {{Planning for Temporally Extended Goals in Pure-Past Linear Temporal Logic}}, booktitle = {{ICAPS}}, pages = {61--69}, publisher = {{AAAI} Press}, year = {2023}}- For non-deterministic (FOND) planning:
@inproceedings{ecai2023bdffgs, author = {Luigi Bonassi and Giuseppe {De Giacomo} and Marco Favorito and Francesco Fuggitti and {Alfonso Emilio} Gerevini and Enrico Scala}, title = {{{FOND} Planning for Pure-Past Linear Temporal Logic Goals}}, booktitle = {{ECAI}}, year = {2023},}Plan4Past has been awarded theBest Student Paper Award at ICAPS 2023.
Plan4Past has been partially supported by the EU H2020 project AIPlan4EU (No. 101016442), the ERC-ADG WhiteMech(No. 834228), the EU ICT-48 2020 project TAILOR (No. 952215), the PRIN project RIPER (No. 20203FFYLK), and the PNRR MURproject FAIR (No. PE0000013).
About
Classical and FOND Planning for Pure-Past Linear Temporal Logic Goals
Topics
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors3
Uh oh!
There was an error while loading.Please reload this page.
