src/HOL/Tools/Transfer/transfer.ML
changeset 60801 7664e0916eec
parent 60752 b48830b670a1
child 60805 4cc49ead6e75
equal deleted inserted replaced
60799:57dd0b45fc21 60801:7664e0916eec
   216     | _ => raise TYPE ("dest_funcT", [Thm.typ_of cT], []))
   216     | _ => raise TYPE ("dest_funcT", [Thm.typ_of cT], []))
   217 
   217 
   218 fun Rel_conv ct =
   218 fun Rel_conv ct =
   219   let val (cT, cT') = dest_funcT (Thm.ctyp_of_cterm ct)
   219   let val (cT, cT') = dest_funcT (Thm.ctyp_of_cterm ct)
   220       val (cU, _) = dest_funcT cT'
   220       val (cU, _) = dest_funcT cT'
   221   in Drule.instantiate' [SOME cT, SOME cU] [SOME ct] Rel_rule end
   221   in Thm.instantiate' [SOME cT, SOME cU] [SOME ct] Rel_rule end
   222 
   222 
   223 (* Conversion to preprocess a transfer rule *)
   223 (* Conversion to preprocess a transfer rule *)
   224 fun safe_Rel_conv ct =
   224 fun safe_Rel_conv ct =
   225   Conv.try_conv (HOLogic.Trueprop_conv (Conv.fun_conv (Conv.fun_conv Rel_conv))) ct
   225   Conv.try_conv (HOLogic.Trueprop_conv (Conv.fun_conv (Conv.fun_conv Rel_conv))) ct
   226 
   226 
   461             val r2 = Thm.dest_fun2 (Thm.dest_arg (Thm.cprop_of thm1))
   461             val r2 = Thm.dest_fun2 (Thm.dest_arg (Thm.cprop_of thm1))
   462             val (a1, (b1, _)) = apsnd dest_funcT (dest_funcT (Thm.ctyp_of_cterm r1))
   462             val (a1, (b1, _)) = apsnd dest_funcT (dest_funcT (Thm.ctyp_of_cterm r1))
   463             val (a2, (b2, _)) = apsnd dest_funcT (dest_funcT (Thm.ctyp_of_cterm r2))
   463             val (a2, (b2, _)) = apsnd dest_funcT (dest_funcT (Thm.ctyp_of_cterm r2))
   464             val tinsts = [SOME a1, SOME b1, SOME a2, SOME b2]
   464             val tinsts = [SOME a1, SOME b1, SOME a2, SOME b2]
   465             val insts = [SOME (Thm.dest_arg r1), SOME (Thm.dest_arg r2)]
   465             val insts = [SOME (Thm.dest_arg r1), SOME (Thm.dest_arg r2)]
   466             val rule = Drule.instantiate' tinsts insts @{thm Rel_abs}
   466             val rule = Thm.instantiate' tinsts insts @{thm Rel_abs}
   467             val thm2 = Thm.forall_intr x (Thm.forall_intr y (Thm.implies_intr cprop thm1))
   467             val thm2 = Thm.forall_intr x (Thm.forall_intr y (Thm.implies_intr cprop thm1))
   468           in
   468           in
   469             (thm2 COMP rule, hyps)
   469             (thm2 COMP rule, hyps)
   470           end
   470           end
   471       | zip ctxt thms (f $ t) (g $ u) =
   471       | zip ctxt thms (f $ t) (g $ u) =