aig-upf / tarski

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

Added option for removing the object types when writing to file #144

Open Martin36 opened 10 months ago

Martin36 commented 10 months ago

Fixes issue #142

Also provided an example notebook of how to use the new feature and how to write to a PDDL file

Martin36 commented 10 months ago

Hi @Martin36,

thank you for the PR. I have changed the target branch of your PR from aig-upf:master to aig-upf:dev-0.9.0, which I have created to stage changes for the next release.

I have no objection to the implementation. Before I can accept this PR though, it would be necessary to amend the PR adding the following:

  • Check that no sorts have been defined for the FirstOrderLanguage instance being used as the domain theory. Otherwise, potentially important information would be lost.
  • If there are sorts defined, raise an exception to alert the user that sort information is going to be lost.

Not necessary but more of a suggestion is the following feature:

  • External to the writer, it could be useful to add a new submodule to tarski.transform that transforms a FirstOrderLanguage instance with sorts defined that are subsets of Object into a semantically equivalent FirstOrderLanguage instance where for each user-defined sort, there is a unary predicate for it. For instance, if we have the sort Foo in instance A, then we have the predicate Foo⊂Object in instance B.

Done

Martin36 commented 6 months ago

@miquelramirez Is there still something missing from the PR, or is it ready to be merged?

miquelramirez commented 6 months ago

Apologies @Martin36 I somehow missed the notification for your response to my last message. Will look into the latest amendments later today.

miquelramirez commented 6 months ago

Apologies @Martin36 I somehow missed the notification for your response to my last message. Will look into the latest amendments later today.

Actually, checking this on my desktop and not my mobile phone and I see that I did not miss any messages. There are review messages are pending. Thanks.