theory Simproc_Match_Working imports Main begin ML\ fun sum_prod_simproc _ _ _ = let val _ = Pretty.writeln (Pretty.str "simproc triggered") in NONE end \ (* This simproc works as expected. However changing \f'\ to \f\ will break it (see Simproc_Match_Not_Working.thy). Changing the identifier for the set (here \A\) has no effect as far as I can tell, i.e. \("prod f A" | "sum f B")\ does not work either. *) simproc_setup sum_prod ("prod f A" | "sum f' A") = \sum_prod_simproc\ lemma "(\i=1..3. i) = (\i=0..2. i + 1)" apply simp sorry lemma "(\i=1..3. i) = (\i=0..2. i + 1)" apply simp sorry (* When not using \simproc_setup\ this problem does not arise. In the following the exact same patterns are used which break the \simproc_setup\ version, however in this case it works as expected. *) ML\ val sum_prod' = Simplifier.make_simproc \<^context> "sum_prod_simproc" {lhss = [\<^term>\prod f A\, \<^term>\sum f A\], proc = sum_prod_simproc} \ lemma "(\i=1..3. i) = (\i=0..2. i + 1)" apply (tactic \simp_tac ((put_simpset HOL_basic_ss \<^context>) addsimprocs [sum_prod']) 1\) sorry lemma "(\i=1..3. i) = (\i=0..2. i + 1)" apply (tactic \simp_tac ((put_simpset HOL_basic_ss \<^context>) addsimprocs [sum_prod']) 1\) sorry end