makes a copy of a term.
unifies Term2 with a copy of Term1 where all variables in Term1 are replaced by new variables.
Term1 term Term2 term
| copy_term(f(a,b), X). | Succeeds with substitution X <- f(a,b). |
| copy_term(f(A,B,A),C). | Succeeds with substitution C <- f (_1,_2,_1). |
| copy_term(f(a, g(b,C)), f(A,Y)). | Succeeds with substitution A <- a, Y <- g(b,_1). |
| copy_term(f(a,b), f(a,d)). | Fails. |
This predicate is part of the ISO-Prolog Standard.
| scroll to top |
|