more conventional eval_tac vs. method_setup "eval";
authorwenzelm
Wed, 11 Jan 2012 21:04:22 +0100
changeset 46190 a42c5f23109f
parent 46189 7f6668317e24
child 46191 a88546428c2a
more conventional eval_tac vs. method_setup "eval"; clarified method "normalization": THEN_ALL_NEW avoids bumping into other subgoals;
src/HOL/HOL.thy
--- a/src/HOL/HOL.thy	Wed Jan 11 18:02:59 2012 +0100
+++ b/src/HOL/HOL.thy	Wed Jan 11 21:04:22 2012 +0100
@@ -1906,19 +1906,20 @@
 subsubsection {* Evaluation and normalization by evaluation *}
 
 ML {*
-fun gen_eval_method conv ctxt = SIMPLE_METHOD'
-  (CONVERSION (Conv.params_conv ~1 (K (Conv.concl_conv ~1 (conv ctxt))) ctxt)
-    THEN' rtac TrueI)
+fun eval_tac ctxt =
+  let val conv = Code_Runtime.dynamic_holds_conv (Proof_Context.theory_of ctxt)
+  in CONVERSION (Conv.params_conv ~1 (K (Conv.concl_conv ~1 conv)) ctxt) THEN' rtac TrueI end
 *}
 
-method_setup eval = {*
-  Scan.succeed (gen_eval_method (Code_Runtime.dynamic_holds_conv o Proof_Context.theory_of))
-*} "solve goal by evaluation"
+method_setup eval = {* Scan.succeed (SIMPLE_METHOD' o eval_tac) *}
+  "solve goal by evaluation"
 
 method_setup normalization = {*
-  Scan.succeed (fn ctxt => SIMPLE_METHOD'
-    (CHANGED_PROP o (CONVERSION (Nbe.dynamic_conv (Proof_Context.theory_of ctxt))
-      THEN' (fn k => TRY (rtac TrueI k)))))
+  Scan.succeed (fn ctxt =>
+    SIMPLE_METHOD'
+      (CHANGED_PROP o
+        (CONVERSION (Nbe.dynamic_conv (Proof_Context.theory_of ctxt))
+          THEN_ALL_NEW (TRY o rtac TrueI))))
 *} "solve goal by normalization"