r(X) -> p(f(X))==all(Y,q(X,Y)).
r(a).
p(f(a)).
q(a,b) -> [].

top_predicates_precedence([r,p,q]).