Rewrites query Q1 associated with the given node into new query Q2
where literals of Q1 are rewritten to special predicates
in Q2 (one per each variable appearing in both: query Q1 and atom a).
Rewrites query Q1 associated with the given pattern into new query Q2
where all variables of Q1 (distinguished and undistinguished ones) are distinguished in Q2