equal
deleted
inserted
replaced
177 if forall (can dest) thms andalso exists (contains_suc o dest) thms |
177 if forall (can dest) thms andalso exists (contains_suc o dest) thms |
178 then perhaps_loop (gen_remove_suc Suc_if_eq dest_judgement thy) thms |
178 then perhaps_loop (gen_remove_suc Suc_if_eq dest_judgement thy) thms |
179 else NONE |
179 else NONE |
180 end; |
180 end; |
181 |
181 |
182 fun eqn_suc_preproc thy = map fst |
182 val eqn_suc_preproc = Code.simple_functrans (gen_eqn_suc_preproc |
183 #> gen_eqn_suc_preproc |
183 @{thm Suc_if_eq} I (fst o Logic.dest_equals)); |
184 @{thm Suc_if_eq} I (fst o Logic.dest_equals) thy |
|
185 #> (Option.map o map) (Code_Unit.mk_eqn thy); |
|
186 |
184 |
187 fun eqn_suc_preproc' thy thms = gen_eqn_suc_preproc |
185 fun eqn_suc_preproc' thy thms = gen_eqn_suc_preproc |
188 @{thm Suc_if_eq'} (snd o Thm.dest_comb) (fst o HOLogic.dest_eq o HOLogic.dest_Trueprop) thy thms |
186 @{thm Suc_if_eq'} (snd o Thm.dest_comb) (fst o HOLogic.dest_eq o HOLogic.dest_Trueprop) thy thms |
189 |> the_default thms; |
187 |> the_default thms; |
190 |
188 |