In the following, we first attempt to map the factorial function FACT
over a list of variables. This attempt goes into a loop, because the
conditional statement in the evaluation rule for FACT is never
determine when the argument is equal to zero. However, if we suppress
the evaluation of FACT, then we can return a useful answer.
- EVAL (Term `MAP FACT [x; y; z]`); (* loops! *)
> Interrupted.
- val [FACT] = decls "FACT"; (* find FACT constant *)
> val FACT = `FACT` : term
- RESTR_EVAL_CONV [FACT] (Term `MAP FACT [x; y; z]`);
> val it = |- MAP FACT [x; y; z] = [FACT x; FACT y; FACT z] : thm