Code Monkey home page Code Monkey logo

plan4past's People

Contributors

francescofuggitti avatar lbonassi95 avatar marcofavorito avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

plan4past's Issues

Missing parts for ICAPS23

For ICAPS23, we still need the following:

  • A logo
  • Some tests
  • Complete the readme
  • Make the Dockerfile and the Apptainer file working
  • Include the benchmark dataset folder

Possible optimizations

Some optimizations could be implemented to get plan4past work faster.

  1. As the compiler works on the syntactic structure of the PPLTL formula, a preprocessing to simplify the input formula could improve the performances
  2. Simplify the model of actions and axioms by checking the monotonicity of formulas. For instance, when 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.

Output not parsed by the PDDL library

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.

Bug on compilation?

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:

  • b, c, e, d, goal

Additional ways of reading the goal formula

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:

  1. reading from a file
  2. reading directly from the (:goal ... specification in PDDL.

An example of the second case is (:goal (once (and a b))) that corresponds to O(a & b)

Generation of superfluous Y-atoms

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:

  • 'Y-Oa-and-YOb-and-YOc'
  • 'Y-Ob-and-YOc'
  • 'Y-Oc'

Instead, the function predicates(O(a & Y(O(b & Y(O(c)))))) returns:

  • 'Y-Oa-and-YOb-and-YOc'
  • 'Y-Ob-and-YOc'
  • 'Y-Oc'
  • 'YOc'
  • 'YOb-and-YOc'

This issue will be solved in the branch fix/pddl-predicates-collision

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.