IITDBGroup / gprom

GProM is a middleware that adds support for provenance to database backends.
http://www.cs.iit.edu/%7edbgroup/research/gprom.php
Apache License 2.0
8 stars 5 forks source link

Lineage for datalog query with self-joins, capture rules use same head variables #92

Closed lordpretzel closed 1 year ago

lordpretzel commented 1 year ago

For provenance capture for a query with self-joins (more than one reference to the table for which we compute provenance) we generate one capture rule for each reference to the table. However, these rules incorrectly all project out the variables from the same goal instead of for each of the rules.

Q(X) :- R(X,Y), R(X,Z). ANS : Q. LINEAGE FOR R.

should be rewritten as

q(x) :- r(x,y),r(x,z).
prov_r(x,y) :- r(x,y),r(x,z),q(x).
prov_r(x,z) :- r(x,y),r(x,z),q(x).

but is rewritten as

q(x) :- r(x,y),r(x,z).
prov_r(x,z) :- r(x,y),r(x,z),q(x).
prov_r(x,z) :- r(x,y),r(x,z),q(x).