The function frees is not in the standard hol98 kernel; the function
free_vars is used instead. WARNING: the order of the list returned
by frees and free_vars is different.
- val tm = (--`x (y:num):bool`--);
> val tm = (--`x y`--) : term
- free_vars tm
> val it = [(--`y`--),(--`x`--)] : term list
- frees tm;
> val it = [(--`x`--),(--`y`--)] : term list
It ought to be the case that the result of a call to frees
(or free_vars) is treated as a set, that is, the order of the free
variables should be immaterial. This is sometimes not possible; for
example the result of gen_all (and hence the results of GEN_ALL
and new_axiom) necessarily depends on the order of the variables
returned from frees. The problem comes when users write code that
depends on the order of quantification. For example, contrary to some
expectations, it is not the case that (tm being a closed term already)
GEN_ALL (SPEC_ALL tm) = tm
where “=” is interpreted as identity or alpha-convertibility.