Handling of errors in lambda_prs_conv.
authorCezary Kaliszyk <kaliszyk@in.tum.de>
Mon, 07 Dec 2009 21:21:57 +0100
changeset 608 678315da994e
parent 607 a8c3fa5c4015
child 609 6ce4f274b0fa
Handling of errors in lambda_prs_conv.
Quot/QuotMain.thy
--- a/Quot/QuotMain.thy	Mon Dec 07 21:21:23 2009 +0100
+++ b/Quot/QuotMain.thy	Mon Dec 07 21:21:57 2009 +0100
@@ -1006,7 +1006,7 @@
 fun lambda_prs_simple_conv ctxt ctrm =
   case (term_of ctrm) of
    ((Const (@{const_name fun_map}, _) $ r1 $ a2) $ (Abs _)) =>
-     let
+     (let
        val thy = ProofContext.theory_of ctxt
        val (ty_b, ty_a) = dest_fun_type (fastype_of r1)
        val (ty_c, ty_d) = dest_fun_type (fastype_of a2)
@@ -1021,7 +1021,7 @@
            val (insp, inst) = make_inst (term_of (Thm.lhs_of ts)) (term_of ctrm)
          in
            Drule.instantiate ([], [(cterm_of thy insp, cterm_of thy inst)]) ts
-         end handle Bind =>
+         end handle _ => (* TODO handle only Bind | Error "make_inst" *)
          let
            val (insp, inst) = make_inst2 (term_of (Thm.lhs_of te)) (term_of ctrm)
            val td = Drule.instantiate ([], [(cterm_of thy insp, cterm_of thy inst)]) te
@@ -1038,6 +1038,7 @@
      in
        Conv.rewr_conv ti ctrm
      end
+     handle _ => Conv.all_conv ctrm)
   | _ => Conv.all_conv ctrm
 *}