I am looking for a Jave implementation of Datalog that does not evaluate unnecessary rules. I looked at IRIS reasoner which seems to be the most stable one.
However, it evaluates all the rules rather than only the ones being used. As an example:
parent('homer', 'bart').
parent('abe', 'homer').
ancestor(?a, ?b) :- parent(?a, ?b).
ancestor(?a, ?b) :- ancestor(?a, ?c), ancestor(?c, ?b).
// query.. find all parent-child pairs.
?-parent(?x, ?y).
I find that IRIS computes the relation ancestor
even if it is never used.
What other implementations are available for Java? Do any of those perform this optimization?