Package: plan4past
Classical and FOND Planning for Pure-Past Linear Temporal Logic Goals.Installationfrom PyPI:pip install plan4pastfrom source (mainbranch):pip install git+https://github.com/whitemech/Plan4Past.gitor, clone the repository and install:git clone https://github.com/whitemech/Plan4Past.git
cd Plan4Past
pip install .QuickstartYou can use theplan4pastpackage in two ways: as a library, and as a CLI tool.As a libraryThis 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.compilerimportCompilerformula="on_b_a & O(ontable_c)"domain_parser=DomainParser()problem_parser=ProblemParser()domain=domain_parser(Path("examples/pddl/domain.pddl").read_text(encoding="utf-8"))problem=problem_parser(Path("examples/pddl/p-0.pddl").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.")fromeBy executing the code above, you will obtain anew-domain.pddlas well as anew-problem.pddlin output.As a CLI toolThe 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_FILEandPROBLEM_FILEare the PDDL domain and problem files, respectively, andPPLTL_FORMULAis the
goal formula expressed in Pure-Past Linear Temporal Logic.
The optionalMAPPINGfile 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)"Docker & Apptainer imagesA 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)"DevelopmentIf you want to contribute, set up your development environment as follows:IntallPoetryClone the repository:git clone https://github.com/whitemech/Plan4Past.git && cd Plan4PastInstall the dependencies:poetry shell && poetry installDocsTo build the docs:mkdocs buildTo view documentation in a browser:mkdocs serveand then go tohttp://localhost:8000LicensePlan4Past is released under the GNU Lesser General Public License v3.0 or later (LGPLv3+).Copyright 2021 -- 2023 WhiteMechCitingIf you use Plan4Past in your research, please consider citing the following paper:@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}},
  volume       = {33},
  url          = {https://ojs.aaai.org/index.php/ICAPS/article/view/27179},
  doi          = {10.1609/icaps.v33i1.27179},
  number       = {1},
  month        = {Jul.},
  pages        = {61-69},
  year         = {2023},
}AcknowledgementsPlan4Past 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 MUR
project FAIR (No. PE0000013).