1 | LIB "tst.lib"; |
---|
2 | tst_init(); |
---|
3 | |
---|
4 | //EXAMPLES SHEET |
---|
5 | LIB"JMBTest.lib"; |
---|
6 | |
---|
7 | //Example 1 |
---|
8 | |
---|
9 | ring r=0, (x,y,z),rp; |
---|
10 | jmp r1; |
---|
11 | r1.h=z^5; |
---|
12 | r1.t=poly(0); |
---|
13 | jmp r2; |
---|
14 | r2.h=z^4*y; |
---|
15 | r2.t=poly(0); |
---|
16 | jmp r3; |
---|
17 | r3.h=z^3*y^2; |
---|
18 | r3.t= poly(0) ; |
---|
19 | jmp r4; |
---|
20 | r4.h=z^2*y^3; |
---|
21 | r4.t= poly(0) ; |
---|
22 | jmp r5; |
---|
23 | r5.h=z^4*x; |
---|
24 | r5.t= poly(0) ; |
---|
25 | jmp r6; |
---|
26 | r6.h=z^3*y*x ; |
---|
27 | r6.t= poly(0) ; |
---|
28 | jmp r7; |
---|
29 | r7.h= z^2*y^2*x; |
---|
30 | r7.t= poly(0) ; |
---|
31 | jmp r8; |
---|
32 | r8.h= z*y^4 ; |
---|
33 | r8.t= poly(0) ; |
---|
34 | jmp r9; |
---|
35 | r9.h=z*y^3*x ; |
---|
36 | r9.t= poly(0) ; |
---|
37 | jmp r10; |
---|
38 | r10.h= z^3*x^2 ; |
---|
39 | r10.t=poly(0) ; |
---|
40 | jmp r11; |
---|
41 | r11.h= z^2*y*x^2 ; |
---|
42 | r11.t=poly(0) ; |
---|
43 | jmp r12; |
---|
44 | r12.h=z*y^2*x^2; |
---|
45 | r12.t=-y^4*x-z^2*x^3; |
---|
46 | jmp r13; |
---|
47 | r13.h= y^5; |
---|
48 | r13.t=poly(0); |
---|
49 | list G1V=list(list(r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13)); |
---|
50 | TestJMark(G1V,r); |
---|
51 | //Result 1 |
---|
52 | //=>1 |
---|
53 | |
---|
54 | |
---|
55 | |
---|
56 | //Example 2 |
---|
57 | ring r=0, (x,y,z),rp; |
---|
58 | jmp r1; |
---|
59 | r1.h=z^3; |
---|
60 | r1.t=poly(0); |
---|
61 | jmp r2; |
---|
62 | r2.h=z^2*y; |
---|
63 | r2.t=poly(0); |
---|
64 | jmp r3; |
---|
65 | r3.h=z*y^2 ; |
---|
66 | r3.t=-x^2*y; |
---|
67 | jmp r4; |
---|
68 | r4.h=y^5; |
---|
69 | r4.t=poly(0); |
---|
70 | list G2F=list(list(r1,r2,r3),list(r4)); |
---|
71 | TestJMark(G2F,r); |
---|
72 | //Result 2 |
---|
73 | //=> NOT A BASIS |
---|
74 | //0 |
---|
75 | |
---|
76 | |
---|
77 | |
---|
78 | //Example 3 |
---|
79 | ring r=0, (x(0..3)), rp; |
---|
80 | jmp r1; |
---|
81 | r1.h=x(3)^2; |
---|
82 | r1.t=-4*x(0)*x(2)+x(1)^2; |
---|
83 | jmp r2; |
---|
84 | r2.h=x(3)*x(2); |
---|
85 | r2.t=-x(1)*x(0); |
---|
86 | jmp r3; |
---|
87 | r3.h=x(2)^2; |
---|
88 | r3.t=-5*x(0)*x(2); |
---|
89 | jmp r4; |
---|
90 | r4.h=x(3)*x(1); |
---|
91 | r4.t=poly(0) ; |
---|
92 | jmp r5; |
---|
93 | r5.h=x(2)*x(1); |
---|
94 | r5.t=-x(0)^2; |
---|
95 | jmp r6; |
---|
96 | r6.h=x(1)^3; |
---|
97 | r6.t=-x(0)*x(1)^2; |
---|
98 | list G3F=list(list(r1, r2, r3, r4, r5),list(r6)); |
---|
99 | TestJMark(G3F,r); |
---|
100 | //Result 3 |
---|
101 | //=> NOT A BASIS |
---|
102 | //0 |
---|
103 | |
---|
104 | |
---|
105 | |
---|
106 | //Example 4 |
---|
107 | ring r=31991, (x(0..3)), rp; |
---|
108 | jmp r1; |
---|
109 | r1.h=x(3)^2; |
---|
110 | r1.t=11415*x(1)*x(2) + 12545*x(0)*x(2) + 5551*x(1)^2 + 2052*x(0)*x(1) - 5996*x(0)^2; |
---|
111 | jmp r2; |
---|
112 | r2.h=x(2)*x(3); |
---|
113 | r2.t= 9738*x(1)*x(2) + 4702*x(0)*x(2) + 1299*x(1)^2 - 9258*x(0)*x(1) - 660*x(0)^2; |
---|
114 | jmp r3; |
---|
115 | r3.h=x(1)*x(3); |
---|
116 | r3.t= - 499*x(1)*x(2) + 15889*x(0)*x(2) - 7174*x(1)^2 + 14455*x(0)*x(1) + 9142*x(0)^2; |
---|
117 | jmp r4; |
---|
118 | r4.h=x(0)*x(3); |
---|
119 | r4.t= - 7284*x(1)*x(2) - 252*x(0)*x(2) + 14903*x(1)^2 + 3168*x(0)*x(1) - 7681*x(0)^2; |
---|
120 | jmp r5; |
---|
121 | r5.h=x(2)^2; |
---|
122 | r5.t= - 966*x(1)*x(2) - 3371*x(0)*x(2) - 7034*x(1)^2 + 13657*x(0)*x(1) - 7337*x(0)^2; |
---|
123 | jmp r6; |
---|
124 | r6.h=x(0)*x(1)*x(2); |
---|
125 | r6.t= 15317*x(0)^2*x(2) - 15115*x(1)^3 + 7262*x(0)*x(1)^2 - 5022*x(0)^2*x(1) + 9052*x(0)^3; |
---|
126 | jmp r7; |
---|
127 | r7.h= x(1)^2*x(2); |
---|
128 | r7.t=- 2219*x(0)^2*x(2) + 7022*x(1)^3 - 8908*x(0)*x(1)^2 - 14283*x(0)^2*x(1) + 6536*x(0)^3 ; |
---|
129 | jmp r8; |
---|
130 | r8.h=x(0)^3*x(2); |
---|
131 | r8.t=570*x(1)^4 - 5548*x(0)*x(1)^3 - 5727*x(0)^2*x(1)^2 - 12284*x(0)^3*x(1) + 5207*x(0)^4 ; |
---|
132 | jmp r9; |
---|
133 | r9.h=x(1)^5; |
---|
134 | r9.t= -14551*x(0)*x(1)^4+11335*x(0)^2*x(1)^3+11357*x(0)^3*x(1)^2-5733*x(0)^4*x(1)-3043*x(0)^5; |
---|
135 | list G4V=list(list(r1, r2, r3, r4, r5), list(r6,r7),list(r8),list(r9)); |
---|
136 | TestJMark(G4V,r); |
---|
137 | //Result 4 |
---|
138 | //=>1 |
---|
139 | |
---|
140 | |
---|
141 | |
---|
142 | //Example 5 |
---|
143 | ring r=0, (x,y,z),rp; |
---|
144 | jmp r1; |
---|
145 | r1.h=xy; |
---|
146 | r1.t=poly(0); |
---|
147 | jmp r2; |
---|
148 | r2.h=y^2; |
---|
149 | r2.t=poly(0); |
---|
150 | jmp r3; |
---|
151 | r3.h=xz; |
---|
152 | r3.t= poly(0) ; |
---|
153 | jmp r4; |
---|
154 | r4.h=yz; |
---|
155 | r4.t= poly(0) ; |
---|
156 | jmp r5; |
---|
157 | r5.h=z^2; |
---|
158 | r5.t= poly(0) ; |
---|
159 | list G5V=list(list(r1,r2,r3,r4,r5)); |
---|
160 | TestJMark(G5V,r); |
---|
161 | //Result 5 |
---|
162 | //=>1 |
---|
163 | |
---|
164 | |
---|
165 | |
---|
166 | //Example 6 |
---|
167 | ring r=0, (x,y,z),rp; |
---|
168 | jmp r1; |
---|
169 | r1.h=xy; |
---|
170 | r1.t=poly(0); |
---|
171 | jmp r2; |
---|
172 | r2.h=y^2; |
---|
173 | r2.t=3*x^2; |
---|
174 | jmp r3; |
---|
175 | r3.h=xz; |
---|
176 | r3.t= poly(0) ; |
---|
177 | jmp r4; |
---|
178 | r4.h=yz; |
---|
179 | r4.t= poly(0) ; |
---|
180 | jmp r5; |
---|
181 | r5.h=z^2; |
---|
182 | r5.t= poly(0) ; |
---|
183 | list G6F=list(list(r1,r2,r3,r4,r5)); |
---|
184 | TestJMark(G6F,r); |
---|
185 | //Result 6 |
---|
186 | //=> NOT A BASIS |
---|
187 | //0 |
---|
188 | |
---|
189 | |
---|
190 | |
---|
191 | //Example 7 |
---|
192 | ring r=0, (z,y,x),rp; |
---|
193 | jmp r1; |
---|
194 | r1.h=x^4; |
---|
195 | r1.t=poly(0); |
---|
196 | jmp r2; |
---|
197 | r2.h=x^3*y; |
---|
198 | r2.t=poly(0); |
---|
199 | jmp r3; |
---|
200 | r3.h=x^2*y^2; |
---|
201 | r3.t= poly(0) ; |
---|
202 | jmp r4; |
---|
203 | r4.h=x*y^3; |
---|
204 | r4.t= poly(0) ; |
---|
205 | jmp r5; |
---|
206 | r5.h=z*x^3; |
---|
207 | r5.t= poly(0) ; |
---|
208 | jmp r6; |
---|
209 | r6.h=x^2*y*z ; |
---|
210 | r6.t= y^4 ; |
---|
211 | jmp r7; |
---|
212 | r7.h= x*y^2*z; |
---|
213 | r7.t= poly(0) ; |
---|
214 | jmp r8; |
---|
215 | r8.h= y^5 ; |
---|
216 | r8.t= poly(0) ; |
---|
217 | list G7V=list(list(r1,r2,r3,r4,r5,r6,r7),list(r8)); |
---|
218 | TestJMark(G7V,r); |
---|
219 | |
---|
220 | //Result 7 |
---|
221 | //=>1 |
---|
222 | |
---|
223 | |
---|
224 | |
---|
225 | //Example 8 |
---|
226 | ring r=0, (z,y,x),rp; |
---|
227 | jmp r1; |
---|
228 | r1.h=x^4; |
---|
229 | r1.t=poly(0); |
---|
230 | jmp r2; |
---|
231 | r2.h=x^3*y; |
---|
232 | r2.t=poly(0); |
---|
233 | jmp r3; |
---|
234 | r3.h=x^2*y^2; |
---|
235 | r3.t= poly(0) ; |
---|
236 | jmp r4; |
---|
237 | r4.h=x*y^3; |
---|
238 | r4.t= y^4 ; |
---|
239 | jmp r5; |
---|
240 | r5.h=z*x^3; |
---|
241 | r5.t= poly(0) ; |
---|
242 | jmp r6; |
---|
243 | r6.h=x^2*y*z ; |
---|
244 | r6.t= poly(0) ; |
---|
245 | jmp r7; |
---|
246 | r7.h= x*y^2*z; |
---|
247 | r7.t= z*y^3 ; |
---|
248 | jmp r8; |
---|
249 | r8.h= y^5 ; |
---|
250 | r8.t= poly(0) ; |
---|
251 | list G8F=list(list(r1,r2,r3,r4,r5,r6,r7),list(r8)); |
---|
252 | TestJMark(G8F,r); |
---|
253 | //Result 8 |
---|
254 | //=> NOT A BASIS |
---|
255 | //0 |
---|
256 | |
---|
257 | |
---|
258 | |
---|
259 | //Example 9 |
---|
260 | ring r=0, (x,y,z),rp; |
---|
261 | jmp r1; |
---|
262 | r1.h=z; |
---|
263 | r1.t=poly(0); |
---|
264 | jmp r2; |
---|
265 | r2.h=y^6; |
---|
266 | r2.t=poly(0); |
---|
267 | jmp r3; |
---|
268 | r3.h=x^3*y^5; |
---|
269 | r3.t=poly(0); |
---|
270 | list G9V=list( list(r1),list(),list(),list(),list(),list(r2),list(),list(r3)); |
---|
271 | TestJMark(G9V,r); |
---|
272 | //Result 9 |
---|
273 | //=>1 |
---|
274 | |
---|
275 | |
---|
276 | |
---|
277 | |
---|
278 | //Example 10 |
---|
279 | ring r=0, (x,y,z), rp; |
---|
280 | jmp r1; |
---|
281 | r1.h=z; |
---|
282 | r1.t=poly(0); |
---|
283 | jmp r2; |
---|
284 | r2.h=y^6; |
---|
285 | r2.t=poly(0); |
---|
286 | jmp r3; |
---|
287 | r3.h=x^3*y^5; |
---|
288 | r3.t=x^8; |
---|
289 | list G10F=list( list(r1),list(),list(),list(),list(),list(r2),list(),list(r3)); |
---|
290 | TestJMark(G10F,r); |
---|
291 | //Result 10 |
---|
292 | //=> NOT A BASIS |
---|
293 | //0 |
---|
294 | |
---|
295 | |
---|
296 | |
---|
297 | //Example 11 |
---|
298 | ring r=0, (x,y,z), rp; |
---|
299 | jmp r1; |
---|
300 | r1.h=z; |
---|
301 | r1.t=poly(0); |
---|
302 | jmp r2; |
---|
303 | r2.h=y^6; |
---|
304 | r2.t=x*y^5; |
---|
305 | jmp r3; |
---|
306 | r3.h=x^3*y^5; |
---|
307 | r3.t=poly(0); |
---|
308 | list G11V=list( list(r1),list(),list(),list(),list(),list(r2),list(),list(r3)); |
---|
309 | TestJMark(G11V,r); |
---|
310 | //Result 11 |
---|
311 | //=>1 |
---|
312 | |
---|
313 | |
---|
314 | |
---|
315 | //Example 12 |
---|
316 | ring r=0, (x,y,z), rp; |
---|
317 | jmp r1; |
---|
318 | r1.h=z; |
---|
319 | r1.t=poly(0); |
---|
320 | jmp r2; |
---|
321 | r2.h=y^6; |
---|
322 | r2.t=x*y^5+x^2*y^4+x^3*y^3+x^4*y^2+x^5*y; |
---|
323 | jmp r3; |
---|
324 | r3.h=x^5*y^3+x^7*y; |
---|
325 | r3.t=poly(0); |
---|
326 | list G12V=list( list(r1),list(),list(),list(),list(),list(r2),list(),list(r3)); |
---|
327 | TestJMark(G12V,r); |
---|
328 | //Result 12 |
---|
329 | //=>1 |
---|
330 | |
---|
331 | //Example 13 |
---|
332 | ring r=0, (x,y,z), rp; |
---|
333 | jmp r1; |
---|
334 | r1.h=z; |
---|
335 | r1.t=x+y; |
---|
336 | jmp r2; |
---|
337 | r2.h=y^6; |
---|
338 | r2.t=x*y^5+x^2*y^4+x^3*y^3+x^4*y^2+x^5*y; |
---|
339 | jmp r3; |
---|
340 | r3.h=x^5*y^3+x^7*y; |
---|
341 | r3.t=poly(0); |
---|
342 | list G13F=list( list(r1),list(),list(),list(),list(),list(r2),list(),list(r3)); |
---|
343 | TestJMark(G13F,r); |
---|
344 | //Result 13 |
---|
345 | //=>NOT A BASIS |
---|
346 | //0 |
---|
347 | |
---|
348 | //Example 14 |
---|
349 | ring r=0, (x,y,z),rp; |
---|
350 | jmp r1; |
---|
351 | r1.h=yz; |
---|
352 | r1.t=y^2; |
---|
353 | jmp r2; |
---|
354 | r2.h=z^2; |
---|
355 | r2.t=xy+xz+y^2; |
---|
356 | jmp r3; |
---|
357 | r3.h=x*y^2; |
---|
358 | r3.t= poly(0) ; |
---|
359 | jmp r4; |
---|
360 | r4.h=y^3; |
---|
361 | r4.t=poly(0); |
---|
362 | jmp r5; |
---|
363 | r5.h=x^4; |
---|
364 | r5.t= poly(0) ; |
---|
365 | jmp r6; |
---|
366 | r6.h=x^3*y ; |
---|
367 | r6.t= poly(0) ; |
---|
368 | jmp r7; |
---|
369 | r7.h= x^3*z; |
---|
370 | r7.t= poly(0) ; |
---|
371 | list G14V=list(list(r1,r2),list(r3,r4),list(r5,r6,r7)); |
---|
372 | TestJMark(G14V,r); |
---|
373 | //Result 14 |
---|
374 | //=>1 |
---|
375 | |
---|
376 | |
---|
377 | |
---|
378 | //Example 15 |
---|
379 | ring r=0, (x,y,z),rp; |
---|
380 | jmp r1; |
---|
381 | r1.h=yz; |
---|
382 | r1.t=y^2; |
---|
383 | jmp r2; |
---|
384 | r2.h=z^2; |
---|
385 | r2.t=xy+xz+y^2; |
---|
386 | jmp r3; |
---|
387 | r3.h=x*y^2; |
---|
388 | r3.t= poly(0) ; |
---|
389 | jmp r4; |
---|
390 | r4.h=y^3; |
---|
391 | r4.t=x^3; |
---|
392 | jmp r5; |
---|
393 | r5.h=x^4; |
---|
394 | r5.t= poly(0) ; |
---|
395 | jmp r6; |
---|
396 | r6.h=x^3*y ; |
---|
397 | r6.t= poly(0) ; |
---|
398 | jmp r7; |
---|
399 | r7.h= x^3*z; |
---|
400 | r7.t= poly(0) ; |
---|
401 | list G15F=list(list(r1,r2),list(r3,r4),list(r5,r6,r7)); |
---|
402 | TestJMark(G15F,r); |
---|
403 | //Result 15 |
---|
404 | //=>NOT A BASIS |
---|
405 | |
---|
406 | tst_status(1);$ |
---|