988 THEN' hyp_subst_tac ctxt THEN' asm_full_simp_tac ctxt; |
988 THEN' hyp_subst_tac ctxt THEN' asm_full_simp_tac ctxt; |
989 |
989 |
990 (* induction on a sequence of pairs with pairsplitting and simplification *) |
990 (* induction on a sequence of pairs with pairsplitting and simplification *) |
991 fun pair_induct_tac ctxt s rws i = |
991 fun pair_induct_tac ctxt s rws i = |
992 Rule_Insts.res_inst_tac ctxt [((("x", 0), Position.none), s)] [] @{thm Seq_induct} i |
992 Rule_Insts.res_inst_tac ctxt [((("x", 0), Position.none), s)] [] @{thm Seq_induct} i |
993 THEN pair_tac ctxt "a" (i+3) |
993 THEN pair_tac ctxt "a" (i + 3) |
994 THEN (REPEAT_DETERM (CHANGED (simp_tac ctxt (i+1)))) |
994 THEN (REPEAT_DETERM (CHANGED (simp_tac ctxt (i + 1)))) |
995 THEN simp_tac (ctxt addsimps rws) i; |
995 THEN simp_tac (ctxt addsimps rws) i; |
996 \<close> |
996 \<close> |
997 |
997 |
|
998 method_setup Seq_case = |
|
999 \<open>Scan.lift Args.name >> (fn s => fn ctxt => SIMPLE_METHOD' (Seq_case_tac ctxt s))\<close> |
|
1000 |
|
1001 method_setup Seq_case_simp = |
|
1002 \<open>Scan.lift Args.name >> (fn s => fn ctxt => SIMPLE_METHOD' (Seq_case_simp_tac ctxt s))\<close> |
|
1003 |
|
1004 method_setup Seq_induct = |
|
1005 \<open>Scan.lift Args.name -- |
|
1006 Scan.optional ((Scan.lift (Args.$$$ "simp" -- Args.colon) |-- Attrib.thms)) [] |
|
1007 >> (fn (s, rws) => fn ctxt => SIMPLE_METHOD' (Seq_induct_tac ctxt s rws))\<close> |
|
1008 |
|
1009 method_setup Seq_Finite_induct = |
|
1010 \<open>Scan.succeed (SIMPLE_METHOD' o Seq_Finite_induct_tac)\<close> |
|
1011 |
|
1012 method_setup pair = |
|
1013 \<open>Scan.lift Args.name >> (fn s => fn ctxt => SIMPLE_METHOD' (pair_tac ctxt s))\<close> |
|
1014 |
|
1015 method_setup pair_induct = |
|
1016 \<open>Scan.lift Args.name -- |
|
1017 Scan.optional ((Scan.lift (Args.$$$ "simp" -- Args.colon) |-- Attrib.thms)) [] |
|
1018 >> (fn (s, rws) => fn ctxt => SIMPLE_METHOD' (pair_induct_tac ctxt s rws))\<close> |
|
1019 |
998 lemma Mapnil: "Map f $ s = nil \<longleftrightarrow> s = nil" |
1020 lemma Mapnil: "Map f $ s = nil \<longleftrightarrow> s = nil" |
999 by (tactic \<open>Seq_case_simp_tac @{context} "s" 1\<close>) |
1021 by (Seq_case_simp s) |
1000 |
1022 |
1001 lemma MapUU: "Map f $ s = UU \<longleftrightarrow> s = UU" |
1023 lemma MapUU: "Map f $ s = UU \<longleftrightarrow> s = UU" |
1002 by (tactic \<open>Seq_case_simp_tac @{context} "s" 1\<close>) |
1024 by (Seq_case_simp s) |
1003 |
1025 |
1004 lemma MapTL: "Map f $ (TL $ s) = TL $ (Map f $ s)" |
1026 lemma MapTL: "Map f $ (TL $ s) = TL $ (Map f $ s)" |
1005 by (tactic \<open>Seq_induct_tac @{context} "s" [] 1\<close>) |
1027 by (Seq_induct s) |
1006 |
1028 |
1007 end |
1029 end |