whitemech / plan4past Goto Github PK
View Code? Open in Web Editor NEWClassical and FOND Planning for Pure-Past Linear Temporal Logic Goals
License: GNU Lesser General Public License v3.0
Classical and FOND Planning for Pure-Past Linear Temporal Logic Goals
License: GNU Lesser General Public License v3.0
The formula O(end) & ~((~(hasDoneD)) S ((hasDoneE) & (~(hasDoneD))))
is not enforced in the actual plan. The first part of the formula is a reachability goal (i.e., reach the end), the second part of the formula intuitively says "whenever hasDoneE happens, hasDoneD has to happen eventually afterwards", which matches the DECLARE Response(hasDoneE, hasDoneD) template.
A minimal reproducible example is:
from pathlib import Path
from pddl.formatter import domain_to_string, problem_to_string
from pddl.parser.domain import DomainParser
from pddl.parser.problem import ProblemParser
from pylogics.parsers import parse_pltl
from plan4past.compiler import Compiler
goal = "O(end) & ~((~(hasDoneD)) S ((hasDoneE) & (~(hasDoneD))))"
domain_parser = DomainParser()
problem_parser = ProblemParser()
domain = domain_parser(Path("domain.pddl").read_text(encoding="utf-8"))
problem = problem_parser(Path("problem.pddl").read_text(encoding="utf-8"))
formula = parse_pltl(goal)
compiler = Compiler(domain, problem, formula)
compiler.compile()
compiled_domain, compiled_problem = compiler.result
try:
with open("./new-domain.pddl", "w+", encoding="utf-8") as d:
d.write(domain_to_string(compiled_domain))
with open("./new-problem.pddl", "w+", encoding="utf-8") as p:
p.write(problem_to_string(compiled_problem))
except Exception as e:
raise IOError(
"Something wrong occurred while writing the compiled domain and problem."
) from e
with the following minimal domain.pddl and the problem.pddl.
The expected plan would be:
Add status badges and logo to the README
For ICAPS23, we still need the following:
Currently, the goal formula can only be specified as a string in the CLI tool and the library.
We would like to have a more general and flexible approach. In particular, the following additional options have been identified:
(:goal ...
specification in PDDL.An example of the second case is (:goal (once (and a b)))
that corresponds to O(a & b)
Parsing the compiled domain with pddl throws an error. In particular, the error is on action effects. The compilation produces the following formula.
(and (and <previous effects>) (when ... ....) (when ... ....) ...
The double (and (and ...))
is not allowed by the pddl
grammar.
Some optimizations could be implemented to get plan4past work faster.
O(a)
becomes true, then it can not be falsified in the future. This implies that the conditional effect \neg ppnf(O(a)) -> \neg "Y(O(a))
is redundant and not needed.The function "predicates" of predicates visitor creates superfluous quoted "Y()" atoms.
for example, the compilation of formula "O(a & Y(O(b & Y(O(c)))))" should yield the atoms:
Instead, the function predicates(O(a & Y(O(b & Y(O(c)))))) returns:
This issue will be solved in the branch fix/pddl-predicates-collision
If we compile multiple times with different goals, the val
predicates are considered as normal predicates because of the _
presence.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.