tried to simplify apply_rsp_tac; failed at the moment; added some questions
authorChristian Urban <urbanc@in.tum.de>
Sat, 12 Dec 2009 18:43:42 +0100
changeset 739 089cf9ffb711
parent 738 7142389632fd
child 740 d151f24427ab
tried to simplify apply_rsp_tac; failed at the moment; added some questions
Quot/QuotMain.thy
--- a/Quot/QuotMain.thy	Sat Dec 12 18:01:22 2009 +0100
+++ b/Quot/QuotMain.thy	Sat Dec 12 18:43:42 2009 +0100
@@ -666,7 +666,7 @@
 ML {*
 val apply_rsp_tac =
   Subgoal.FOCUS (fn {concl, asms, context,...} =>
-    case ((HOLogic.dest_Trueprop (term_of concl))) of
+    case (HOLogic.dest_Trueprop (term_of concl)) of
       (R2 $ (f $ x) $ (g $ y)) =>
         (let
            val (asmf, asma) = find_qt_asm (map term_of asms);
@@ -675,16 +675,18 @@
            then no_tac 
            else 
              let
-               val ty_a = fastype_of x;
-               val ty_b = fastype_of asma;
-               val ty_c = range_type (type_of f); (* why type_of, not fast_type? *)
-               val thy = ProofContext.theory_of context;
-               val ty_inst = map (SOME o (ctyp_of thy)) [ty_a, ty_b, ty_c];
-               val thm = Drule.instantiate' ty_inst [] @{thm apply_rsp}
-               val te = solve_quotient_assums context thm
-               val t_inst = map (SOME o (cterm_of thy)) [R2, f, g, x, y]; 
-                                                      (* why not instantiate terms 3 lines earlier *)
+               val ty_a = fastype_of x
+               val ty_b = fastype_of asma
+               val ty_c = range_type (type_of f) (* why type_of, not fast_type? *)
+               val thy = ProofContext.theory_of context
+               val ty_inst = map (SOME o (ctyp_of thy)) [ty_a, ty_b, ty_c]
+               val t_inst = map (SOME o (cterm_of thy)) [R2, f, g, x, y];
+               val thm' = Drule.instantiate' ty_inst [] @{thm apply_rsp}
+               val te = solve_quotient_assums context thm'
                val thm = Drule.instantiate' [] t_inst te
+                    (* why not instantiate terms 3 lines earlier *)
+                    (* \<dots> if done one gets an instantiate type conlict error ??? *)
+                    (* why is necessary to get rid of the quot-assms first ???   *)
              in
                compose_tac (false, thm, 2) 1
              end