Module type Equality_sig.S

module type S = sig .. end
Representation of an equality between a set of elements. The signatures is roughly a subset of Ocaml's Set.S. An equality always contains at least two elements; operations that break this invariant return `Void.

include Datatype.S
type elt 
The type of the equality elements.
val pair : elt -> elt -> t Equality_sig.trivial
The equality between two elements.
val mem : elt -> t -> bool
mem x s tests whether x belongs to the equality s.
val add : elt -> t -> t
add x s returns the equality between all elements of s and x.
val remove : elt -> t -> t Equality_sig.trivial
remove x s returns the equality between all elements of s, except x.
val union : t -> t -> t
Union.
val inter : t -> t -> t Equality_sig.trivial
Intersection.
val intersects : t -> t -> bool
intersect s s' = true iff the two equalities both involve the same element.
val compare : t -> t -> int
val equal : t -> t -> bool
val subset : t -> t -> bool
val iter : (elt -> unit) -> t -> unit
iter f s applies f in turn to all elements of s.
val fold : (elt -> 'a -> 'a) -> t -> 'a -> 'a
fold f s a computes (f xN ... (f x2 (f x1 a))...), where x1 ... xN are the elements of s, in increasing order.
val for_all : (elt -> bool) -> t -> bool
for_all p s checks if all elements of the equality satisfy the predicate p.
val exists : (elt -> bool) -> t -> bool
exists p s checks if at least one element of the equality satisfies the predicate p.
val filter : (elt -> bool) -> t -> t Equality_sig.trivial
filter p s returns the equality between all elements in s that satisfy predicate p.
val cardinal : t -> int
Return the number of elements of the equality.
val choose : t -> elt
Return the representative of the equality.