src/HOL/HOLCF/Tools/Domain/domain_induction.ML
changeset 61087 1e36b5d021f2
parent 60754 02924903a6fd
child 63003 bf5fcc65586b
equal deleted inserted replaced
61086:fc7ab11128dc 61087:1e36b5d021f2
   130     in fold_rev Logic.all vs (if defined then t3 else t2) end
   130     in fold_rev Logic.all vs (if defined then t3 else t2) end
   131   fun eq_assms ((p, T), cons) =
   131   fun eq_assms ((p, T), cons) =
   132       mk_trp (p $ HOLCF_Library.mk_bottom T) :: map (con_assm true p) cons
   132       mk_trp (p $ HOLCF_Library.mk_bottom T) :: map (con_assm true p) cons
   133   val assms = maps eq_assms (Ps ~~ newTs ~~ map #con_specs constr_infos)
   133   val assms = maps eq_assms (Ps ~~ newTs ~~ map #con_specs constr_infos)
   134 
   134 
   135   val take_ss =
       
   136     simpset_of (put_simpset HOL_ss @{context} addsimps (@{thm Rep_cfun_strict1} :: take_rews))
       
   137   fun quant_tac ctxt i = EVERY
   135   fun quant_tac ctxt i = EVERY
   138     (map (fn name =>
   136     (map (fn name =>
   139       Rule_Insts.res_inst_tac ctxt [((("x", 0), Position.none), name)] [] spec i) x_names)
   137       Rule_Insts.res_inst_tac ctxt [((("x", 0), Position.none), name)] [] spec i) x_names)
   140 
   138 
   141   (* FIXME: move this message to domain_take_proofs.ML *)
   139   (* FIXME: move this message to domain_take_proofs.ML *)
   152               (Ps ~~ take_consts ~~ xs)
   150               (Ps ~~ take_consts ~~ xs)
   153       val goal = mk_trp (foldr1 mk_conj concls)
   151       val goal = mk_trp (foldr1 mk_conj concls)
   154 
   152 
   155       fun tacf {prems, context = ctxt} =
   153       fun tacf {prems, context = ctxt} =
   156         let
   154         let
       
   155           val take_ctxt = put_simpset HOL_ss ctxt addsimps (@{thm Rep_cfun_strict1} :: take_rews)
       
   156 
   157           (* Prove stronger prems, without definedness side conditions *)
   157           (* Prove stronger prems, without definedness side conditions *)
   158           fun con_thm p (con, args) =
   158           fun con_thm p (con, args) =
   159             let
   159             let
   160               val subgoal = con_assm false p (con, args)
   160               val subgoal = con_assm false p (con, args)
   161               val rules = prems @ con_rews @ @{thms simp_thms}
   161               val rules = prems @ con_rews @ @{thms simp_thms}
   175 
   175 
   176           val tacs1 = [
   176           val tacs1 = [
   177             quant_tac ctxt 1,
   177             quant_tac ctxt 1,
   178             simp_tac (put_simpset HOL_ss ctxt) 1,
   178             simp_tac (put_simpset HOL_ss ctxt) 1,
   179             Induct_Tacs.induct_tac ctxt [[SOME "n"]] NONE 1,
   179             Induct_Tacs.induct_tac ctxt [[SOME "n"]] NONE 1,
   180             simp_tac (put_simpset take_ss ctxt addsimps prems) 1,
   180             simp_tac (take_ctxt addsimps prems) 1,
   181             TRY (safe_tac (put_claset HOL_cs ctxt))]
   181             TRY (safe_tac (put_claset HOL_cs ctxt))]
   182           fun con_tac _ = 
   182           fun con_tac _ = 
   183             asm_simp_tac (put_simpset take_ss ctxt) 1 THEN
   183             asm_simp_tac take_ctxt 1 THEN
   184             (resolve_tac ctxt prems' THEN_ALL_NEW eresolve_tac ctxt [spec]) 1
   184             (resolve_tac ctxt prems' THEN_ALL_NEW eresolve_tac ctxt [spec]) 1
   185           fun cases_tacs (cons, exhaust) =
   185           fun cases_tacs (cons, exhaust) =
   186             Rule_Insts.res_inst_tac ctxt [((("y", 0), Position.none), "x")] [] exhaust 1 ::
   186             Rule_Insts.res_inst_tac ctxt [((("y", 0), Position.none), "x")] [] exhaust 1 ::
   187             asm_simp_tac (put_simpset take_ss ctxt addsimps prems) 1 ::
   187             asm_simp_tac (take_ctxt addsimps prems) 1 ::
   188             map con_tac cons
   188             map con_tac cons
   189           val tacs = tacs1 @ maps cases_tacs (conss ~~ exhausts)
   189           val tacs = tacs1 @ maps cases_tacs (conss ~~ exhausts)
   190         in
   190         in
   191           EVERY (map DETERM tacs)
   191           EVERY (map DETERM tacs)
   192         end
   192         end