'$VAR'(N), where N is an integer starting from FirstN. FirstN is used as the value of N for the first variable in Term (starting from the left). The second distinct variable in Term is given a value of N satisfying "N is FirstN + 1" and so on. The last variable in Term has the value LastN-1.
<int>is not less than FirstN are uniformly replaced by variables.
'$VAR''subterms with the same integer are replaced by the same variable. Also a version unnumbervars/2 is provided which calls unnumbervars/3 with the second parameter set to 0.
| ?- subsumes_chk(a(X,f,Y,X),a(U,V,b,S)). no | ?- subsumes_chk(a(X,Y,X),a(b,b,b)). X = _595884 Y = _595624
variant(Term1, Term2) :- subsumes_chk(Term1, Term2), subsumes_chk(Term2, Term1).