NAME
set - Procedures for manipulating sets
SYNOPSIS
package require TTccll 88..00 package require ssttrruucctt ??22..00?? ::::ssttrruucctt::::sseett eemmppttyy set ::::ssttrruucctt::::sseett ssiizzee set ::::ssttrruucctt::::sseett ccoonnttaaiinnss set item ::::ssttrruucctt::::sseett uunniioonn ?set1...? ::::ssttrruucctt::::sseett iinntteerrsseecctt ?set1...? ::::ssttrruucctt::::sseett ddiiffffeerreennccee set1 set2 ::::ssttrruucctt::::sseett ssyymmddiiffff set1 set2 ::::ssttrruucctt::::sseett iinntteerrsseecctt33 set1 set2 ::::ssttrruucctt::::sseett eeqquuaall set1 set2DESCRIPTION
The ::::ssttrruucctt::::sseett namespace contains several useful commands for pro-
cessing finite sets.It exports only a single command, ssttrruucctt::::sseett. All functionality pro-
vided here can be reached through a subcommand of this command. CCOOMMMMAANNDDSS ::::ssttrruucctt::::sseett eemmppttyy set Returns a boolean value indicating if the set is empty (ttrruuee), or not (ffaallssee). ::::ssttrruucctt::::sseett ssiizzee set Returns an integer number greater than or equal to zero. This isthe number of elements in the set. In other words, its cardinal-
ity. ::::ssttrruucctt::::sseett ccoonnttaaiinnss set itemReturns a boolean value indicating if the set contains the ele-
ment item (ttrruuee), or not (ffaallssee). ::::ssttrruucctt::::sseett uunniioonn ?set1...? Computes the set containing the union of set1, set2, etc., i.e. "set1 + set2 + ...", and returns this set as the result of the command. ::::ssttrruucctt::::sseett iinntteerrsseecctt ?set1...? Computes the set containing the intersection of set1, set2, etc., i.e. "set1 * set2 * ...", and returns this set as the result of the command. ::::ssttrruucctt::::sseett ddiiffffeerreennccee set1 set2 Computes the set containing the difference of set1 and set2,i.e. ("set1 - set2") and returns this set as the result of the
command. ::::ssttrruucctt::::sseett ssyymmddiiffff set1 set2 Computes the set containing the symmetric difference of set1 andset2, i.e. ("(set1 - set2) + (set2 - set1)") and returns this
set as the result of the command. ::::ssttrruucctt::::sseett iinntteerrsseecctt33 set1 set2This command is a combination of the methods iinntteerrsseecctt and ddiiff-
ffeerreennccee. It returns a three-element list containing
"set1*set2", "set1-set2", and "set2-set1", in this order. In
other words, the intersection of the two parameter sets, and their differences. ::::ssttrruucctt::::sseett eeqquuaall set1 set2 Returns a boolean value indicating if the two sets are equal (ttrruuee) or not (ffaallssee). REFERENCESKKEEYYWWOORRDDSScardinality, difference, emptiness, intersection, membership, set, sym-
metric difference, union COPYRIGHT Copyright (c) 2004 Andreas Kupriesstruct 2.0 set(n)