Module UnionFind.Make
Parameters
X : Element
XSet : IStdlib.IStd.Caml.Set.S with type XSet.elt = X.t
XMap : IStdlib.IStd.Caml.Map.S with type XMap.key = X.t
Signature
type repr
= private X.t
val empty : t
val union : t -> X.t -> X.t -> t * (X.t * repr) option
return the optional new equality added between the old representatives of the two items in the form of "old representative = new representative",
None
if they were already in the same congruence class
val fold_congruences : (t, repr * XSet.t, 'acc) IStdlib.IStd.Container.fold
fold over the equivalence classes of the relation, singling out the representative for each class
val reorient : keep:XSet.t -> t -> X.t XMap.t
the relation
x -> x'
derived from the equality relation that relates allx
,x'
such thatx∉keep
,x'∈keep
, andx=x'
, as well asy -> y'
when no element in the equivalence class ofy
belongs tokeep
andy'
is the representative of the class