variant : term list -> term -> term
The exact form of the variable name should not be relied on, except that the original variable will be returned unmodified unless it is itself in the list to avoid clashing with.
- variant [Term`y:bool`, Term`z:bool`] (Term`x:bool`); > val it = `x` : term - variant [Term`x:bool`, Term`x':num`, Term`x'':num`] (Term `x:bool`); > val it = `x'''` : termwhile the following shows that clashes with the names of constants are also avoided:
- variant [] (mk_var("T",bool));
> val it = `T'` : term
The style of renaming can be altered by modifying the reference
variable Globals.priming:
- with_flag (priming,SOME "_")
(uncurry variant)
([Term`x:bool`, Term`x':num`, Term`x'':num`], Term `x:bool`);
> val it = `x_1` : term