-
Notifications
You must be signed in to change notification settings - Fork 129
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
panic!
on recursive tabled relation
#2701
Comments
Maybe related: Rust thread panics on certain input #2423 |
Here's a minimal reproduction: :- use_module(library(tabling)).
:- use_module(library(lists)).
:- table blink_tabled/3.
blink_tabled(0, _, 1).
blink_tabled(N, X, Xs) :-
N > 0,
N1 is N - 1,
blink_tabled(N1, X, Xs).
bug(Xs) :-
member(X, [1, 2, 3, 4, 5]),
blink_tabled(7, X, Xs). The bug triggers when one types |
@adri326: Awesome test case, thank you a lot! It is not yet minimal (i.e., shortest possible) though, since using the following version of bug(Xs) :- member(X, [1, 2, 3, 4]), blink_tabled(7, X, Xs). |
You're right, I think one could also remove an argument or two to I've been investigating more, and I keep circling back on I'm stuck trying to figure out a fix to the issue, given that I couldn't find much documentation around the semantics of |
I experienced this error when solving today's Advent of Code, and I seem to be able to hit it consistently. I thought I might report it for future investigation.
The source file is here, only the second part is relevant. It basically is a recursive function that splits numbers and counts how many of those are when
N
reaches 0.In order to reproduce the panic I have to use my input file, yours will probably also trigger it, the sample doesn't trigger it. It is triggered every single time I run this query.
The text was updated successfully, but these errors were encountered: