sig
module type Item =
sig
type t
val equal : UnionFind.Item.t -> UnionFind.Item.t -> bool
module Map :
sig
type key = UnionFind.Item.t
type 'a t
val empty : 'a UnionFind.Item.Map.t
val find : UnionFind.Item.Map.key -> 'a UnionFind.Item.Map.t -> 'a
val add :
UnionFind.Item.Map.key ->
'a -> 'a UnionFind.Item.Map.t -> 'a UnionFind.Item.Map.t
val fold :
(UnionFind.Item.Map.key -> 'a -> 'b -> 'b) ->
'a UnionFind.Item.Map.t -> 'b -> 'b
end
end
module type Desc =
sig
type descriptor
val default : UnionFind.Desc.descriptor
type accumulator
val union :
UnionFind.Desc.descriptor ->
UnionFind.Desc.descriptor ->
UnionFind.Desc.accumulator ->
UnionFind.Desc.descriptor * UnionFind.Desc.accumulator
end
module type S =
sig
type item
type descriptor
type accumulator
type state
val initial : UnionFind.S.state
val representative :
UnionFind.S.item -> UnionFind.S.state -> UnionFind.S.item
val equivalent :
UnionFind.S.item -> UnionFind.S.item -> UnionFind.S.state -> bool
val descriptor :
UnionFind.S.item -> UnionFind.S.state -> UnionFind.S.descriptor
val set :
UnionFind.S.item ->
UnionFind.S.descriptor -> UnionFind.S.state -> UnionFind.S.state
val union :
UnionFind.S.item ->
UnionFind.S.item ->
UnionFind.S.state ->
UnionFind.S.accumulator ->
UnionFind.S.state * UnionFind.S.accumulator
val domain : UnionFind.S.state -> UnionFind.S.item list
end
module Make :
functor (Item : Item) ->
functor (Desc : Desc) ->
sig
type item = Item.t
type descriptor = Desc.descriptor
type accumulator = Desc.accumulator
type state
val initial : state
val representative : item -> state -> item
val equivalent : item -> item -> state -> bool
val descriptor : item -> state -> descriptor
val set : item -> descriptor -> state -> state
val union :
item -> item -> state -> accumulator -> state * accumulator
val domain : state -> item list
end
end