S:ExtrTerms
(formula-to-et-type formula) |
When we want to execute the program, we have to replace the constant cL corresponding to a lemma L by the extracted program of its proof, and the constant cGA corresponding to a global assumption GA by an assumed extracted term to be provided by the user. This can be achieved by adding computation rules for cL and cGA. We can be rather flexible here and enable/block rewriting by using animate/deanimate as desired. Notice that the type of the extracted term provided for a cGA must be the extracted type of the assumed formula. When predicate variables are present, one must use the type variables assigned to them in PVAR-TO-TVAR-ALIST.
(animate thm-or-ga-name . opt-eterm) | |||||
(deanimate thm-or-ga-name) |
We can define, for a given derivation M of a formula A with τ(A)nulltype,
its extracted term (or extracted program) et(M) of type τ(A). We also need
extracted terms for the axioms. For induction we take recursion, for the
proof-by-cases axiom we take the cases-construct for terms; for the other axioms
the extracted terms are rather clear. Term extraction is implemented
by
(proof-to-extracted-term proof) |
It is also possible to give an internal proof of soundness. This can be done by
(proof-to-soundness-proof proof) |