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