> Definition count_up_def:
count_up m k = if m < k:num then 1 + count_up (m+1) k else 0:num
Termination
WF_REL_TAC ‘measure $ λ(m,k). k - m:num’
End;
Equations stored under "count_up_def".
Induction stored under "count_up_ind".
val count_up_def =
⊢ ∀m k. count_up m k = if m < k then 1 + count_up (m + 1) k else 0: thm
> cv_trans_rec count_up_def
(WF_REL_TAC ‘measure $ λ(m,k). cv$c2n k - cv$c2n m’
\\ Cases \\ Cases \\ gvs [] \\ rw [] \\ gvs []);
Equations stored under "cv_count_up_def".
Induction stored under "cv_count_up_ind".
Finished translating count_up, stored in cv_count_up_thm
val it = ⊢ (): unit
> cv_eval “count_up 5 100”;
val it = ⊢ count_up 5 100 = 95: thm