equal
deleted
inserted
replaced
1493 use "~~/src/Tools/induction.ML" |
1493 use "~~/src/Tools/induction.ML" |
1494 |
1494 |
1495 setup {* |
1495 setup {* |
1496 Induct.setup #> Induction.setup #> |
1496 Induct.setup #> Induction.setup #> |
1497 Context.theory_map (Induct.map_simpset (fn ss => ss |
1497 Context.theory_map (Induct.map_simpset (fn ss => ss |
1498 setmksimps (fn ss => Simpdata.mksimps Simpdata.mksimps_pairs ss #> |
|
1499 map (Simplifier.rewrite_rule (map Thm.symmetric |
|
1500 @{thms induct_rulify_fallback}))) |
|
1501 addsimprocs |
1498 addsimprocs |
1502 [Simplifier.simproc_global @{theory} "swap_induct_false" |
1499 [Simplifier.simproc_global @{theory} "swap_induct_false" |
1503 ["induct_false ==> PROP P ==> PROP Q"] |
1500 ["induct_false ==> PROP P ==> PROP Q"] |
1504 (fn _ => fn _ => |
1501 (fn _ => fn _ => |
1505 (fn _ $ (P as _ $ @{const induct_false}) $ (_ $ Q $ _) => |
1502 (fn _ $ (P as _ $ @{const induct_false}) $ (_ $ Q $ _) => |
1515 | is_conj (Const (@{const_name induct_equal}, _) $ _ $ _) = true |
1512 | is_conj (Const (@{const_name induct_equal}, _) $ _ $ _) = true |
1516 | is_conj @{const induct_true} = true |
1513 | is_conj @{const induct_true} = true |
1517 | is_conj @{const induct_false} = true |
1514 | is_conj @{const induct_false} = true |
1518 | is_conj _ = false |
1515 | is_conj _ = false |
1519 in if is_conj P then SOME @{thm induct_conj_curry} else NONE end |
1516 in if is_conj P then SOME @{thm induct_conj_curry} else NONE end |
1520 | _ => NONE))])) |
1517 | _ => NONE))] |
|
1518 |> Simplifier.set_mksimps (fn ss => Simpdata.mksimps Simpdata.mksimps_pairs ss #> |
|
1519 map (Simplifier.rewrite_rule (map Thm.symmetric |
|
1520 @{thms induct_rulify_fallback}))))) |
1521 *} |
1521 *} |
1522 |
1522 |
1523 text {* Pre-simplification of induction and cases rules *} |
1523 text {* Pre-simplification of induction and cases rules *} |
1524 |
1524 |
1525 lemma [induct_simp]: "(!!x. induct_equal x t ==> PROP P x) == PROP P t" |
1525 lemma [induct_simp]: "(!!x. induct_equal x t ==> PROP P x) == PROP P t" |