dusa
dusa copied to clipboard
Optimize rules with shared prefixes
If we have two rules
a :- c X, c Y, c Z, d X Y Z.
b :- c X, c Y, c Z, e Y X Z.
f :- c X, c Y.
then we're going to have three indexes storing all pairs of items in c, one for every rule, and two indexes storing all triples of items from c, one for the first two rules. Optimizing the binarized program would allow us to notice and avoid these redundancies.