IF Computer > MINERVA > Manual > Reference > Predicates > Term creation and decomposition > copy_term/2

copy_term/2

MINERVA
ifcomputer logo
f
Expert Services on the Web

makes a copy of a term.

copy_term(+Term1, -Term2)

unifies Term2 with a copy of Term1 where all variables in Term1 are replaced by new variables.

Arguments

Term1                  term
Term2                  term

Examples

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.

Standard

This predicate is part of the ISO-Prolog Standard.

See also

arg/3, functor/3, '=..'/2.

document: http://www.ifcomputer.co.jp/MINERVA/Manual/Reference/Predicates/term_creat_decomp/copy_term/print_en.html
published 2008/10/6 update 1998/8/7 (c) 1996-2006 IF Computer Japan
IF Computer 5-28-2 Sendagi, Bunkyo-ku Tel +81-3-5814-3352 start (AT) ifcomputer.com
Customer Support Tokyo 113-0022 Japan   http://www.ifcomputer.com
Back> managed with ubiCMS