src/CCL/Type.thy
changeset 32149 ef59550a55d3
parent 32010 cb1a1c94b4cd
child 32153 a0e57fb1b930
equal deleted inserted replaced
32148:253f6808dabe 32149:ef59550a55d3
   130 in
   130 in
   131 
   131 
   132   fun mk_ncanT_tac ctxt defs top_crls crls s = prove_goalw (ProofContext.theory_of ctxt) defs s
   132   fun mk_ncanT_tac ctxt defs top_crls crls s = prove_goalw (ProofContext.theory_of ctxt) defs s
   133     (fn major::prems => [(resolve_tac ([major] RL top_crls) 1),
   133     (fn major::prems => [(resolve_tac ([major] RL top_crls) 1),
   134                          (REPEAT_SOME (eresolve_tac (crls @ [exE,bexE,conjE,disjE]))),
   134                          (REPEAT_SOME (eresolve_tac (crls @ [exE,bexE,conjE,disjE]))),
   135                          (ALLGOALS (asm_simp_tac (local_simpset_of ctxt))),
   135                          (ALLGOALS (asm_simp_tac (simpset_of ctxt))),
   136                          (ALLGOALS (ares_tac (prems RL [lemma]) ORELSE'
   136                          (ALLGOALS (ares_tac (prems RL [lemma]) ORELSE'
   137                                     etac bspec )),
   137                                     etac bspec )),
   138                          (safe_tac (local_claset_of ctxt addSIs prems))])
   138                          (safe_tac (claset_of ctxt addSIs prems))])
   139 end
   139 end
   140 *}
   140 *}
   141 
   141 
   142 ML {*
   142 ML {*
   143   val ncanT_tac = mk_ncanT_tac @{context} [] @{thms case_rls} @{thms case_rls}
   143   val ncanT_tac = mk_ncanT_tac @{context} [] @{thms case_rls} @{thms case_rls}
   406 val ci3_AgenI = mk_thm "[|  mono(Agen);  a : Agen(lfp(%x. Agen(x) Un R Un A)) |] ==> a : lfp(%x. Agen(x) Un R Un A)"
   406 val ci3_AgenI = mk_thm "[|  mono(Agen);  a : Agen(lfp(%x. Agen(x) Un R Un A)) |] ==> a : lfp(%x. Agen(x) Un R Un A)"
   407 val ci3_AI    = mk_thm "[|  mono(Agen);  a : A |] ==> a : lfp(%x. Agen(x) Un R Un A)"
   407 val ci3_AI    = mk_thm "[|  mono(Agen);  a : A |] ==> a : lfp(%x. Agen(x) Un R Un A)"
   408 
   408 
   409 fun mk_genIs thy defs genXH gen_mono s = prove_goalw thy defs s
   409 fun mk_genIs thy defs genXH gen_mono s = prove_goalw thy defs s
   410       (fn prems => [rtac (genXH RS iffD2) 1,
   410       (fn prems => [rtac (genXH RS iffD2) 1,
   411                     simp_tac (simpset_of thy) 1,
   411                     simp_tac (global_simpset_of thy) 1,
   412                     TRY (fast_tac (@{claset} addIs
   412                     TRY (fast_tac (@{claset} addIs
   413                             ([genXH RS iffD2,gen_mono RS coinduct3_mono_lemma RS lfpI]
   413                             ([genXH RS iffD2,gen_mono RS coinduct3_mono_lemma RS lfpI]
   414                              @ prems)) 1)])
   414                              @ prems)) 1)])
   415 end;
   415 end;
   416 
   416 
   440    "<n,n'> : lfp(%x. POgen(x) Un R Un PO) ==> <succ(n),succ(n')> : POgen(lfp(%x. POgen(x) Un R Un PO))",
   440    "<n,n'> : lfp(%x. POgen(x) Un R Un PO) ==> <succ(n),succ(n')> : POgen(lfp(%x. POgen(x) Un R Un PO))",
   441    "<[],[]> : POgen(lfp(%x. POgen(x) Un R Un PO))",
   441    "<[],[]> : POgen(lfp(%x. POgen(x) Un R Un PO))",
   442    "[| <h,h'> : lfp(%x. POgen(x) Un R Un PO);  <t,t'> : lfp(%x. POgen(x) Un R Un PO) |] ==> <h$t,h'$t'> : POgen(lfp(%x. POgen(x) Un R Un PO))"];
   442    "[| <h,h'> : lfp(%x. POgen(x) Un R Un PO);  <t,t'> : lfp(%x. POgen(x) Un R Un PO) |] ==> <h$t,h'$t'> : POgen(lfp(%x. POgen(x) Un R Un PO))"];
   443 
   443 
   444 fun POgen_tac ctxt (rla,rlb) i =
   444 fun POgen_tac ctxt (rla,rlb) i =
   445   SELECT_GOAL (safe_tac (local_claset_of ctxt)) i THEN
   445   SELECT_GOAL (safe_tac (claset_of ctxt)) i THEN
   446   rtac (rlb RS (rla RS @{thm ssubst_pair})) i THEN
   446   rtac (rlb RS (rla RS @{thm ssubst_pair})) i THEN
   447   (REPEAT (resolve_tac (POgenIs @ [@{thm PO_refl} RS (@{thm POgen_mono} RS ci3_AI)] @
   447   (REPEAT (resolve_tac (POgenIs @ [@{thm PO_refl} RS (@{thm POgen_mono} RS ci3_AI)] @
   448     (POgenIs RL [@{thm POgen_mono} RS ci3_AgenI]) @ [@{thm POgen_mono} RS ci3_RI]) i));
   448     (POgenIs RL [@{thm POgen_mono} RS ci3_AgenI]) @ [@{thm POgen_mono} RS ci3_RI]) i));
   449 
   449 
   450 *}
   450 *}
   479 (* then reduce this to a goal <a',b'> : R (hopefully?)                                *)
   479 (* then reduce this to a goal <a',b'> : R (hopefully?)                                *)
   480 (*      rews are rewrite rules that would cause looping in the simpifier              *)
   480 (*      rews are rewrite rules that would cause looping in the simpifier              *)
   481 
   481 
   482 fun EQgen_tac ctxt rews i =
   482 fun EQgen_tac ctxt rews i =
   483  SELECT_GOAL
   483  SELECT_GOAL
   484    (TRY (safe_tac (local_claset_of ctxt)) THEN
   484    (TRY (safe_tac (claset_of ctxt)) THEN
   485     resolve_tac ((rews@[refl]) RL ((rews@[refl]) RL [@{thm ssubst_pair}])) i THEN
   485     resolve_tac ((rews@[refl]) RL ((rews@[refl]) RL [@{thm ssubst_pair}])) i THEN
   486     ALLGOALS (simp_tac (local_simpset_of ctxt)) THEN
   486     ALLGOALS (simp_tac (simpset_of ctxt)) THEN
   487     ALLGOALS EQgen_raw_tac) i
   487     ALLGOALS EQgen_raw_tac) i
   488 *}
   488 *}
   489 
   489 
   490 end
   490 end