-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call to Clingo::Control::symbolic_atoms() fails after replacing GroundProgramObserver? #19
Comments
You called the register_observer function with While I could remove the limitation regarding symbolic atoms, replacing the solver backend is probably not what you want anyway. Currently, it is not possible to remove a backend. This would require an additional function. Something like |
Roland, Thank you for your time and clear explanations! You are right, I just need to remove the observer backend! When multishot solving is used, the observer's functions are being called every time .solve() is called, while I only need to inspect the grounding once. The dependency graph which I build in the computation was, all of a sudden, growing bigger and bigger with more solve() calls :) I actually expected the observer's callbacks to be triggered when Clingo::Control::ground() method is called, while it seems to be triggered by the solve() calls. Actually, I am still curious what may possibly trigger the observer callbacks. I was somewhat confused by the error message, so I wanted to make sure the "switch" from clingo mode is intended. Now I see that it's not just a switch... Anyways, this is not a real issue, I can probably introduce a state in the ground program observer to make sure the graph is not built more than once. Best, |
Before a program is passed to the solver, some more rewriting is happening. This is why the observer is also called at the beginning of solving. From the API perspective this is of course ugly. Ideally, the observer should only be called during grounding. In practice, this should work for most observer methods except for |
Roland, Actually, I just found that the observer is only called at the beginning of solving. For this program:
no observer callbacks are called. Anyway, I have found some workarounds already, and, while it would be nice to improve the API, I am quite happy with the way things are. Thanks! |
Hello,
For some reason the following program:
crashes when reaching the second occurrence of
ctl.symbolic_atoms();
(So I don't see "OK2" printed)
The exception message is as follows:
domain introspection only supported in clingo mode
Is this an intended behavior?
Is there a way I can look at symbolic atoms after updating the observer?
Thanks!
The text was updated successfully, but these errors were encountered: