1 | LIB "tst.lib"; tst_init(); |
---|
2 | ring R = 0,(x,y,z),dp; // polynomial ring (global ordering) |
---|
3 | poly f = y4z3+2x2y2z2+4z4+5y2+1; |
---|
4 | f; // display f in a degrevlex-ordered way |
---|
5 | short=0; // avoid short notation |
---|
6 | f; |
---|
7 | short=1; |
---|
8 | leadmonom(f); // leading monomial |
---|
9 | |
---|
10 | ring r = 0,(x,y,z),ds; // local ring (local ordering) |
---|
11 | poly f = fetch(R,f); |
---|
12 | f; // terms of f sorted by degree |
---|
13 | leadmonom(f); // leading monomial |
---|
14 | |
---|
15 | // Now we implement more "advanced" examples of rings: |
---|
16 | // |
---|
17 | // 1) (K[y]_<y>)[x] |
---|
18 | // |
---|
19 | int n,m=2,3; |
---|
20 | ring A1 = 0,(x(1..n),y(1..m)),(dp(n),ds(m)); |
---|
21 | poly f = x(1)*x(2)^2+1+y(1)^10+x(1)*y(2)^5+y(3); |
---|
22 | leadmonom(f); |
---|
23 | leadmonom(1+y(1)); // unit |
---|
24 | leadmonom(1+x(1)); // no unit |
---|
25 | |
---|
26 | // |
---|
27 | // 2) some ring in between (K[x]_<x>)[y] and K[x,y]_<x> |
---|
28 | // |
---|
29 | ring A2 = 0,(x(1..n),y(1..m)),(ds(n),dp(m)); |
---|
30 | leadmonom(1+x(1)); // unit |
---|
31 | leadmonom(1+x(1)*y(1)); // unit |
---|
32 | leadmonom(1+y(1)); // no unit |
---|
33 | |
---|
34 | // |
---|
35 | // 3) K[x,y]_<x> |
---|
36 | // |
---|
37 | ring A4 = (0,y(1..m)),(x(1..n)),ds; |
---|
38 | leadmonom(1+y(1)); // in ground field |
---|
39 | leadmonom(1+x(1)*y(1)); // unit |
---|
40 | leadmonom(1+x(1)); // unit |
---|
41 | |
---|
42 | tst_status(1);$ |
---|