]>
The Set domain allows one to represent explicit finite sets of values. These are similar to lists, but duplicate elements are not allowed.
Sets can be created by giving a fixed set of values ...
or by using a collect form, just as for lists. In either case, the set is formed from a finite collection of values.
The basic operations on sets are intersectintersectSet, unionunionSet, differencedifferenceSet, and symmetricDifferencesymmetricDifferenceSet.
The set difference(s,t) contains those members of s which are not in t.
The set symmetricDifference(s,t) contains those elements which are in s or t but not in both.
Set membership is tested using the member?member?Set operation.
The subset?subset?Set function determines whether one set is a subset of another.
When the base type is finite, the absolute complement of a set is defined. This finds the set of all multiplicative generators of PrimeField 11---the integers mod 11.
The following values are not generators.
Often the members of a set are computed individually; in addition, values can be inserted or removed from a set over the course of a computation.
There are two ways to do this:
One is to view a set as a data structure and to apply updating operations.
The other way is to view a set as a mathematical entity and to create new sets from old.
For more information about lists, see ListXmpPage .