tprove : defn * tactic -> thm * thm
tprove and tgoal can be seen as analogues of prove and set_goal in the specialized domain of proving termination of recursive functions.
It is up to the user to store the results of tprove in the current theory segment.
tprove (defn,tac) fails if defn represents a non-recursive or primitive recursive function.
- val qsort_defn = Hol_defn "qsort" `(qsort ___ [] = []) /\ (qsort ord (x::rst) = APPEND (qsort ord (FILTER ($~ o ord x) rst)) (x :: qsort ord (FILTER (ord x) rst)))`
- val (qsort_eqns, qsort_ind) = tprove(qsort_defn, tac); > val qsort_eqns = |- (qsort v0 [] = []) /\ (qsort ord (x::rst) = APPEND (qsort ord (FILTER ($~ o ord x) rst)) (x::qsort ord (FILTER (ord x) rst))) : thm val qsort_ind = |- !P. (!v0. P v0 []) /\ (!ord x rst. P ord (FILTER ($~ o ord x) rst) /\ P ord (FILTER (ord x) rst) ==> P ord (x::rst)) ==> !v v1. P v v1 : thm