src/Pure/sorts.ML
changeset 30062 ace8a0847002
parent 30060 672012330c4e
child 30065 c9a1e0f7621b
equal deleted inserted replaced
30061:c95e8f696b68 30062:ace8a0847002
   323     val restrict_sort = minimize_sort algebra o filter P o Graph.all_succs classes;
   323     val restrict_sort = minimize_sort algebra o filter P o Graph.all_succs classes;
   324     fun restrict_arity tyco (c, (_, Ss)) =
   324     fun restrict_arity tyco (c, (_, Ss)) =
   325       if P c then case sargs (c, tyco)
   325       if P c then case sargs (c, tyco)
   326        of SOME sorts => SOME (c, (c, Ss |> map2 (curry (inter_sort algebra)) sorts
   326        of SOME sorts => SOME (c, (c, Ss |> map2 (curry (inter_sort algebra)) sorts
   327           |> map restrict_sort))
   327           |> map restrict_sort))
       
   328         | NONE => NONE
   328       else NONE;
   329       else NONE;
   329     val classes' = classes |> Graph.subgraph P;
   330     val classes' = classes |> Graph.subgraph P;
   330     val arities' = arities |> Symtab.map' (map_filter o restrict_arity);
   331     val arities' = arities |> Symtab.map' (map_filter o restrict_arity);
   331   in (restrict_sort, rebuild_arities pp (make_algebra (classes', arities'))) end;
   332   in (restrict_sort, rebuild_arities pp (make_algebra (classes', arities'))) end;
   332 
   333