aig-upf / tarski

Tarski - An AI Planning Modeling Framework
Apache License 2.0
59 stars 19 forks source link

Don't print `:numeric-fluents` on the PDDL writer if the only use of arithmetic is for cost function updates - use instead `:action-costs` #89

Closed gfrances closed 4 years ago

gfrances commented 4 years ago

@emilkeyder reports in Slack:

we talked a couple years back about a dumb situation I was running into with tarski where in order for the Real type to be added, the language needed Theory.ARITHMETIC , but if it was set, the numeric-fluents requirement would be set on the pddl domain (which meant that even if the reals etc. were being used only for action costs, fast downward would reject the domain)

Miquel merged this PR to allow Real to be used without Theory.ARITHMETIC : https://github.com/aig-upf/tarski/commit/78783266d40923e71e1b59e70d5bc95e870f7a40#diff-30988ec94582fa5f8275638c07bd7c5d

but this seems to have changed (I think) here: https://github.com/aig-upf/tarski/commit/59451af69c71e3b462c6c15b918b6b670caac1ff

so tarski will currently complain if you use language.Real without ARITHMETIC

is there a currently suggested way of allowing Real to be used without adding the numeric-fluents requirement to the output pddl?

This could be addressed by refining the conditions under which :numeric-fluents is printed: instead of printing it every time Theory.ARITHMETIC in problem.language.theories, we could e.g. do a bit more work and check which functions have some numeric sort. If it is only total-cost then there's no need to print that requirement; otherwise, we print it

gfrances commented 4 years ago

Test added for this, should be fixed now in devel branch.

emilkeyder-invitae commented 4 years ago

Thank you!