potassco / clorm

🗃️ A Python ORM-like interface for the Clingo Answer Set Programming (ASP) reasoner
https://clorm.readthedocs.io
MIT License
52 stars 5 forks source link

DEC #110

Closed MorphSeur closed 2 years ago

MorphSeur commented 2 years ago

Dear developers,

May I ask if there is the translation of discrete event calculus axioms that can be used with Clorm?

Thanks,

daveraja commented 2 years ago

Can you please provide more information? Otherwise I don't see the connection between Discrete Event Calculus (DEC) axioms and clorm.

I've seen a few different syntactic representations for DEC so I'm not sure which version you are referring to. But it sounds like you are looking for a converter from (some version of) DEC to ASP. If that is the question, I am not aware of any such a converter; but I have not looked into DEC enough to say anything for certain.

MorphSeur commented 2 years ago

Thanks for your reply.

DEC is converted to ASP (http://[decreasoner.sourceforge.net/csr/ecasp/dec.lp](http://decreasoner.sourceforge.net/csr/ecasp/dec.lp)).

As you know, Clingo supports multiple .lp domain definitions as inputs. How it is with Clorm? The goal is to exploit Clorm to perform dynamic changes on the .lp files.

daveraja commented 2 years ago

Sorry, but I still don't fully understand what you are trying to do. Perhaps you can provide a detailed example of exactly what you are trying to achieve.

Also, there may be some misunderstanding about the role of Clorm. Clorm sits on top of the Clingo Python API and makes it easier to work with ground facts. However, it doesn't deal with general ASP rules. So if you have a meta-encoding where the DEC axioms are encoded as ground ASP facts then Clorm might be able to help, but if you are trying to dynamically generate general ASP rules then Clorm won't be of any use.

BTW. Since (to me) this sounds like a more general ASP/Clingo question than a specific Clorm question, you might have better luck asking this question on the potassco-users mailing list (https://sourceforge.net/projects/potassco/lists/potassco-users).

MorphSeur commented 2 years ago

Thanks for you reply.

As I am not familiar with Clorm, I will try to explain. The goal is to perform ASP-based reasoning which exploit .lp files that change dynamically.

Traditionally, I am using .lp files with Clingo. But how it can be if we can change .lp files during the reasoning. The only solution for the moment (to the best of my knowledge) is to change manually the facts.

Regarding the DEC axioms, they are static and reasoning lies on it. There is no need to perform any action on them if they can be exploited by Clorm as Clingo. As an example with Clingo: "$ clingo -n 0 dec.lp example.lp".

Many thanks,

daveraja commented 2 years ago

Your explanation of dynamically changing an .lp file doesn't make much sense. Clingo isn't monitoring for changes to files and doesn't restart the solver when an input file changes.

So, assuming that you simply mean that you want to generate an input fact file dynamically and you will then manually restart the clingo executable, then yes Clorm can generate a string version of a set of facts (see FactBase.asp_str()) that can then be written to file.

If you want to do something like dynamically interacting with the solver then you need to understand how the Clingo API works before looking at Clorm.

MorphSeur commented 2 years ago

Thanks for your reply.

I understood how Clingo works. I have been using it for a long time.

That is what I am looking for "So, assuming that you simply mean that you want to generate an input fact file dynamically and you will then manually restart the clingo executable, then yes Clorm can generate a string version of a set of facts (see FactBase.asp_str()) that can then be written to file.".

Thanks,

daveraja commented 2 years ago

Good to hear this answered your question. I'll close the issue.