The magic sets optimisation of the following program;
triple(?y, ?a, ?z) :- triple(?x, '88', ?y), triple(?x, ?a, ?z), NOT_EQUAL(?a, '88'), NOT_EQUAL(?x, ?y).
triple(?z, ?a, ?y) :- triple(?x, '88', ?y), triple(?z, ?a, ?x), NOT_EQUAL(?a, '88'), NOT_EQUAL(?x, ?y).
?- triple('184', ?p, ?o).
can produce a different output program between subsequent invocations. It has been reported that the output is correct, in terms of inferences.
This is strange, because no state is maintained between invocations. Perhaps the iteration order of rules affects the output?
It should be investigated if changing the order of rules passed to MagicSets.optimise in the 'rules' parameter affects the output of the algorithm.