src/HOL/Library/Efficient_Nat.thy
changeset 31090 3be41b271023
parent 30663 0b6aff7451b2
child 31128 b3bb28c87409
equal deleted inserted replaced
31089:11001968caae 31090:3be41b271023
   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