Multisets
What Are Multisets
A multiset is a datatype for storing a set of objects where objects can occur more than once, but the ordering of objects does not matter.
Multisets have attributes and a single domain. A multiset can be defined for both GroundDomain and UnresolvedDomain.
Attributes
Three cardinality attributes; size, minSize, maxSize.
Two occurrence attributes; minOccur, maxOccur.
In the original conjure implementation, a multiset was infinite without size, maxSize, or maxOccur.
In the new conjure-oxide implementation, a variable’s domain is ground if it is fully-bounded (i.e. has a minSize and maxSize).
Operators
There are four operators which are defined on functions. These are represented as Expressions in Conjure-Oxide.
hist(m)- histogram of multi-setmmax(m)- largest element in ordered multisetmmin(m)- largest element in ordered multisetmfreq(m,e)- counts occurrences of elementein multisetm