?- X=f(A,b),Y=f(a,B),copy_term(X,Y). X = f(A, b), Y = f(a, b), B = b.
X's A has not been further constrained!
?- A=f(X,a),copy_term(A,A). A = f(X, a).
The above is a NOP!
In relation with "term equivalence" (double equals):
After copying into a fresh variable Y, the in and out terms are term-non-equivalent because the variables are disjoint:
?- X=f(a,B),copy_term(X,Y),X\==Y. X = f(a, B), Y = f(a, _21790).
Two term-non-equivalent terms may become term-equivalent in the trivial case of a fully ground in term:
?- X=f(a),X\==Y,copy_term(X,Y),X==Y. X = Y, Y = f(a).