Thu Apr 17 17:18:30 MET DST 1997 anne % axiom Axiom Computer Algebra System (Release 2.1) Digital Unix on DEC Alpha (AXIOM Sockets) The AXIOM server number is undefined. ----------------------------------------------------------------------------- Issue )copyright to view copyright notices. Issue )summary for a summary of useful system commands. Issue )quit to leave AXIOM and return to shell. ----------------------------------------------------------------------------- initial (1) -> -- ----------[ A x i o m ]---------- -- ---------- Initialization ---------- )set messages autoload off )set messages time on )set quit unprotected -- ---------- Set Theory ---------- x:= set [a, b, b, c, c, c]; Type: Set OrderedVariableList [a,b,c] Time: 0.03 (IN) + 0.05 (EV) + 0.08 (OT) + 0.07 (GC) = 0.23 sec y:= set [d, c, b]; Type: Set OrderedVariableList [d,c,b] Time: 0.02 (IN) = 0.02 sec z:= set [b, e, b]; Type: Set OrderedVariableList [b,e] Time: 0.02 (EV) = 0.02 sec -- [x \/ y \/ z, x /\ y /\ z] => [{a, b, c, d, e}, {b}] [union(union(x, y), z), intersect(intersect(x, y), z)] (4) [{a,b,c,d,e},{b}] Type: List Set Symbol Time: 1.20 (IN) + 0.20 (OT) = 1.40 sec -- x \/ y \/ z - x /\ y /\ z => {a, c, d, e} difference(%.1, %.2) (5) {a,c,d,e} Type: Set Symbol Time: 0.02 (IN) + 0.02 (EV) = 0.03 sec )clear properties x y z -- Cartesian product of sets => {(a, c), (a, d), (b, c), (b, d)} Cartesian(A, B) == _ set reduce(append, [[[A.i, B.j] for j in 1..#B] for i in 1..#A]) Type: Void Time: 0 sec Cartesian([a, b], [c, d]) Compiling function Cartesian with type (List OrderedVariableList [a, b],List OrderedVariableList [c,d]) -> Set List Symbol (7) {[a,c],[a,d],[b,c],[b,d]} Type: Set List Symbol Time: 0.12 (IN) + 0.08 (OT) = 0.20 sec -- ---------- Quit ---------- )quit real 8.4 user 2.7 sys 0.3