type elt = X.t
Elements of the multiset
val size : t -> int
Number of distinct elements.
Number of unique occurrences of elements (the multiplicity of each element is considered)
val empty : t
val is_empty : t -> bool
Is the multiset empty?
Return the multiplicity of the element within the multiset. Will return
Z.zero if the element is not part of the multiset
Difference of multisets. If
x has a bigger multiplicity in the second argument it won't appear in the result
Filter out elements that don't satisfy the predicate
Apply a function to all coefficients.
More powerful mapping
module Seq : sig ... end
Iterate on elements with their multiplicity
Fold on elements with their multiplicity
From list of elements with multiplicities. Multiplicities lower than 0 will not count.
Remove common elements from the multisets. For instance, on
cancel will return
In the following, the comparison function must be equality-compatible with
E.compare. In other words, if
E.compare x y = 0 then
f x y = Comparison.Eq must hold.
Compare two multisets with the multiset extension of the given ordering. This ordering is total iff the element ordering is.
Is the given element maximal (ie not dominated by any other element) within the multiset?
Maximal elements of the multiset, w.r.t the given ordering.
Fold on maximal elements
Compare two multisets represented as list of elements