Hi,
Thanks for this helpful library!
I seem to have found an instance where querying a top down database gives an incorrect answer.
Here's the program:
foo(a1, a3).
foo(a2, a3).
fooAlso(X, Y) :- foo(X, Y).
bar(a1, a2).
baz(a3, X) :- fooAlso(X, a3), fooAlso(Y, a3), bar(X, Y).
result(a3, X) :- fooAlso(X, a3), ~baz(a3, X).
Querying result(a3, X) returns [result(a3, a2); result(a3, a1)], however, result(a3, a1) should not be in query output. On the other hand, if you query instead result(a3, a1), the output is empty, which is the expected behavior.
Interestingly, if you replace fooAlso(Y, a3) with foo(Y, a3) in the baz clause, querying result(a3, X) returns the desired output [result(a3,a2)].
Here's a zip file of a dune project containing this example, if that's helpful.
bug.zip
Can you confirm this is a bug? Or maybe I'm not using this library properly?
Thanks!
Hi,
Thanks for this helpful library!
I seem to have found an instance where querying a top down database gives an incorrect answer.
Here's the program:
Querying
result(a3, X)returns[result(a3, a2); result(a3, a1)], however,result(a3, a1)should not be in query output. On the other hand, if you query insteadresult(a3, a1), the output is empty, which is the expected behavior.Interestingly, if you replace
fooAlso(Y, a3)withfoo(Y, a3)in the baz clause, queryingresult(a3, X)returns the desired output[result(a3,a2)].Here's a zip file of a dune project containing this example, if that's helpful.
bug.zip
Can you confirm this is a bug? Or maybe I'm not using this library properly?
Thanks!