Git Product home page Git Product logo

gdaplanner's People

Contributors

fairlight1337 avatar mpomarlan avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

gdaplanner's Issues

World state accessible from Prolog predicates

We need new predicates to access the world state object from within Prolog. This includes:

(assert <some-fact>)
(retract <some-fact>)
(holds <some-fact>)

Where assert adds a new fact to the world, retract removes it, and holds checks whether the fact currently holds.

Also, we need predicates for accessing world categories: Init sequences for PDDL domain problem specifications, available action predicates, etc.

Loading files from other .plg files requires path relative to executable

When loading the GDA Prolog Standard Library, subsequent files loaded from those files require the same relative path (relative to the binary of the program loading the library).

prolog_tool loads the stdlib from ../data/lib/std/main.plg. In main.plg there needs to be this line to properly include math.plg residing in the same directory:

(load "../data/lib/std/math.plg")

Ideally, it would only require this:

(load "math.plg")

This can be done by cutting the original file's relative path from its filename, and appending the now-to-load file to that path.

(once ...) predicate missing

(once ...) would cut off all solutions after the first one (if any). This is applicable for situations in which only a truth value is required, for example >=:

(<- (>= ?a ?b)
  (or (> ?a ?b)
      (= ?a ?b)))

When resolving this, it yields two solutions if both, > and = are met, instead of only one expected. The final predicate would be used like this:

(<- (>= ?a ?b)
  (once (or (> ?a ?b)
            (= ?a ?b)))

Meaning of index is not defined consistently

The index vector in the Solution class has different meanings for different predicates (or facts), and will ultimately lead to problems when not consistently defined over all areas.

Mentioned here: #34

Recursion+backtracking doesn't work

Try the following:

prolog->addPredicate("(apred ?x ?y)",
"(= ?x ?y)",
"(member ?x (0 2))");
prolog->addPredicate("(apred ?x ?y)",
"(= ?x ?y)",
"(member ?x (1 3))");
prolog->addPredicate("(apred ?x)",
"(apred ?x 2)");

solPrior = prolog->query("(apred ?x)", solPrior);
if(solPrior.valid())
std::cout << "BINDINGS " << solPrior.bindings().toString() << "\n";
}

Expected output: binding of ?x = 2. Produced output: no bindings (no valid solution found). This doesn't change if we switch the order of the predicate additions like this, however:

prolog->addPredicate("(apred ?x ?y)",
"(= ?x ?y)",
"(member ?x (1 3))");
prolog->addPredicate("(apred ?x ?y)",
"(= ?x ?y)",
"(member ?x (0 2))");
prolog->addPredicate("(apred ?x)",
"(apred ?x 2)");

so it's probably a recursion issue.

The next call (essentially, an unwrapping of the branch of apred that should work):

solPrior = prolog->query("(and (= ?x 2) (member ?x (0 2)))", solPrior);
if(solPrior.valid())
std::cout << "BINDINGS " << solPrior.bindings().toString() << "\n";
}

produces the expected binding of ?x = 2

Typing is not used yet

Although present in the Action class and parsed by the PDDL parser, the type information of variables is not yet used. As pointed out in #34, this leads to a tremendously large search space for planners.

Ergo: Typing needs to be implemented into the Prolog class properly.

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.