1084 take_lemma_in_eq_out [THEN mp]) |
1084 take_lemma_in_eq_out [THEN mp]) |
1085 apply auto |
1085 apply auto |
1086 done |
1086 done |
1087 |
1087 |
1088 |
1088 |
1089 |
|
1090 ML {* |
1089 ML {* |
1091 |
1090 |
1092 local |
1091 fun Seq_case_tac ctxt s i = |
1093 val Seq_cases = thm "Seq_cases" |
1092 RuleInsts.res_inst_tac ctxt [(("x", 0), s)] @{thm Seq_cases} i |
1094 val Seq_induct = thm "Seq_induct" |
1093 THEN hyp_subst_tac i THEN hyp_subst_tac (i+1) THEN hyp_subst_tac (i+2); |
1095 val Seq_Finite_ind = thm "Seq_Finite_ind" |
|
1096 in |
|
1097 |
|
1098 fun Seq_case_tac s i = res_inst_tac [("x",s)] Seq_cases i |
|
1099 THEN hyp_subst_tac i THEN hyp_subst_tac (i+1) THEN hyp_subst_tac (i+2); |
|
1100 |
1094 |
1101 (* on a>>s only simp_tac, as full_simp_tac is uncomplete and often causes errors *) |
1095 (* on a>>s only simp_tac, as full_simp_tac is uncomplete and often causes errors *) |
1102 fun Seq_case_simp_tac s i = Seq_case_tac s i THEN SIMPSET' asm_simp_tac (i+2) |
1096 fun Seq_case_simp_tac ctxt s i = |
1103 THEN SIMPSET' asm_full_simp_tac (i+1) |
1097 let val ss = Simplifier.local_simpset_of ctxt in |
1104 THEN SIMPSET' asm_full_simp_tac i; |
1098 Seq_case_tac ctxt s i |
|
1099 THEN asm_simp_tac ss (i+2) |
|
1100 THEN asm_full_simp_tac ss (i+1) |
|
1101 THEN asm_full_simp_tac ss i |
|
1102 end; |
1105 |
1103 |
1106 (* rws are definitions to be unfolded for admissibility check *) |
1104 (* rws are definitions to be unfolded for admissibility check *) |
1107 fun Seq_induct_tac s rws i = res_inst_tac [("x",s)] Seq_induct i |
1105 fun Seq_induct_tac ctxt s rws i = |
1108 THEN (REPEAT_DETERM (CHANGED (SIMPSET' asm_simp_tac (i+1)))) |
1106 let val ss = Simplifier.local_simpset_of ctxt in |
1109 THEN SIMPSET' (fn ss => simp_tac (ss addsimps rws)) i; |
1107 RuleInsts.res_inst_tac ctxt [(("x", 0), s)] @{thm Seq_induct} i |
1110 |
1108 THEN (REPEAT_DETERM (CHANGED (asm_simp_tac ss (i+1)))) |
1111 fun Seq_Finite_induct_tac i = etac Seq_Finite_ind i |
1109 THEN simp_tac (ss addsimps rws) i |
1112 THEN (REPEAT_DETERM (CHANGED (SIMPSET' asm_simp_tac i))); |
1110 end; |
1113 |
1111 |
1114 fun pair_tac s = res_inst_tac [("p",s)] PairE |
1112 fun Seq_Finite_induct_tac ctxt i = |
1115 THEN' hyp_subst_tac THEN' SIMPSET' asm_full_simp_tac; |
1113 etac @{thm Seq_Finite_ind} i |
|
1114 THEN (REPEAT_DETERM (CHANGED (asm_simp_tac (Simplifier.local_simpset_of ctxt) i))); |
|
1115 |
|
1116 fun pair_tac ctxt s = |
|
1117 RuleInsts.res_inst_tac ctxt [(("p", 0), s)] PairE |
|
1118 THEN' hyp_subst_tac THEN' asm_full_simp_tac (Simplifier.local_simpset_of ctxt); |
1116 |
1119 |
1117 (* induction on a sequence of pairs with pairsplitting and simplification *) |
1120 (* induction on a sequence of pairs with pairsplitting and simplification *) |
1118 fun pair_induct_tac s rws i = |
1121 fun pair_induct_tac ctxt s rws i = |
1119 res_inst_tac [("x",s)] Seq_induct i |
1122 let val ss = Simplifier.local_simpset_of ctxt in |
1120 THEN pair_tac "a" (i+3) |
1123 RuleInsts.res_inst_tac ctxt [(("x", 0), s)] @{thm Seq_induct} i |
1121 THEN (REPEAT_DETERM (CHANGED (SIMPSET' simp_tac (i+1)))) |
1124 THEN pair_tac ctxt "a" (i+3) |
1122 THEN SIMPSET' (fn ss => simp_tac (ss addsimps rws)) i; |
1125 THEN (REPEAT_DETERM (CHANGED (simp_tac ss (i+1)))) |
|
1126 THEN simp_tac (ss addsimps rws) i |
|
1127 end; |
|
1128 |
|
1129 *} |
1123 |
1130 |
1124 end |
1131 end |
1125 |
|
1126 *} |
|
1127 |
|
1128 |
|
1129 end |
|