1 /* Original version of this file copyright 1999 by Michael Wester,
2 * and retrieved from http://www.math.unm.edu/~wester/demos/SetTheory/problems.macsyma
5 * Released under the terms of the GNU General Public License, version 2,
6 * per message dated 2007-06-03 from Michael Wester to Robert Dodier
7 * (contained in the file wester-gpl-permission-message.txt).
9 * See: "A Critique of the Mathematical Abilities of CA Systems"
10 * by Michael Wester, pp 25--60 in
11 * "Computer Algebra Systems: A Practical Guide", edited by Michael J. Wester
12 * and published by John Wiley and Sons, Chichester, United Kingdom, 1999.
14 /* ----------[ M a c s y m a ]---------- */
15 /* ---------- Initialization ---------- */
18 /* ---------- Set Theory ---------- */
19 x: '[a, b, b, c, c, c]$
22 /* [x \/ y \/ z, x /\ y /\ z] => [{a, b, c, d, e}, {b}] */
23 [union(x, y, z), intersect(x, y, z)];
24 /* x \/ y \/ z - x /\ y /\ z => {a, c, d, e} */
25 setdifference(%[1], %[2]);
27 /* Cartesian product of sets => {(a, c), (a, d), (b, c), (b, d)} */
28 apply('append, outermap("[", [a, b], [c, d]));