src/Pure/Isar/code.ML
changeset 33957 e9afca2118d4
parent 33955 fff6f11b1f09
child 33969 1e7ca47c6c3d
equal deleted inserted replaced
33956:6f549f5e7066 33957:e9afca2118d4
   126     val args_of = snd o strip_comb o map_types Type.strip_sorts
   126     val args_of = snd o strip_comb o map_types Type.strip_sorts
   127       o fst o Logic.dest_equals o Thm.plain_prop_of;
   127       o fst o Logic.dest_equals o Thm.plain_prop_of;
   128     val args = args_of thm;
   128     val args = args_of thm;
   129     val incr_idx = Logic.incr_indexes ([], Thm.maxidx_of thm + 1);
   129     val incr_idx = Logic.incr_indexes ([], Thm.maxidx_of thm + 1);
   130     fun matches_args args' = length args <= length args' andalso
   130     fun matches_args args' = length args <= length args' andalso
   131       Pattern.matchess thy (args, (map incr_idx o curry (uncurry take) (length args)) args');
   131       Pattern.matchess thy (args, (map incr_idx o take (length args)) args');
   132     fun drop (thm', proper') = if (proper orelse not proper')
   132     fun drop (thm', proper') = if (proper orelse not proper')
   133       andalso matches_args (args_of thm') then 
   133       andalso matches_args (args_of thm') then 
   134         (warning ("Code generator: dropping redundant code equation\n" ^
   134         (warning ("Code generator: dropping redundant code equation\n" ^
   135             Display.string_of_thm_global thy thm'); true)
   135             Display.string_of_thm_global thy thm'); true)
   136       else false;
   136       else false;