20 val mk_ctor_induct_tac: Proof.context -> int -> thm list list -> thm -> thm list -> thm -> |
20 val mk_ctor_induct_tac: Proof.context -> int -> thm list list -> thm -> thm list -> thm -> |
21 thm list -> thm list -> thm list -> tactic |
21 thm list -> thm list -> thm list -> tactic |
22 val mk_ctor_induct2_tac: Proof.context -> ctyp option list -> cterm option list -> thm -> |
22 val mk_ctor_induct2_tac: Proof.context -> ctyp option list -> cterm option list -> thm -> |
23 thm list -> tactic |
23 thm list -> tactic |
24 val mk_ctor_set_tac: thm -> thm -> thm list -> tactic |
24 val mk_ctor_set_tac: thm -> thm -> thm list -> tactic |
|
25 val mk_ctor_rec_transfer_tac: Proof.context -> int -> int -> thm list -> thm list -> thm list -> |
|
26 thm list -> tactic |
25 val mk_ctor_rel_tac: Proof.context -> thm list -> int -> thm -> thm -> thm -> thm -> thm list -> |
27 val mk_ctor_rel_tac: Proof.context -> thm list -> int -> thm -> thm -> thm -> thm -> thm list -> |
26 thm -> thm -> thm list -> thm list -> thm list list -> tactic |
28 thm -> thm -> thm list -> thm list -> thm list list -> tactic |
27 val mk_dtor_o_ctor_tac: thm -> thm -> thm -> thm -> thm list -> tactic |
29 val mk_dtor_o_ctor_tac: thm -> thm -> thm -> thm -> thm list -> tactic |
28 val mk_init_ex_mor_tac: Proof.context -> thm -> thm -> thm list -> thm -> thm -> thm -> thm -> |
30 val mk_init_ex_mor_tac: Proof.context -> thm -> thm -> thm list -> thm -> thm -> thm -> thm -> |
29 tactic |
31 tactic |
699 atac]] |
701 atac]] |
700 in |
702 in |
701 EVERY' [rtac iffI, if_tac, only_if_tac] 1 |
703 EVERY' [rtac iffI, if_tac, only_if_tac] 1 |
702 end; |
704 end; |
703 |
705 |
|
706 fun mk_ctor_rec_transfer_tac ctxt n m ctor_rec_defs ctor_fold_transfers pre_T_map_transfers |
|
707 ctor_rels = |
|
708 let |
|
709 val rel_funD = @{thm rel_funD}; |
|
710 fun rel_funD_n n = funpow n (fn thm => thm RS rel_funD); |
|
711 val rel_funD_n_rotated = rotate_prems ~1 oo rel_funD_n; |
|
712 in |
|
713 CONJ_WRAP (fn (ctor_rec_def, ctor_fold_transfer) => |
|
714 REPEAT_DETERM (HEADGOAL (rtac @{thm rel_funI})) THEN |
|
715 unfold_thms_tac ctxt [ctor_rec_def, o_apply] THEN |
|
716 HEADGOAL (rtac @{thm rel_funD[OF snd_transfer]} THEN' |
|
717 etac (rel_funD_n_rotated (n + 1) ctor_fold_transfer) THEN' |
|
718 EVERY' (map2 (fn pre_T_map_transfer => fn ctor_rel => |
|
719 etac (rel_funD_n_rotated 2 @{thm convol_transfer}) THEN' |
|
720 rtac (rel_funD_n_rotated 2 @{thm comp_transfer}) THEN' |
|
721 rtac (rel_funD_n (m + n) pre_T_map_transfer) THEN' |
|
722 REPEAT_DETERM_N m o rtac @{thm id_transfer} THEN' |
|
723 REPEAT_DETERM o rtac @{thm fst_transfer} THEN' |
|
724 rtac @{thm rel_funI} THEN' |
|
725 etac (ctor_rel RS iffD2)) pre_T_map_transfers ctor_rels))) |
|
726 (ctor_rec_defs ~~ ctor_fold_transfers) |
|
727 end; |
|
728 |
704 fun mk_rel_induct_tac ctxt IHs m ctor_induct2 ks ctor_rels rel_mono_strong0s = |
729 fun mk_rel_induct_tac ctxt IHs m ctor_induct2 ks ctor_rels rel_mono_strong0s = |
705 let val n = length ks; |
730 let val n = length ks; |
706 in |
731 in |
707 unfold_tac ctxt @{thms le_fun_def le_bool_def all_simps(1,2)[symmetric]} THEN |
732 unfold_tac ctxt @{thms le_fun_def le_bool_def all_simps(1,2)[symmetric]} THEN |
708 EVERY' [REPEAT_DETERM o rtac allI, rtac ctor_induct2, |
733 EVERY' [REPEAT_DETERM o rtac allI, rtac ctor_induct2, |