36 fun mk_unique_disc_def_tac m exhaust' = |
36 fun mk_unique_disc_def_tac m exhaust' = |
37 EVERY' [rtac iffI, rtac exhaust', REPEAT_DETERM_N m o rtac exI, atac, rtac refl] 1; |
37 EVERY' [rtac iffI, rtac exhaust', REPEAT_DETERM_N m o rtac exI, atac, rtac refl] 1; |
38 |
38 |
39 fun mk_alternate_disc_def_tac ctxt k other_disc_def distinct exhaust' = |
39 fun mk_alternate_disc_def_tac ctxt k other_disc_def distinct exhaust' = |
40 EVERY' ([subst_tac ctxt [other_disc_def], rtac @{thm iffI_np}, REPEAT_DETERM o etac exE, |
40 EVERY' ([subst_tac ctxt [other_disc_def], rtac @{thm iffI_np}, REPEAT_DETERM o etac exE, |
41 hyp_subst_tac, SELECT_GOAL (Local_Defs.unfold_tac ctxt [not_ex]), REPEAT_DETERM o rtac allI, |
41 hyp_subst_tac, SELECT_GOAL (unfold_defs_tac ctxt [not_ex]), REPEAT_DETERM o rtac allI, |
42 rtac distinct, rtac exhaust'] @ |
42 rtac distinct, rtac exhaust'] @ |
43 (([etac notE, REPEAT_DETERM o rtac exI, atac], [REPEAT_DETERM o rtac exI, atac]) |
43 (([etac notE, REPEAT_DETERM o rtac exI, atac], [REPEAT_DETERM o rtac exI, atac]) |
44 |> k = 1 ? swap |> op @)) 1; |
44 |> k = 1 ? swap |> op @)) 1; |
45 |
45 |
46 fun mk_half_disc_exclude_tac m discD disc'_thm = |
46 fun mk_half_disc_exclude_tac m discD disc'_thm = |
62 (if m = 0 then |
62 (if m = 0 then |
63 atac |
63 atac |
64 else |
64 else |
65 REPEAT_DETERM_N m o etac exE THEN' |
65 REPEAT_DETERM_N m o etac exE THEN' |
66 hyp_subst_tac THEN' |
66 hyp_subst_tac THEN' |
67 SELECT_GOAL (Local_Defs.unfold_tac ctxt sel_thms) THEN' |
67 SELECT_GOAL (unfold_defs_tac ctxt sel_thms) THEN' |
68 rtac refl)) 1; |
68 rtac refl)) 1; |
69 |
69 |
70 fun mk_case_eq_tac ctxt n exhaust' case_thms disc_thmss' sel_thmss = |
70 fun mk_case_eq_tac ctxt n exhaust' case_thms disc_thmss' sel_thmss = |
71 (rtac exhaust' THEN' |
71 (rtac exhaust' THEN' |
72 EVERY' (map3 (fn case_thm => fn if_disc_thms => fn sel_thms => |
72 EVERY' (map3 (fn case_thm => fn if_disc_thms => fn sel_thms => |
73 EVERY' [hyp_subst_tac, SELECT_GOAL (Local_Defs.unfold_tac ctxt (if_disc_thms @ sel_thms)), |
73 EVERY' [hyp_subst_tac, SELECT_GOAL (unfold_defs_tac ctxt (if_disc_thms @ sel_thms)), |
74 rtac case_thm]) |
74 rtac case_thm]) |
75 case_thms (map2 (seq_conds if_P_or_not_P_OF n) (1 upto n) disc_thmss') sel_thmss)) 1; |
75 case_thms (map2 (seq_conds if_P_or_not_P_OF n) (1 upto n) disc_thmss') sel_thmss)) 1; |
76 |
76 |
77 fun mk_case_cong_tac exhaust' case_thms = |
77 fun mk_case_cong_tac exhaust' case_thms = |
78 (rtac exhaust' THEN' |
78 (rtac exhaust' THEN' |