6
+ − 1
theory Prove
549
+ − 2
imports Plain
6
+ − 3
begin
+ − 4
+ − 5
ML {*
183
6acf9e001038
proved the two lemmas in QuotScript (reformulated them without leading forall)
Christian Urban <urbanc@in.tum.de>
diff
changeset
+ − 6
val r = Unsynchronized.ref (NONE:(unit -> term) option)
6
+ − 7
*}
46
+ − 8
6
+ − 9
ML {*
+ − 10
let
48
+ − 11
fun after_qed thm_name thms lthy =
319
+ − 12
Local_Theory.note (thm_name, (flat thms)) lthy |> snd
48
+ − 13
+ − 14
fun setup_proof (name_spec, (txt, pos)) lthy =
+ − 15
let
+ − 16
val trm = ML_Context.evaluate lthy true ("r", r) txt
+ − 17
in
+ − 18
Proof.theorem_i NONE (after_qed name_spec) [[(trm,[])]] lthy
57
+ − 19
end
6
+ − 20
48
+ − 21
val parser = SpecParse.opt_thm_name ":" -- OuterParse.ML_source
6
+ − 22
in
46
+ − 23
OuterSyntax.local_theory_to_proof "prove" "proving a proposition"
48
+ − 24
OuterKeyword.thy_goal (parser >> setup_proof)
6
+ − 25
end
+ − 26
*}
+ − 27
+ − 28
end