equal
deleted
inserted
replaced
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; |