aig-upf / fs-private

This is the private version of the FS planner repository
GNU General Public License v3.0
5 stars 1 forks source link

Expose the gringo parser in a cleaner manner #22

Closed gfrances closed 4 years ago

gfrances commented 7 years ago

The (as of now, optional) use of the ASP-based parser by the frontend should be slightly refactored so that:

miquelramirez commented 7 years ago

Let me go over each of the points above:

  1. CLINGO & GRINGO - Certainly, the flag name needs to change... that was the first name it occurred to me, which I admit isn't the best. Regarding installation, I'd suggest to use an environment variable to specify the basepath of the gringo executable. It is agnostic w.r.t. to whether people are using package, build from sources or even platform.

  2. Generalising the grounding to FSTRIPS sounds to me as a worthy thing to do... Nevertheless, determining reachability of an atomic formula like x(o) > lb() \& x(o) < ub is something that I think the ASP guys haven't really looked into yet, and kind of falls outside of what ASP can realistically do. Maybe we can do some sort of static analysis, limited over the numeric/functional effects so we can have atoms like reachable( x(o) > lb() \& x(o) < ub ) to denote that the atomic formula is potentially achievable from s0. But that is going to be very weak, very often, unless there is an interesting interplay between numeric action effects and logical preconditions (e.g. a non trivial atomic formula over a predicative state variable appears in the precondition of an action that decreases the value of x(o), allowing to bring its value within the bounds).

  3. Getting rid of FD would be a very good thing, we don't really need it anymore... besides the data structures that we use of the "AST". Note as well that there's a third parser, my extensions to numerics and hybrid domains based on ANTLR. Maybe the best solution to have the parsers as modules of the front end. I know Anders' parser... and well, I think it is a mistake to do the parsing in C++, type safety gets in the way of processing the syntax tree... Python, C# etc. all have native implementations of libraries that allow for fast lexical and structural analysis anyways.

gfrances commented 7 years ago

Point 1 is implemented in commits fe92fa6587b5924ce66bbd8269679f72e7f63b1a and 1d55fea32d3fba63a8902184b391e477690d49fa

gfrances commented 4 years ago

This is almost all solved by now with the new Tarski frontend. The point about reachability analysis for FSTRIPS problems now belongs to Tarski as well: https://github.com/aig-upf/tarski/issues/85