Attributed variables are treated like normal variables, except that their attributes are copied as specified by the corresponding copy_term handler. This would usually imply that properties of the variable which can be interpreted as unary constraints (such as its domain) are copied, while attributes that link the variable to other variables or objects are ignored.
Subterms that do not contain any of the variables to replace are not physically copied.
Note that when the structure of the term to be copied is known, then it is more efficient to use specialised unification code to do the job.
[eclipse]: Term=s(X,Y,Z), copy_term_vars(Y, Term, Copy). X = _79 Z = _81 Y = _60 Term = s(_79, _60, _81) Copy = s(_79, _120, _81) yes.