I want to write a predicate
rename_term_variables/3, which takes a term and a list of certain variables in the term as input and should output a new term where the variables in the list are renamed.
The following example illustrates the desired output of the predicate:
?- rename_term_variables(a(X, b(X, Y, Z)), [X,Z], New_Term). New_Term = a(_7448, b(_7448, Y, _7450)).
Can anyone tell me how to write such a predicate?
Thanks in advance.