code preprocessor tracing also for function transformers
authorhaftmann
Sun, 05 Oct 2014 20:30:58 +0200
changeset 58559 d230e7075bcf
parent 58558 30cc7ee5ac10
child 58560 ee502a9b38aa
child 58589 d9350ec0937e
code preprocessor tracing also for function transformers
src/Pure/Isar/code.ML
--- a/src/Pure/Isar/code.ML	Sun Oct 05 20:30:57 2014 +0200
+++ b/src/Pure/Isar/code.ML	Sun Oct 05 20:30:58 2014 +0200
@@ -918,9 +918,17 @@
   end;
 
 fun cert_of_eqns_preprocess ctxt functrans c =
-  (perhaps o perhaps_loop o perhaps_apply) functrans
-  #> (map o apfst) (preprocess eqn_conv ctxt)
-  #> cert_of_eqns ctxt c;
+  let
+    fun trace_eqns s eqns = (Pretty.writeln o Pretty.chunks)
+      (Pretty.str s :: map (Display.pretty_thm ctxt o fst) eqns);
+    val tracing = if Config.get ctxt simp_trace then trace_eqns else (K o K) ();
+  in
+    tap (tracing "before function transformation")
+    #> (perhaps o perhaps_loop o perhaps_apply) functrans
+    #> tap (tracing "after function transformation")
+    #> (map o apfst) (preprocess eqn_conv ctxt)
+    #> cert_of_eqns ctxt c
+  end;
 
 fun get_cert ctxt functrans c =
   let