equal
deleted
inserted
replaced
1565 | is_conj _ = false |
1565 | is_conj _ = false |
1566 in if is_conj P then SOME @{thm induct_conj_curry} else NONE end |
1566 in if is_conj P then SOME @{thm induct_conj_curry} else NONE end |
1567 | _ => NONE)\<close> |
1567 | _ => NONE)\<close> |
1568 |
1568 |
1569 declaration \<open> |
1569 declaration \<open> |
1570 K (Induct.map_simpset (fn ss => ss |
1570 K (Induct.map_simpset |
1571 addsimprocs [\<^simproc>\<open>swap_induct_false\<close>, \<^simproc>\<open>induct_equal_conj_curry\<close>] |
1571 (Simplifier.add_proc \<^simproc>\<open>swap_induct_false\<close> #> |
1572 |> Simplifier.set_mksimps (fn ctxt => |
1572 Simplifier.add_proc \<^simproc>\<open>induct_equal_conj_curry\<close> #> |
1573 Simpdata.mksimps Simpdata.mksimps_pairs ctxt #> |
1573 Simplifier.set_mksimps (fn ctxt => |
1574 map (rewrite_rule ctxt (map Thm.symmetric @{thms induct_rulify_fallback}))))) |
1574 Simpdata.mksimps Simpdata.mksimps_pairs ctxt #> |
|
1575 map (rewrite_rule ctxt (map Thm.symmetric @{thms induct_rulify_fallback}))))) |
1575 \<close> |
1576 \<close> |
1576 |
1577 |
1577 text \<open>Pre-simplification of induction and cases rules\<close> |
1578 text \<open>Pre-simplification of induction and cases rules\<close> |
1578 |
1579 |
1579 lemma [induct_simp]: "(\<And>x. induct_equal x t \<Longrightarrow> PROP P x) \<equiv> PROP P t" |
1580 lemma [induct_simp]: "(\<And>x. induct_equal x t \<Longrightarrow> PROP P x) \<equiv> PROP P t" |
1940 \<open>fn _ => fn _ => fn ct => |
1941 \<open>fn _ => fn _ => fn ct => |
1941 (case Thm.term_of ct of |
1942 (case Thm.term_of ct of |
1942 \<^Const_>\<open>HOL.eq T\<close> => if is_Type T then SOME @{thm eq_equal} else NONE |
1943 \<^Const_>\<open>HOL.eq T\<close> => if is_Type T then SOME @{thm eq_equal} else NONE |
1943 | _ => NONE)\<close> |
1944 | _ => NONE)\<close> |
1944 |
1945 |
1945 setup \<open>Code_Preproc.map_pre (fn ctxt => ctxt addsimprocs [\<^simproc>\<open>equal\<close>])\<close> |
1946 setup \<open>Code_Preproc.map_pre (Simplifier.add_proc \<^simproc>\<open>equal\<close>)\<close> |
1946 |
1947 |
1947 |
1948 |
1948 subsubsection \<open>Generic code generator foundation\<close> |
1949 subsubsection \<open>Generic code generator foundation\<close> |
1949 |
1950 |
1950 text \<open>Datatype \<^typ>\<open>bool\<close>\<close> |
1951 text \<open>Datatype \<^typ>\<open>bool\<close>\<close> |