# FiniteSetAggregate SΒΆ

- S: SetCategory

A finite-set aggregate models the notion of a finite set, that is, a collection of elements characterized by membership, but not by order or multiplicity. See Set for an example.

- <: (%, %) -> Boolean
- from PartialOrder
- <=: (%, %) -> Boolean
- from PartialOrder
- =: (%, %) -> Boolean
- from BasicType
- >: (%, %) -> Boolean
- from PartialOrder
- >=: (%, %) -> Boolean
- from PartialOrder
- ~=: (%, %) -> Boolean
- from BasicType
- brace: () -> %
- from SetAggregate S
- brace: List S -> %
- from SetAggregate S

- cardinality: % -> NonNegativeInteger
`cardinality(u)`

returns the number of elements of`u`

. Note:`cardinality(u) = \#u`

.- coerce: % -> OutputForm
- from CoercibleTo OutputForm

- complement: % -> % if S has Finite
`complement(u)`

returns the complement of the set`u`

, i.e. the set of all values not in`u`

.- construct: List S -> %
- from Collection S
- convert: % -> InputForm if S has ConvertibleTo InputForm
- from ConvertibleTo InputForm
- copy: % -> %
- from Aggregate
- count: (S, %) -> NonNegativeInteger
- from HomogeneousAggregate S
- dictionary: () -> %
- from DictionaryOperations S
- dictionary: List S -> %
- from DictionaryOperations S
- difference: (%, %) -> %
- from SetAggregate S
- difference: (%, S) -> %
- from SetAggregate S
- empty: () -> %
- from Aggregate
- empty?: % -> Boolean
- from Aggregate
- enumerate: () -> List % if S has Finite
- from Finite
- eq?: (%, %) -> Boolean
- from Aggregate
- eval: (%, Equation S) -> % if S has Evalable S
- from Evalable S
- eval: (%, List Equation S) -> % if S has Evalable S
- from Evalable S
- eval: (%, List S, List S) -> % if S has Evalable S
- from InnerEvalable(S, S)
- eval: (%, S, S) -> % if S has Evalable S
- from InnerEvalable(S, S)
- extract!: % -> S
- from BagAggregate S
- find: (S -> Boolean, %) -> Union(S, failed)
- from Collection S
- hash: % -> SingleInteger
- from SetCategory
- hashUpdate!: (HashState, %) -> HashState
- from SetCategory
- index: PositiveInteger -> % if S has Finite
- from Finite
- insert!: (S, %) -> %
- from BagAggregate S
- inspect: % -> S
- from BagAggregate S
- intersect: (%, %) -> %
- from SetAggregate S
- latex: % -> String
- from SetCategory
- less?: (%, NonNegativeInteger) -> Boolean
- from Aggregate
- lookup: % -> PositiveInteger if S has Finite
- from Finite
- map: (S -> S, %) -> %
- from HomogeneousAggregate S

- max: % -> S if S has OrderedSet
`max(u)`

returns the largest element of aggregate`u`

.- member?: (S, %) -> Boolean
- from HomogeneousAggregate S

- min: % -> S if S has OrderedSet
`min(u)`

returns the smallest element of aggregate`u`

.- more?: (%, NonNegativeInteger) -> Boolean
- from Aggregate
- random: () -> % if S has Finite
- from Finite
- reduce: ((S, S) -> S, %, S, S) -> S
- from Collection S
- remove!: (S, %) -> %
- from DictionaryOperations S
- remove: (S, %) -> %
- from Collection S
- removeDuplicates: % -> %
- from Collection S
- sample: %
- from Aggregate
- set: () -> %
- from SetAggregate S
- set: List S -> %
- from SetAggregate S
- size: () -> NonNegativeInteger if S has Finite
- from Finite
- size?: (%, NonNegativeInteger) -> Boolean
- from Aggregate
- smaller?: (%, %) -> Boolean if S has Comparable
- from Comparable
- subset?: (%, %) -> Boolean
- from SetAggregate S
- symmetricDifference: (%, %) -> %
- from SetAggregate S
- union: (%, %) -> %
- from SetAggregate S
- union: (%, S) -> %
- from SetAggregate S
- union: (S, %) -> %
- from SetAggregate S

- universe: () -> % if S has Finite
`universe()`

$`D`

returns the universal set for finite set aggregate`D`

.

Comparable if S has Comparable

ConvertibleTo InputForm if S has ConvertibleTo InputForm

Evalable S if S has Evalable S

InnerEvalable(S, S) if S has Evalable S