Constr.StringSet.union set (Constr.constants_of t))
Constr.StringSet.empty context
-let intersect l1 l2 =
- let set1 = List.fold_right Constr.StringSet.add l1 Constr.StringSet.empty in
- let set2 = List.fold_right Constr.StringSet.add l2 Constr.StringSet.empty in
- Constr.StringSet.elements (Constr.StringSet.inter set1 set2)
+let intersect uris siguris =
+ let set1 = List.fold_right Constr.StringSet.add uris Constr.StringSet.empty in
+ let set2 =
+ List.fold_right Constr.StringSet.add siguris Constr.StringSet.empty
+ in
+ let inter = Constr.StringSet.inter set1 set2 in
+ List.filter (fun s -> Constr.StringSet.mem s inter) uris
let filter_uris_forward ~dbh (main, constants) uris =
let main_uris =
end else
filter_uris_backward ~dbh (main, other_constants) uris
in
-prerr_endline "URIS";
-List.iter prerr_endline uris;
let rec aux = function
| [] -> []
| uri :: tl ->
prerr_endline ("HO APPLICATO " ^ uri);
status' :: aux tl)
in
- aux uris
+ List.stable_sort
+ (fun (_, (_, goals1)) (_, (_, goals2)) ->
+ Pervasives.compare (List.length goals1) (List.length goals2))
+ (aux uris)
let elim ~dbh uri =
let constraints =