src/HOL/Library/EfficientNat.thy
changeset 15574 b1d1b5bfc464
parent 15570 8d8c70b41bab
child 16295 cd7a83dae4f9
equal deleted inserted replaced
15573:cf53c2dcf440 15574:b1d1b5bfc464
   189 
   189 
   190 fun clause_suc_preproc thy ths =
   190 fun clause_suc_preproc thy ths =
   191   let val dest = fst o HOLogic.dest_mem o HOLogic.dest_Trueprop
   191   let val dest = fst o HOLogic.dest_mem o HOLogic.dest_Trueprop
   192   in
   192   in
   193     if forall (can (dest o concl_of)) ths andalso
   193     if forall (can (dest o concl_of)) ths andalso
   194       exists (fn th => "Suc" mem Library.foldr add_term_consts
   194       exists (fn th => "Suc" mem foldr add_term_consts
   195         (List.mapPartial (try dest) (concl_of th :: prems_of th), [])) ths
   195         [] (List.mapPartial (try dest) (concl_of th :: prems_of th))) ths
   196     then remove_suc_clause thy ths else ths
   196     then remove_suc_clause thy ths else ths
   197   end;
   197   end;
   198 
   198 
   199 val suc_preproc_setup =
   199 val suc_preproc_setup =
   200   [Codegen.add_preprocessor eqn_suc_preproc,
   200   [Codegen.add_preprocessor eqn_suc_preproc,