The various set operators and functions that implement them are:
Operation | Function |
set definition | create_set |
| union |
Subset | ismember |
X’s complement w.r.t Y (Y-X ) | complement(X,Y) |
X-Y also written (X\Y) | setdiff(X,Y) |
(A-B) U (B-A) | setxor(A,B) |
Some interesting features to add, would be the capacity to deal with ordered pairs, i.e the same cross product we discussed earlier. We must also be able to define functions on sets, that do operations on such sets; Also we could have subset function return proper & improper subset differences.
I would also suggest generators, for finite sets, and ability to deal with groups. But then we are moving outside the scope of the set theory; this completely limits moves us to having a group theory implementation in Octave, instead of 'solving' this problem. Maybe I dont understand this very well, anyway. Cardinality operator is just the length() function. I also dont write
here the aim of the function 'intersect' that is more like a generic CS problem, as its not a
defined set theoretic operator.
Anyway, trying to force all of mathematics down into a single linear algebra package, seems like masochism.