A complement set represents the complement of a normal, enumerated set. That is, the complement of a set S contains every object that is not in S, and does not contain any object that is in S.
Complement sets are infinite, so they can’t be iterated over, and calling arb or size
on one is an error, but some operations are available on them. They can be unioned, intersected,
etc. with each other and with normal sets.
I don’t think of complement sets as adding much functionality; they are mostly just a notational convenience. One thing they do add is a representation of the full set, the set containing everything, which is sometimes handy, being the identity element for the intersection operation.
A representation of the complement of a normal, enumerated set. Subclass of set.
Complement sets are printed as a tilde (~) followed by the set they’re the complement of.
Returns true iff x is a complement set.
Returns a complement-set whose complement is s.
(This is consistent with cl:complement, which complements a boolean function, because a set
can be considered as a boolean function.)
Returns the normal set of which cs is the complement.
Returns the full set, the complement of the empty set.
The operations available on complement sets. (I’ve added the two bag-product methods because
the full set is the identity value for the bag product operation: it contains every value with
multiplicity 1.)