Skip to content
Snippets Groups Projects
Commit 202433a6 authored by Thorsten Wißmann's avatar Thorsten Wißmann :guitar:
Browse files

Beautify conversion cliques->coalitions

The code converting maximal cliques to coalitions of CL is now much more
readable.
parent 6e618918
No related branches found
No related tags found
No related merge requests found
......@@ -91,11 +91,16 @@ let maxDisjoints sort (a: bset) : bset list =
print_endline ("Cliqu: "^ String.concat "," s)
);
*)
let tmpf : bset -> int -> bset =
(fun bs f -> bsetAdd bs (lfFromInt f) ; bs)
in
List.map (fun x -> List.fold_left tmpf (bsetMakeRealEmpty ()) x)
(List.map S.elements intlist)
flip List.map intlist (fun elements ->
(* for each maximal clique "elements", do: *)
let elements = S.elements elements in (* obtain a list of ints *)
let elements = L.map lfFromInt elements in (* convert them to local formulas *)
(* throw them into a bset *)
let bs = (bsetMakeRealEmpty ()) in
List.iter (bsetAdd bs) elements;
bs
)
let string_of_coalition sort bs =
let modlist = bsetFold (fun x l -> x::l) bs [] in
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment