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 = ...@@ -91,11 +91,16 @@ let maxDisjoints sort (a: bset) : bset list =
print_endline ("Cliqu: "^ String.concat "," s) print_endline ("Cliqu: "^ String.concat "," s)
); );
*) *)
let tmpf : bset -> int -> bset = flip List.map intlist (fun elements ->
(fun bs f -> bsetAdd bs (lfFromInt f) ; bs) (* for each maximal clique "elements", do: *)
in let elements = S.elements elements in (* obtain a list of ints *)
List.map (fun x -> List.fold_left tmpf (bsetMakeRealEmpty ()) x) let elements = L.map lfFromInt elements in (* convert them to local formulas *)
(List.map S.elements intlist) (* throw them into a bset *)
let bs = (bsetMakeRealEmpty ()) in
List.iter (bsetAdd bs) elements;
bs
)
let string_of_coalition sort bs = let string_of_coalition sort bs =
let modlist = bsetFold (fun x l -> x::l) bs [] in 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