-
Notifications
You must be signed in to change notification settings - Fork 10
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
Grounding order calculation fails at recursive rule using external atoms #286
Comments
Note that this problem also exists in #263. (I had the hope it might have resolved itself due to the new arithmetic term rewritings...) |
I think this is a case of "works as intended" and has nothing to do with external atoms. If I am not mistaken, then the rule In order to bind Now we could of course consider whether the solver should be clever here and figure out that |
oops.. yeah, I took the solver for cleverer than it's supposed to be 😅 Should we just close this issue or re-label to potential enhancement along the lines of "figure out (simple) equations with unique integer solutions"? (I think closing it might be the more reasonable thing to do...) Edit: Even though this is probably a bit of effort, should we think about better error messages here? |
Well, with Clingo one can do rules like This is also not the first time, such an idea comes up, so it is rather natural to expect it to work. On the other hand, however, it will then fail at some more complex arithmetic expression and it may be rather confusing why some expressions work and others do not. So, I think the cleaner way is to not do that expression reformulation. Ad error messages: yes, we need a well-done safety check in advance that prints good error messages. |
Input (external implementations at the bottom):
Alpha fails to find a grounding order for
R3
:I haven't debugged this any further due to lack of time, but it seems to me that this is a bug, especially because the following version of
R3
where only the last literalP_IDX = IDX - 1
is swapped forIDX = P_IDX + 1
works and gives the following (correct) answer set:On a quick try, I wasn't able to reproduce this in a simpler setting without externals, so I'd assume this to be related to the atom
&lst_idx_value[SEGS, IDX](STR)
where it seems thatIDX
cannot be bound.A working grounding order with starting literal
instr_segments(SEGS)
would be:Also, note that in this case
instr_ind(_, P_IDX)
would probably make more sense as a starting literal.I'll continue to investigate this.
External Atoms
The text was updated successfully, but these errors were encountered: