The following scenario does not work: - get a query: ?(X,Y) :- p(X,Y). - rewrite it with the following rule: p(a,Y) :- q(Y). - you should get a rewrite : ?(X,Y) :- q(Y), X = a. We should be able to query all kinds of Store.