Module UnionFind.Make
Parameters
X : ElementXSet : IStdlib.IStd.Caml.Set.S with type XSet.elt = X.tXMap : IStdlib.IStd.Caml.Map.S with type XMap.key = X.t
Signature
type repr= private X.t
val empty : tval union : t -> X.t -> X.t -> t * (X.t * repr) optionreturn the optional new equality added between the old representatives of the two items in the form of "old representative = new representative",
Noneif they were already in the same congruence class
val fold_congruences : (t, repr * XSet.t, 'acc) IStdlib.IStd.Container.foldfold over the equivalence classes of the relation, singling out the representative for each class
val reorient : should_keep:(X.t -> bool) -> t -> X.t XMap.tthe relation
x -> x'derived from the equality relation that relates allx,x'such that¬(should_keep x),should_keep x', andx=x', as well asy -> y'when no element in the equivalence class ofysatisfiesshould_keepandy'is the representative of the class