1 | //declare different rings and show them |
---|
2 | ring r0; |
---|
3 | r0; |
---|
4 | ring r1=0,(x,y,z),ds; |
---|
5 | r1; |
---|
6 | ring r2=0,(x,y,z),wp(1,2,3); |
---|
7 | r2; |
---|
8 | ring r3=32003,(x,y,z),(a(1,2,3),ws(4,5,6)); |
---|
9 | r3; |
---|
10 | ring r4=32003,(x,y,z),(a(1,2),ws(4,5,6)); |
---|
11 | r4; |
---|
12 | ring r=32003,(x,y,z),(c,dp); |
---|
13 | poly f=x+z; |
---|
14 | f; |
---|
15 | f+1; |
---|
16 | f=f+1; |
---|
17 | f; |
---|
18 | // |
---|
19 | // declare a couple of rings with different characteristics |
---|
20 | // |
---|
21 | proc ringbundle |
---|
22 | { |
---|
23 | // parameters are different characteristics |
---|
24 | if (size(#) == 0) |
---|
25 | { |
---|
26 | "usage:ringbundle(char1, char2, ...)"; |
---|
27 | return (); |
---|
28 | } |
---|
29 | string @ex; |
---|
30 | for (int @i=1; @i<=size(#); @i=@i+1) |
---|
31 | { |
---|
32 | @ex = "ring rb(" , string(@i) + ") = " + string(#[@i]) + ",(x, y, z),lp;"; |
---|
33 | execute(@ex); |
---|
34 | @ex = "export rb(" , string(@i) + ");"; |
---|
35 | execute(@ex); |
---|
36 | } |
---|
37 | } |
---|
38 | ringbundle(); // ask for help |
---|
39 | ringbundle(3,5,7,11); // create rb(1) with characteristic 3, etc |
---|
40 | listvar(all); |
---|
41 | rb(4); |
---|
42 | LIB "tst.lib";tst_status(1);$; |
---|