number_vars(?term, +number, ?number)

This predicate numbers the variables in the term so that all variables will not be empty anymore. The number to start numbering from is the second parameter and the number of the last variable is matched with the third argument. This predicate is used in freeze/2.

see also: arg/3 copy_term/2 freeze/2 functor/3 get_term/2 melt/3 =../2

Examples
number_vars(a(A), 1, L). succeeds with the substitutions A=var/1, L=2
number_vars(a(A, B, A), 1, L). succeeds with the substitutions A=var/1, B=var/2, L=3
number_vars(a(A, b, a), 1, L). succeeds with the substitutions A=var/1, L=2

 

 

info@trinc-prolog.com