\DOC EVAL_RULE \TYPE {EVAL_RULE : thm -> thm} \SYNOPSIS

advertisement
\DOC EVAL_RULE
\TYPE {EVAL_RULE : thm -> thm}
\SYNOPSIS
Evaluate conclusion of a theorem.
\KEYWORDS
evaluation.
\DESCRIBE
An invocation {EVAL_RULE th} symbolically evaluates the
conclusion of {th} by applying the defining equations of constants
which occur in the conclusion of {th}. These equations are held in a
mutable datastructure that is automatically added to by {Hol_datatype},
{Define}, and {tprove}. The underlying algorithm is call-by-value with a
few differences, see the entry for {CBV_CONV} for details.
\FAILURE
Never fails, but may diverge.
\EXAMPLE
{
- val th = ASSUME(Term `x = MAP FACT (REVERSE [1;2;3;4;5;6;7;8;9;10])`);
> val th = [.] |- x = MAP FACT (REVERSE [1; 2; 3; 4; 5; 6; 7; 8; 9; 10])
- EVAL_RULE th;
> val it = [.] |- x = [3628800; 362880; 40320; 5040; 720; 120; 24; 6; 2;
1]
- hyp it;
> val it = [`x = MAP FACT (REVERSE [1; 2; 3; 4; 5; 6; 7; 8; 9; 10])`]
}
\COMMENTS
In order for recursive functions over numbers to be applied by
{EVAL_RULE},
pattern matching over {SUC} and {0} needs to be replaced by destructors.
For example, the equations for {FACT} would have to be rephrased
as {FACT n = if n = 0 then 1 else n * FACT (n-1)}.
\SEEALSO
bossLib.EVAL, bossLib.EVAL_TAC, computeLib.CBV_CONV.
\ENDDOC
Download