prost-planner / prost

probabilistic planning system for tasks encoded in RDDL
MIT License
37 stars 17 forks source link

Revise the implementation of logical expressions #48

Open thomaskeller79 opened 7 years ago

thomaskeller79 commented 7 years ago

Original report by geisserf (Bitbucket: 557058:e7a9f9a5-3ea8-4154-97d2-10446425dce3, GitHub: geisserf).


Our current implementation of logical expressions and related functions has three major disadvantages:

A new implementation should consider all three points.

thomaskeller79 commented 7 years ago

Original comment by geisserf (Bitbucket: 557058:e7a9f9a5-3ea8-4154-97d2-10446425dce3, GitHub: geisserf).


I've already done some research on other implementations of domain-specific languages (DSL). [1] and [2] considers the visitor pattern. Another popular framework is the Boost Proto Library. However, I'm currently investigating Catamorphisms; they have the advantage that they are an algebraic sound tool to evaluate functions and are powerful enough to support arbitrary methods applied on expressions. Eric Niebler (the author of the Proto library) considered them one time for Proto and they are a popular tool in Haskell. I'm currently investigating the C++ approach, how easy it is to implement, and if it suits our requirements.

geisserf commented 4 years ago

We will try out whether we can replace the LogicalExpression class with the expression library exprtk. This could potentially allow us to get rid of the caching of evaluatables alltogether, since it is possible that the expression evaluation of the library is fast enough to not warrant caching anymore.

geisserf commented 4 years ago

I mentioned that it might be possible that the evaluations can not be generated dynamically and instead have to be known at compile time. I think this example shows that this is wrong. Here, the program allows a user to input an expression which is then evaluated. The variables in the example are pre-specified, but from my read of the manual that is not necessary.

speckdavid commented 4 years ago

Here, is a profiling example (#108): ./search-profil earth-observation_inst_mdp__01 "[Prost -s 1 -se [THTS -act [UCB1] -out [UMC] -backup [PB] -init [Expand -h [IDS]]]]"

profile001