Use 1//2 instead of ((rat simp) 1 2)
[maxima.git] / share / algebra / charsets / test1.mac
blob9d3cfa03d2e0f4bacaea18c289616693cca2b160
1 /* Test File for CharSets Version 2.0 (with Maple V.3) */
2 /* Copyright (C) 1990-1996 by Dongming Wang */
3 /* the test function for CharSets */
4 charsets_test : lambda ([], block(
5   [ aa,ps,ps1,ord,orda,ordb,as,f,test_in,test_out,rr,i,
6     x4, x1, x2, x3, x, y, b, c2, basset, wbasset, qbasset,
7     charsetn, wcharsetn, qcharsetn, triset, trisetc],
8    ps : [ x4 ^ 2 + x4 ^ 2 * x1 -x4 * x2 -x1 * x2 * x4 + x1 * x2 + 3 * x2,
9        x1 * x4 + x3 -x1 * x2, x4 * x3 -2 * x2 ^ 2 -x1 * x2 -1],
10    ps1 : [ x ^ 2 + y, x ^ 4 * y -x ^ 3],
11    ord : [ x1, x2, x3, x4],
12    orda : [ x, y],
13    ordb : [ b, c2],
14    as : [ -1 + b + 6 * b ^ 2 + 12 * b ^ 3],
15    f : -6156 + 29484 * b + 23328 * c2 + 11664 * c2 ^ 3 -17712 * c2 ^ 2 + 67392 * c2 ^ 2
16      * b ^ 2 + 58320 * c2 ^ 2 * b -58320 * b * c2 -50544 * b ^ 2 * c2 + 17496 * b ^ 2,
17    test_in : [ [ charsets_charset, [ ps, ord]], /* 1 */
18              [ charsets_charset, [ ps, ord, basset]], /* 2 */
19              [ charsets_charset, [ ps, ord, wbasset]], /* 3 */
20              [ charsets_charset, [ ps, ord, qbasset]], /* 4 */
21              [ charsets_charset, [ ps, ord, charsetn]], /* 5 */
22              [ charsets_charset, [ ps, ord, wcharsetn]], /* 6 */
23              [ charsets_charset, [ ps, ord, qcharsetn]], /* 7 */
24              [ charsets_charset, [ ps, ord, triset]], /* 8 */
25              [ charsets_charset, [ ps, ord, trisetc]], /* 9 */
26              [ charsets_mcharset, [ ps, ord]], /* 10 */
27              [ charsets_mcharset, [ ps, ord, basset]], /* 11 */
28              [ charsets_mcharset, [ ps, ord, wbasset]], /* 12 */
29              [ charsets_mcharset, [ ps, ord, qbasset]], /* 13 */
30              [ charsets_mcharset, [ ps, ord, charsetn]], /* 14 */
31              [ charsets_mcharset, [ ps, ord, wcharsetn]], /* 15 */
32              [ charsets_mcharset, [ ps, ord, qcharsetn]], /* 16 */
33              [ charsets_mcharset, [ ps, ord, triset]], /* 17 */
34              [ charsets_mcharset, [ ps, ord, trisetc]], /* 18 */
35              [ charsets_iniset,[[as[1],((4*b^2-1))*f-11],ordb]], /* 19 */
36              [ charsets_remset,[[as[1]-f,f^2,2*f-b^2],[as[1],f],ordb]], /* 20 */
37              [ charsets_charser, [ ps, ord]], /* 21 */
38              [ charsets_charser, [ ps, ord, basset]], /* 22 */
39              [ charsets_charser, [ ps, ord, wbasset]], /* 23 */
40              [ charsets_charser, [ ps, ord, charsetn]], /* 24 */
41              [ charsets_charser, [ ps, ord, wcharsetn]], /* 25 */
42              [ charsets_charser, [ ps, ord, trisetc]], /* 26 */
43              [ charsets_mcs, [ ps, ord]], /* 27 */
44              [ charsets_mcs, [ ps, ord, basset]], /* 28 */
45              [ charsets_mcs, [ ps, ord, wbasset]], /* 29 */
46              [ charsets_mcs, [ ps, ord, charsetn]], /* 30 */
47              [ charsets_mcs, [ ps, ord, wcharsetn]], /* 31 */
48              [ charsets_mcs, [ ps, ord, trisetc]], /* 32 */
49              [ charsets_ecs, [ ps, ord]], /* 33 */
50              [ charsets_ecs, [ ps, ord, basset]], /* 34 */
51              [ charsets_ecs, [ ps, ord, wbasset]], /* 35 */
52              [ charsets_ecs, [ [ ps, x2-x3], ord, charsetn]], /* 36 */
53              [ charsets_ecs, [ ps, ord, wcharsetn]], /* 37 */
54              [ charsets_ecs, [ ps, ord, trisetc]], /* 38 */
55              [ charsets_mecs, [ ps, ord]], /* 39 */
56              [ charsets_mecs, [ ps, ord, basset]], /* 40 */
57              [ charsets_mecs, [ ps, ord, wbasset]], /* 41 */
58              [ charsets_mecs, [ [ ps, x2], ord, charsetn]], /* 42 */
59              [ charsets_mecs, [ ps, ord, wcharsetn]], /* 43 */
60              [ charsets_mecs, [ ps, ord, trisetc]], /* 44 */
61              [ charsets_triser, [ ps, ord]], /* 45 */
62              [ charsets_csolve,[subst(x1=3,ps),charsets_setify([x4,x2,x3])]],/* 46 */
63              [ charsets_ics, [ ps, ord]], /* 47 */
64              [ charsets_ics, [ ps, ord, basset]], /* 48 */
65              [ charsets_ics, [ ps, ord, charsetn]], /* 49 */
66              [ charsets_ics, [ ps, ord, trisetc]], /* 50 */
67              [ charsets_cfactor, [ f, as, ordb]], /* 51 */
68              [ charsets_qics, [ ps, ord]], /* 52 */
69              [ charsets_qics, [ ps, ord, basset]], /* 53 */
70              [ charsets_qics, [ ps, ord, wbasset]], /* 54 */
71              [ charsets_qics, [ ps, ord, charsetn]], /* 55 */
72              [ charsets_qics, [ ps, ord, wcharsetn]], /* 56 */
73              [ charsets_qics, [ ps, ord, trisetc]], /* 57 */
74              [ charsets_eics, [ ps, ord]], /* 58 */
75              [ charsets_eics, [ ps, ord, basset]], /* 59 */
76              [ charsets_eics, [ [ ps, x3], ord, charsetn]], /* 60 */
77              [ charsets_eics, [ ps, ord, trisetc]], /* 61 */
78              [ charsets_ivd, [ ps, ord]], /* 62 */
79              [ charsets_ivd, [ ps, ord, basset]], /* 63 */
80              [ charsets_ivd, [ ps, ord, charsetn]], /* 64 */
81              [ charsets_ivd, [ ps, ord, trisetc]], /* 65 */
82              [ charsets_pid, [ ps1, orda]], /* 66 */
83              [ charsets_pid, [ ps1, orda, basset]], /* 67 */
84              [ charsets_pid, [ ps1, orda, charsetn]], /* 68 */
85              [ charsets_pid, [ ps1, orda, trisetc]]], /* 69 */
86    test_out : [
87 /* 1 */ charsets_setify([[x1*((-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1)),
88          x1^3*x2+3*x1^2*x2+x3^2+x3^2*x1-x1*x2*x3-x1^2*x2*x3,x1*x4+x3-x1*x2]]),
89 /* 2 */ charsets_setify([[x1*((-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1)),
90          x1^3*x2+3*x1^2*x2+x3^2+x3^2*x1-x1*x2*x3-x1^2*x2*x3,x1*x4+x3-x1*x2]]),
91 /* 3 */ charsets_setify([[x1*((-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1)),
92          2*x1*x2^2+x1^2*x2+x1+x3^2-x1*x2*x3,x1*x4+x3-x1*x2]]),
93 /* 4 */ charsets_setify([[x1*((-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1)),
94          2*x1*x2^2+x1^2*x2+x1+x3^2-x1*x2*x3,x1*x4+x3-x1*x2]]),
95 /* 5 */ charsets_setify([[x1*((-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1)),
96          x1^3*x2+3*x1^2*x2+x3^2+x3^2*x1-x1*x2*x3-x1^2*x2*x3,x1*x4+x3-x1*x2]]),
97 /* 6 */ charsets_setify([[x1*((-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1)),
98          2*x1*x2^2+x1^2*x2+x1+x3^2-x1*x2*x3,x1*x4+x3-x1*x2]]),
99 /* 7 */ charsets_setify([[x1*((-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1)),
100          2*x1*x2^2+x1^2*x2+x1+x3^2-x1*x2*x3,x1*x4+x3-x1*x2]]),
101 /* 8 */ charsets_setify([[x1*((-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1)),
102          2*x1*x2^2+x1^2*x2+x1+x3^2-x1*x2*x3,x1*x4+x3-x1*x2]]),
103 /* 9 */ charsets_setify([[x1*((-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1)),
104          x1^3*x2+3*x1^2*x2+x3^2+x3^2*x1-x1*x2*x3-x1^2*x2*x3,x1*x4+x3-x1*x2]]),
105 /*10 */ charsets_setify([charsets_setify([charsets_setify([x1]),[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,
106          x1^3*x2+3*x1^2*x2+x3^2+x3^2*x1-x1*x2*x3-x1^2*x2*x3,x1*x4+x3-x1*x2]])]),
107 /*11 */ charsets_setify([charsets_setify([charsets_setify([x1]),[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,
108          x1^3*x2+3*x1^2*x2+x3^2+x3^2*x1-x1*x2*x3-x1^2*x2*x3,x1*x4+x3-x1*x2]])]),
109 /*12 */ charsets_setify([charsets_setify([charsets_setify([x1]),[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,
110          2*x1*x2^2+x1^2*x2+x1+x3^2-x1*x2*x3,x1*x4+x3-x1*x2]])]),
111 /*13 */ charsets_setify([charsets_setify([charsets_setify([x1]),[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,
112          2*x1*x2^2+x1^2*x2+x1+x3^2-x1*x2*x3,x1*x4+x3-x1*x2]])]),
113 /*14 */ charsets_setify([charsets_setify([charsets_setify([x1]),[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,
114          x1^3*x2+3*x1^2*x2+x3^2+x3^2*x1-x1*x2*x3-x1^2*x2*x3,x1*x4+x3-x1*x2]])]),
115 /*15 */ charsets_setify([charsets_setify([charsets_setify([x1]),[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,
116          2*x1*x2^2+x1^2*x2+x1+x3^2-x1*x2*x3,x1*x4+x3-x1*x2]])]),
117 /*16 */ charsets_setify([charsets_setify([charsets_setify([x1]),[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,
118          2*x1*x2^2+x1^2*x2+x1+x3^2-x1*x2*x3,x1*x4+x3-x1*x2]])]),
119 /*17 */ charsets_setify([charsets_setify([charsets_setify([x1]),[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,
120          2*x1*x2^2+x1^2*x2+x1+x3^2-x1*x2*x3,x1*x4+x3-x1*x2]])]),
121 /*18 */ charsets_setify([charsets_setify([charsets_setify([x1]),[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,
122          x1^3*x2+3*x1^2*x2+x3^2+x3^2*x1-x1*x2*x3-x1^2*x2*x3,x1*x4+x3-x1*x2]])]),
123 /*19 */ charsets_setify([charsets_setify([2*b+1,2*b-1])]),
124 /*20 */ charsets_setify([charsets_setify([b^2])]),
125 /*21 */ charsets_setify([charsets_setify([[x1*((-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1)),
126          x1^3*x2+3*x1^2*x2+x3^2+x3^2*x1-x1*x2*x3-x1^2*x2*x3,x1*x4+x3-x1*x2],
127          [1+x1,x2,-1+x3^2,-x3+x4],[x1,2*x2^2+1,x3,x4^2-x4*x2+3*x2]])]),
128 /*22 */ charsets_setify([charsets_setify([[x1*((-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1)),
129          x1^3*x2+3*x1^2*x2+x3^2+x3^2*x1-x1*x2*x3-x1^2*x2*x3,x1*x4+x3-x1*x2],
130          [1+x1,x2,-1+x3^2,-x3+x4],[x1,2*x2^2+1,x3,x4^2-x4*x2+3*x2]])]),
131 /*23 */ charsets_setify([charsets_setify([[x1*((-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1)),
132          2*x1*x2^2+x1^2*x2+x1+x3^2-x1*x2*x3,x1*x4+x3-x1*x2],
133          [x1,2*x2^2+1,x3,x4^2-x4*x2+3*x2],[x1,4*x2^4+4*x2^2+1,
134          -2*x2^3*x3+4*x2^4+4*x2^2-x2*x3+1,x4^2-x4*x2+3*x2],
135          [1+x1,x2,-x3^2+2*x2^2+1-x2*x3-x2,x4*x3-2*x2^2-x1*x2-1]])]),
136 /*24 */ charsets_setify([charsets_setify([[x1*((-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1)),
137          x1^3*x2+3*x1^2*x2+x3^2+x3^2*x1-x1*x2*x3-x1^2*x2*x3,x1*x4+x3 -x1*x2],
138          [1+x1,x2,-1+x3^2,-x3+x4],[x1,2*x2^2+1,x3,x4^2-x4*x2+3*x2]])]),
139 /*25 */ charsets_setify([charsets_setify([[x1*((-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1)),
140          2*x1*x2^2+x1^2*x2+x1+x3^2-x1*x2*x3,x1*x4+x3-x1*x2],
141          [x1,2*x2^2+1,x3,x4^2-x4*x2+3*x2],
142          [x1,4*x2^4+4*x2^2+1,-2*x2^3*x3+4*x2^4+4*x2^2-x2*x3+1,x4^2-x4*x2+3*x2],
143          [1+x1,x2,-1+x3^2,x4*x3-2*x2^2-x1*x2-1]])]),
144 /* 26 */ charsets_setify([charsets_setify([[x1*((-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1)),
145          x1^3*x2+3*x1^2*x2+x3^2+x3^2*x1-x1*x2*x3-x1^2*x2*x3,x1*x4+x3-x1*x2],
146          [1+x1,x2,-1+x3^2,-x3+x4],[x1,2*x2^2+1,x3,x4^2-x4*x2+3*x2]])]),
147 /* 27 */ charsets_setify([charsets_setify([[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,
148          x1^3*x2+3*x1^2*x2+x3^2+x3^2*x1-x1*x2*x3-x1^2*x2*x3,x1*x4+x3-x1*x2],
149          [1+x1,x2,-1+x3^2,-x3+x4],[x1,2*x2^2+1,x3,x4^2-x4*x2+3*x2]])]),
150 /* 28 */ charsets_setify([charsets_setify([[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,
151          x1^3*x2+3*x1^2*x2+x3^2+x3^2*x1-x1*x2*x3-x1^2*x2*x3,x1*x4+x3-x1*x2],
152          [1+x1,x2,-1+x3^2,-x3+x4],[x1,2*x2^2+1,x3,x4^2-x4*x2+3*x2]])]),
153 /* 29 */ charsets_setify([charsets_setify([[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,
154           2*x1*x2^2+x1^2*x2+x1+x3^2-x1*x2*x3,x1*x4+x3-x1*x2],
155           [x1,2*x2^2+1,x3,x4^2-x4*x2+3*x2],
156           [1+x1,x2,x3^2-2*x2^2-1+x2*x3+x2,x4*x3-2*x2^2-x1*x2-1]]),
157           charsets_setify([[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,
158            2*x1*x2^2+x1^2*x2+x1+x3^2-x1*x2*x3,x1*x4+x3-x1*x2],
159            [x1,2*x2^2+1,x3,x4^2-x4*x2+3*x2],
160            [1+x1,x2,-1+x3^2,x4*x3-2*x2^2-x1*x2-1]])]),
161 /* 30 */ charsets_setify([charsets_setify([[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,
162           x1^3*x2+3*x1^2*x2+x3^2+x3^2*x1-x1*x2*x3-x1^2*x2*x3,x1*x4+x3-x1*x2],
163           [1+x1,x2,-1+x3^2,-x3+x4],[x1,2*x2^2+1,x3,x4^2-x4*x2+3*x2]])]),
164 /* 31 */ charsets_setify([charsets_setify([[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,
165           2*x1*x2^2+x1^2*x2+x1+x3^2-x1*x2*x3,x1*x4+x3-x1*x2],
166           [x1,2*x2^2+1,x3,x4^2-x4*x2+3*x2],
167           [1+x1,x2,x3^2-2*x2^2-1+x2*x3+x2,x4*x3-2*x2^2-x1*x2-1]]),
168           charsets_setify([[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,
169            2*x1*x2^2+x1^2*x2+x1+x3^2-x1*x2*x3,x1*x4+x3-x1*x2],
170            [x1,2*x2^2+1,x3,x4^2-x4*x2+3*x2],
171            [1+x1,x2,-1+x3^2,x4*x3-2*x2^2-x1*x2-1]])]),
172 /* 32 */ charsets_setify([charsets_setify([[-2 *x1*x2+2*x2^2+2*x1*x2^2+1+x1,
173           x1^3*x2+3*x1^2*x2+x3^2+x3^2*x1-x1*x2*x3-x1^2*x2*x3,x1*x4+x3-x1*x2],
174           [1 +x1,x2,-1+x3^2,-x3+x4],[x1,2*x2^2+1,x3,x4^2-x4*x2 +3*x2]])]),
175 /* 33 */ charsets_setify([charsets_setify([[1+x1,x2,-1+x3^2,-x3+x4],
176           [x1,2 *x2^2+1,x3,x4^2-x4*x2+3*x2],
177           [[x1*((-2*x1*x2+2 *x2^2+2*x1*x2^2+1+x1)),
178           x1^3*x2+3*x1^2*x2+x3^2+x3 ^2*x1-x1*x2*x3-x1^2*x2*x3,x1*x4+x3-x1*x2],
179           x1*((1 +x1))]])]),
180 /* 34 */ charsets_setify([charsets_setify([[1+x1,x2,-1+x3^2,-x3+x4],
181           [x1,2 *x2^2+1,x3,x4^2-x4*x2+3*x2],
182           [[x1*((-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1)),
183           x1^3*x2+3*x1^2*x2+x3^2+x3^2*x1-x1*x2*x3-x1^2*x2*x3,x1*x4+x3-x1*x2],
184           x1*((1 +x1))]])]),
185 /* 35 */ charsets_setify([charsets_setify([[x1,2*x2^2+1,x3,x4^2-x4*x2 +3*x2],
186           [[1+x1,x2,-x3^2+2*x2^2+1-x2*x3-x2,x4*x3 -2*x2^2-x1*x2-1],x3],
187           [[x1*((-2*x1*x2+2*x2^2 +2*x1*x2^2+1+x1)),
188           2*x1*x2^2+x1^2*x2+x1+x3^2-x1*x2 *x3,x1*x4+x3-x1*x2],x1*((1+x1))],
189           [[x1,4*x2^4+4 *x2^2+1,-2*x2^3*x3+4*x2^4+4*x2^2-x2*x3+1,
190           x4^2 -x4*x2+3*x2],2*x2^2+1]])]),
191 /* 36 */ charsets_setify([charsets_setify([[1+x1,x2,-1+x3^2,-x3+x4],
192           [x1,2*x2^2+1,x3,x4^2-x4*x2+3*x2],
193           [[x1*((-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1)),
194           x1^3*x2+3*x1^2*x2+x3^2+x3^2*x1-x1*x2*x3-x1^2*x2*x3,x1*x4+x3-x1*x2],
195           x1*((x2-x3))*((1+x1))]])]),
196 /* 37 */ charsets_setify([charsets_setify([[x1,2 *x2^2+1,x3,x4^2-x4*x2+3*x2],
197           [1+x1,x2,-1+x3^2,x4 *x3-2*x2^2-x1*x2-1],
198           [[x1*((-2*x1*x2+2*x2^2+2 *x1*x2^2+1+x1)),
199           2*x1*x2^2+x1^2*x2+x1+x3^2-x1*x2 *x3,x1*x4+x3-x1*x2],x1*((1+x1))],
200           [[x1,4*x2^4+4 *x2^2+1,-2*x2^3*x3+4*x2^4+4*x2^2-x2*x3+1,
201           x4^2 -x4*x2+3*x2],2*x2^2+1]])]),
202 /* 38 */ charsets_setify([charsets_setify([[1+x1,x2,-1 +x3^2,-x3+x4],
203           [x1,2*x2^2+1,x3,x4^2-x4*x2+3*x2],
204           [[x1 *((-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1)),
205           x1^3*x2+3 *x1^2*x2+x3^2+x3^2*x1-x1*x2*x3-x1^2*x2*x3,x1*x4+x3 -x1*x2],
206           x1*((1+x1))]])]),
207 /* 39 */ charsets_setify([charsets_setify([[1+x1,x2,-1 +x3^2,-x3+x4],
208           [x1,2*x2^2+1,x3,x4^2-x4*x2+3*x2],
209           [[-2 *x1*x2+2*x2^2+2*x1*x2^2+1+x1,
210           x1^3*x2+3*x1^2*x2+x3 ^2+x3^2*x1-x1*x2*x3-x1^2*x2*x3,x1*x4+x3-x1*x2],
211           x1 *((1+x1))]])]),
212 /* 40 */ charsets_setify([charsets_setify([[1+x1,x2,-1+x3^2,-x3 +x4],
213           [x1,2*x2^2+1,x3,x4^2-x4*x2+3*x2],
214           [[-2*x1 *x2+2*x2^2+2*x1*x2^2+1+x1,
215           x1^3*x2+3*x1^2*x2+x3^2 +x3^2*x1-x1*x2*x3-x1^2*x2*x3,x1*x4+x3-x1*x2],
216           x1*((1 +x1))]])]),
217 /* 41 */ charsets_setify([charsets_setify([[x1,2*x2^2+1,x3,x4^2-x4*x2 +3*x2],
218           [[1+x1,x2,-x3^2+2*x2^2+1-x2*x3-x2,x4*x3 -2*x2^2-x1*x2-1],x3],
219           [[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,2*x1*x2^2+x1^2*x2+x1+x3^2-x1*x2*x3,
220           x1 *x4+x3-x1*x2],x1*((1+x1))],
221           [[x1,4*x2^4+4*x2^2 +1,2*x2^2+1-x2*x3,x4^2-x4*x2+3*x2],2*x2^2+1]])]),
222 /* 42 */ charsets_setify([charsets_setify([[x1,2 *x2^2+1,x3,x4^2-x4*x2+3*x2],
223           [[-2*x1*x2+2*x2^2 +2*x1*x2^2+1+x1,
224           x1^3*x2+3*x1^2*x2+x3^2+x3^2*x1-x1*x2*x3-x1^2*x2*x3,x1*x4+x3-x1*x2],
225           x1*x2*((1+x1))]])]),
226 /* 43 */ charsets_setify([charsets_setify([[x1,2 *x2^2+1,x3,x4^2-x4*x2+3*x2],
227           [1+x1,x2,-1+x3^2,x4 *x3-2*x2^2-x1*x2-1],
228           [[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,2*x1*x2^2+x1^2*x2+x1+x3^2-x1*x2*x3,
229           x1*x4 +x3-x1*x2],x1*((1+x1))],
230           [[x1,4*x2^4+4*x2^2+1,2 *x2^2+1-x2*x3,x4^2-x4*x2+3*x2],2*x2^2+1]])]),
231 /* 44 */ charsets_setify([charsets_setify([[1 +x1,x2,-1+x3^2,-x3+x4],
232           [x1,2*x2^2+1,x3,x4^2-x4*x2 +3*x2],
233           [[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,
234           x1^3*x2+3*x1^2*x2+x3^2+x3^2*x1-x1*x2*x3-x1^2*x2*x3,x1*x4+x3-x1*x2],
235           x1*((1+x1))]])]),
236 /* 45 */ charsets_setify([charsets_setify([[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,
237           2*x1*x2^2+x1^2*x2+x1+x3^2-x1*x2*x3,x1*x4+x3-x1*x2],
238           [x1,2*x2^2+1,x3,x4 ^2-x4*x2+3*x2],
239           [1+x1,x2,x3^2-2*x2^2-1+x2*x3+x2,x4*x3-2*x2^2-x1*x2-1]]),
240           charsets_setify([[-2*x1*x2+2*x2^2 +2*x1*x2^2+1+x1,
241            2*x1*x2^2+x1^2*x2+x1+x3^2-x1*x2 *x3,x1*x4+x3-x1*x2],
242            [x1,2*x2^2+1,x3,x4^2-x4*x2+3*x2],
243            [1 +x1,x2,-1+x3^2,x4*x3-2*x2^2-x1*x2-1]])]),
244 /* 46 */ charsets_setify([charsets_setify([charsets_setify([x3 =((-3))/4+3/4*%i*23^((1/2)),
245           x2=3/8+1/8*%i*23 ^((1/2)),
246           x4=3/16+1/16*%i*23^((1/2))+1/16*2^((1 /2))*
247              ((-79-21*%i*23^((1/2))))^((1/2))]),
248           charsets_setify([x4 =3/16-1/16*%i*23^((1/2))+1/16*2^((1/2))*
249              ((-79 +21*%i*23^((1/2))))^((1/2)),
250              x3=((-3))/4-3/4 *%i*23^((1/2)),x2=3/8-1/8*%i*23^((1/2))]),
251           charsets_setify([x2 =3/8-1/8*%i*23^((1/2)),
252              x4=3/16-1/16*%i*23^((1/2)) -1/16*2^((1/2))*
253                 ((-79+21*%i*23^((1/2))))^((1 /2)),
254              x3=15/8+3/8*%i*23^((1/2))]),
255           charsets_setify([x2=3/8+1 /8*%i*23^((1/2)),
256              x3=15/8-3/8*%i*23^((1/2)),
257              x4=3 /16+1/16*%i*23^((1/2))-1/16*2^((1/2))*
258                 ((-79-21 *%i*23^((1/2))))^((1/2))])]),
259           charsets_setify([charsets_setify([x3=15 /8+3/8*%i*23^((1/2)),
260              x4=-1/4-1/4*%i*23^((1/2)),
261              x2 =-1/2*((-11+%i*23^((1/2))))/((7+%i*23^((1/2))))]),
262           charsets_setify([x3 =-3/4+3/4*%i*23^((1/2)),x4=5/8-1/8*%i*23^((1 /2)),
263              x2=1/4*((-1+5*%i*23^((1/2))))/((7+%i*23 ^((1/2))))]),
264           charsets_setify([x3=15/8-3/8*%i*23^((1/2)),
265              x2 =-1/2*((11+%i*23^((1/2))))/((-7+%i*23^((1/2)))),
266              x4 =-1/4+1/4*%i*23^((1/2))]),
267           charsets_setify([x3=-3/4-3/4 *%i*23^((1/2)),x4=5/8+1/8*%i*23^((1/2)),
268              x2=1/4 *((1+5*%i*23^((1/2))))/((-7+%i*23^((1/2))))])]),
269           charsets_setify([charsets_setify([x2 =3/8+1/8*%i*23^((1/2)),
270              x4=3/16+1/16*%i*23^((1/2))+1/16*((-158-42*%i*23^((1/2))))^((1/2)),
271              x3=-3 /4+3/4*%i*23^((1/2))]),
272           charsets_setify([x2=3/8+1/8*%i*23^((1 /2)),
273              x4=3/16+1/16*%i*23^((1/2))-1/16*((-158-42*%i*23^((1/2))))^((1/2)),
274              x3=15/8-3/8*%i*23^((1 /2))]),
275           charsets_setify([x2=3/8-1/8*%i*23^((1/2)),
276              x4=3/16-1/16*%i*23^((1/2))+1/16*((-158+42*%i*23^((1/2))))^((1/2)),
277              x3=-3/4-3/4*%i*23^((1/2))]),
278           charsets_setify([x2 =3/8-1/8*%i*23^((1/2)),
279              x4=3/16-1/16*%i*23^((1/2))-1/16*((-158+42*%i*23^((1/2))))^((1/2)),
280              x3=15 /8+3/8*%i*23^((1/2))])])]),
281 /* 47 */ charsets_setify([charsets_setify([[1+x1,x2,x3 -1,x4-1],[1+x1,x2,1+x3,1+x4],
282           [-2*x1*x2+2*x2^2 +2*x1*x2^2+1+x1,x3-x1+x1*x2,x4+1-2*x2],
283           [-2*x1*x2 +2*x2^2+2*x1*x2^2+1+x1,-x3-x1+2*x1*x2,x4+x2-1]])]),
284 /* 48 */ charsets_setify([charsets_setify([[1 +x1,x2,x3-1,x4-1],[1+x1,x2,1+x3,1+x4],
285           [-2*x1*x2 +2*x2^2+2*x1*x2^2+1+x1,x3-x1+x1*x2,x4+1-2*x2],
286           [-2 *x1*x2+2*x2^2+2*x1*x2^2+1+x1,-x3-x1+2*x1*x2,x4+x2 -1]])]),
287 /* 49 */ charsets_setify([charsets_setify([[1+x1,x2,x3-1,x4-1],[1+x1,x2,1 +x3,1+x4],
288           [-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,x3-x1 +x1*x2,x4+1-2*x2],
289           [-2*x1*x2+2*x2^2+2*x1*x2^2+1 +x1,-x3-x1+2*x1*x2,x4+x2-1]])]),
290 /* 50 */ charsets_setify([charsets_setify([[1 +x1,x2,x3-1,x4-1],[1+x1,x2,1+x3,1+x4],
291           [-2*x1*x2 +2*x2^2+2*x1*x2^2+1+x1,x3-x1+x1*x2,x4+1-2*x2],
292           [-2 *x1*x2+2*x2^2+2*x1*x2^2+1+x1,-x3-x1+2*x1*x2,x4+x2 -1]])]),
293 /* 51 */ charsets_setify([charsets_setify([144*
294           ((-27*b-32*c2+48*b^2*c2+27*b^2+27*c2^2+72*b*c2+18))*
295           ((12*b^2+7*b+3*c2 -1))])]),
296 /* 52 */ charsets_setify([charsets_setify([[-2*x1*x2+2*x2^2+2*x1*x2 ^2+1+x1,
297           x1^3*x2+3*x1^2*x2+x3^2+x3^2*x1-x1*x2*x3 -x1^2*x2*x3,x1*x4+x3-x1*x2],
298           [x1,2*x2^2+1,x3,x4^2-x4 *x2+3*x2],[1+x1,x2,x3-1,x4-1],
299           [1+x1,x2,1+x3,1+x4]])]),
300 /* 53 */ charsets_setify([charsets_setify([[-2 *x1*x2+2*x2^2+2*x1*x2^2+1+x1,
301           x1^3*x2+3*x1^2*x2+x3 ^2+x3^2*x1-x1*x2*x3-x1^2*x2*x3,x1*x4+x3-x1*x2],
302           [x1,2 *x2^2+1,x3,x4^2-x4*x2+3*x2],[1+x1,x2,x3-1,x4-1],
303           [1 +x1,x2,1+x3,1+x4]])]),
304 /* 54 */ charsets_setify([charsets_setify([[-2*x1*x2+2*x2 ^2+2*x1*x2^2+1+x1,
305           2*x1*x2^2+x1^2*x2+x1+x3^2-x1*x2 *x3,x1*x4+x3-x1*x2],
306           [x1,2*x2^2+1,x3,x4^2-x4*x2+3*x2],
307           [1 +x1,x2,x3^2-2*x2^2-1+x2*x3+x2,x4*x3-2*x2^2-x1*x2-1]]),
308           charsets_setify([[-2 *x1*x2+2*x2^2+2*x1*x2^2+1+x1,
309           2*x1*x2^2+x1^2*x2+x1 +x3^2-x1*x2*x3,x1*x4+x3-x1*x2],
310           [x1,2*x2^2+1,x3,x4 ^2-x4*x2+3*x2],[1+x1,x2,x3-1,x4-1],
311           [1+x1,x2,1+x3,1 +x4]])]),
312 /* 55 */ charsets_setify([charsets_setify([[-2*x1*x2+2*x2^2+2*x1*x2 ^2+1+x1,
313           x1^3*x2+3*x1^2*x2+x3^2+x3^2*x1-x1*x2*x3 -x1^2*x2*x3,x1*x4+x3-x1*x2],
314           [x1,2*x2^2+1,x3,x4^2-x4 *x2+3*x2],[1+x1,x2,x3-1,x4-1],
315           [1+x1,x2,1+x3,1+x4]])]),
316 /* 56 */ charsets_setify([charsets_setify([[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,
317           2*x1*x2^2+x1^2*x2+x1+x3^2-x1*x2*x3,x1*x4+x3-x1*x2],
318           [x1,2*x2^2+1,x3,x4^2-x4*x2+3*x2],
319           [1+x1,x2,x3^2-2*x2^2-1+x2*x3+x2,x4 *x3-2*x2^2-x1*x2-1]]),
320           charsets_setify([[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,
321            2*x1*x2^2+x1^2*x2+x1+x3^2-x1*x2*x3,x1*x4+x3-x1*x2],
322            [x1,2*x2^2+1,x3,x4^2-x4*x2+3*x2],[1+x1,x2,x3-1,x4-1],
323            [1+x1,x2,1+x3,1+x4]])]),
324 /* 57 */ charsets_setify([charsets_setify([[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,
325           x1^3*x2+3*x1^2*x2+x3^2+x3^2*x1-x1*x2*x3-x1^2*x2*x3,x1*x4+x3-x1*x2],
326           [x1,2*x2^2+1,x3,x4^2-x4*x2+3*x2],[1+x1,x2,x3-1,x4-1],
327           [1+x1,x2,1+x3,1+x4]])]),
328 /* 58 */ charsets_setify([charsets_setify([[1+x1,x2,x3-1,x4-1],[1+x1,x2,1+x3,1+x4],
329           [[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,-x3-x1+2*x1*x2,x4+x2-1],
330           x1*((1+x1))],[x1,2*x2^2+1,x3,x4+x2-1],
331           [[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,x3-x1+x1*x2,x4+1-2*x2],
332           x1*((1+x1))],[x1,2*x2^2+1,x3,x4+1-2*x2]])]),
333 /* 58 */ charsets_setify([charsets_setify([[1+x1,x2,x3-1,x4-1],[1+x1,x2,1+x3,1+x4],
334           [[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,-x3-x1+2*x1*x2,x4+x2-1],
335           x1*((1+x1))],[x1,2*x2^2+1,x3,x4+x2-1],
336           [[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,x3-x1+x1*x2,x4+1-2*x2],
337           x1*((1+x1))],[x1,2*x2^2+1,x3,x4+1-2*x2]])]),
338 /* 59 */ charsets_setify([charsets_setify([[1+x1,x2,x3-1,x4-1],[1+x1,x2,1+x3,1+x4],
339           [[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,-x3-x1+2*x1*x2,x4+x2-1],
340           x1*x3*((1+x1))],[[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,x3-x1+x1*x2,
341           x4+1-2*x2],x1*x3*((1+x1))]])]),
342 /* 60 */ charsets_setify([charsets_setify([[1+x1,x2,x3-1,x4-1],[1+x1,x2,1+x3,1+x4],
343           [[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,-x3-x1+2*x1*x2,x4+x2-1],
344           x1*((1+x1))],[x1,2*x2^2+1,x3,x4+x2-1],
345           [[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,x3-x1+x1*x2,x4+1-2*x2],
346           x1*((1+x1))],[x1,2*x2^2+1,x3,x4+1-2*x2]])]),
347 /* 61 */ charsets_setify([charsets_setify([[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,x3-x1+x1*x2,
348           x4+1-2*x2],[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,x3+x1-2*x1*x2,x4+x2-1]])]),
349 /* 62 */ charsets_setify([charsets_setify([[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,x3-x1+x1*x2,
350           x4+1-2*x2],[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,x3+x1-2*x1*x2,x4+x2-1]])]),
351 /* 63 */ charsets_setify([charsets_setify([[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,x3-x1+x1*x2,
352           x4+1-2*x2],[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,x3+x1-2*x1*x2,x4+x2-1]])]),
353 /* 64 */ charsets_setify([charsets_setify([[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,x3-x1+x1*x2,
354           x4+1-2*x2],[-2*x1*x2+2*x2^2+2*x1*x2^2+1+x1,x3+x1-2*x1*x2,x4+x2-1]])]),
355 /* 65 */ charsets_setify([charsets_setify([[[x^2-x+1,y+x-1],[x^2-x+1,y+x-1]],[[x^3,x^2+y],[x,y]],
356           [[x+1,y+1],[x+1,y+1]]])]),
357 /* 66 */ charsets_setify([charsets_setify([[[x^2-x+1,y+x-1],[x^2-x+1,y+x-1]],[[x^3,x^2+y],[x,y]],
358           [[x+1,y+1],[x+1,y+1]]])]),
359 /* 67 */ charsets_setify([charsets_setify([[[x^2-x+1,y+x-1],[x^2-x+1,y+x-1]],[[x^3,x^2+y],[x,y]],
360           [[x+1,y+1],[x+1,y+1]]])]),
361 /* 68 */ charsets_setify([charsets_setify([[[x^2-x+1,y+x-1],[x^2-x+1,y+x-1]],[[x^3,x^2+y],[x,y]],
362           [[x+1,y+1],[x+1,y+1]]])])],
364    for i : 1 thru length(test_in) do (
365      print("Executing test number ",i),
366      print("Test", i, "input:"),
367      grind (funmake (first (test_in[i]), second (test_in[i]))),
368      print ("Test", i, "expected output:"),
369      grind (test_out[i]),
370      errcatch
371       (rr : setify1(apply(first(test_in[i]), second(test_in[i]))),
372        if charsets_testsub( rr, test_out[i]) 
373          then (
374           print("CharSets_Test:",i,"Good"))
375         else (
376           print("CharSets_Test:",i,"Bad; actual output:",rr))),
377      if %% = [] then print ("CharSets_Test: error in test."))
379 /* subroutine for test */
381 charsets_testsub( rr,ss):=block( [ i,ii,_ind],
382    rr:map(expand,rr),ss:map(expand,ss),
383    if member(rr, ss) then ( true)
384    else (
385       _ind:false,
386       for i in ss do (
387         ii:if listp(i) then i else setify1(i),
388         if charsets_equal ( charsets_setdifference ( rr, ii), charsets_setdifference ( ii, rr)) 
389           then (
390            return ( _ind:true))) ,
391       return(_ind))
393 /* subroutine for testsub */
395 charsets_equal ( a,b):= block(
396    [ i,j,_ind],
397    if listp(a) then (
398       if length ( a) # length ( b)  then (
399          print("charsets_equal: lists of different lengths",length ( a),a,length ( b),b),
400          return ( false)),
401       _ind:true,
402       for i : 1 thru length ( a) do (
403         if not charsets_equal ( a[i], b[i]) then return ( _ind:false)),
404       return( _ind))
405      else if /* WARNING: listp should be setp */listp(a) then (
406       if length ( a) # length ( b) then (
407          print("charsets_equal: sets of different lengths",length ( a),a,length ( b),b),
408          return ( false)),
409       _ind:true,
410       for i in a do (
411         for j in b do (
412           if not charsets_equal ( i, j) then return (_ind : false)),
413         if not _ind then return ( false)),
414       return (_ind))
415      else if charsets_operatorp(b, charsets_ListOrSet) then ( false)
416      else if polynomialp(a,listofvars(a)) then (
417       if second(divide ( a, b)) = 0 and second(divide ( b, a)) = 0 then ( true)
418         else (
419          print("charsets_equal: polynomials dont divide",a,b), 
420          false))
421      else if a = b then ( true)
422      else (
423         if a = -b then true
424         else (
425          print("charsets_equal: a not equal b",a,b), 
426       false))
427 )$