-
Notifications
You must be signed in to change notification settings - Fork 208
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
Incorrect result in compiler mode? #2189
Comments
Hi guys, is this a confirmed bug or am i doing something wrong? |
Is this happening for the interpreter as well? |
Ok - I can reproduce the problem. Let me study it. |
Here is the output of the compiler with all its intermediate relations (NB: I renamed a__ to A):
and this is the output of the interpreter:
|
I believe I have found the culprit. We have an UNDEF in the last RAM Query:
|
If you rewrite the query to:
so that you don't have warnings while compiling it works. The query code is translated as follows:
|
The query changes depending on whether unnamed variables are used or not. The first version (with named names) produces
The second version produces (with unnamed variables)
when running the optimisation. |
After more investigation, the range-check is failing in the C++ program for the condition The btree_delete data structure fails to deliver a non-empty range here for the check:
for the query
|
Both lower/upper iterators return |
The range search fails with a single tuple (1,2) in relation E. |
The bounds are set correctly:
|
The second index |
It seems that the subsumptive clause
leaves the data structure in an inconsistent state. |
Deleting the tuple (1,1) from the data structure destroys the index ind_1 (makes it empty). |
Here is a small C++ program that shows that erase() is erroneous:
The example shows that after deleting tuple (1,1) the relation is empty instead of containing the tuple (1,2) only. Here is the output:
|
@b-scholz The reason why the erase operation deletes the two tuples is because t1 equals t2 given the provided t_comparator. In that case, the call to idx.erase(t1) erases all the tuples t such that t_comparator::equal(t1, t) I'm not sure what should be the fix. |
@julienhenry - that is a great observation. I did not look carefully. We have a partial comparator but we need a full one for erase. |
If we have a Interestingly, this works for the interpreter because we have always a complete order in the interpreter. |
We do something similar for provenance: |
@bertram-gil: It would be great to generate smaller test cases in the future. For example,
exhibits the same behaviour as your example. |
Perhaps you can use notions of delta debugging for Datalog. |
Hi guys,
Consider the following program:
When I run the above program in compiler mode, I get the following result for the relation
a__
:However, if I add a subgoal
E(d, e)
in rulea__
to get thea__(b, c) :- graph(g, b), !rel(b, d), C(c), E(d, a), E(d, e).
, the result ofa__
should not change. But running the following program computes an empty result fora__
.FYI, Running both programs in interpreter mode returns:
I am using the latest commit: 592605c
The text was updated successfully, but these errors were encountered: