src/Pure/Isar/code.ML
changeset 82586 e55d712eff7b
parent 81521 1bfad73ab115
child 82592 a151c934824c
equal deleted inserted replaced
82585:46591222e4fc 82586:e55d712eff7b
  1388     val args = args_of thm;
  1388     val args = args_of thm;
  1389     val incr_idx = Logic.incr_indexes ([], Thm.maxidx_of thm + 1);
  1389     val incr_idx = Logic.incr_indexes ([], Thm.maxidx_of thm + 1);
  1390     fun matches_args args' =
  1390     fun matches_args args' =
  1391       let
  1391       let
  1392         val k = length args' - length args
  1392         val k = length args' - length args
  1393       in if k >= 0
  1393       in k >= 0 andalso Pattern.matchess thy (args, (map incr_idx o drop k) args') end;
  1394         then Pattern.matchess thy (args, (map incr_idx o drop k) args')
       
  1395         else false
       
  1396       end;
       
  1397     fun drop (thm', proper') = if (proper orelse not proper')
  1394     fun drop (thm', proper') = if (proper orelse not proper')
  1398       andalso matches_args (args_of thm') then
  1395       andalso matches_args (args_of thm') then
  1399         (if verbose then warning ("Code generator: dropping subsumed code equation\n" ^
  1396         (if verbose then warning ("Code generator: dropping subsumed code equation\n" ^
  1400             Thm.string_of_thm_global thy thm') else (); true)
  1397             Thm.string_of_thm_global thy thm') else (); true)
  1401       else false;
  1398       else false;