up previous next
2.9.2 Polynomial Rings
CoCoA starts with the default (polynomial) ring R ::= QQ[x,y,z]. Polynomial rings are created with the function NewPolyRing , but there is a special simplified syntax working in most cases: it must be preceded by the command use or by the symbol ::= (or both)
     R ::= C[X:INDETS];           use C[X:INDETS];
     R ::= C[X:INDETS], Ord;      use C[X:INDETS], Ord;
R is the identifier of a CoCoALanguage variable, C is a RING, X is an expression that defines the indeterminates, Ord is a pre-defined ordering (lex, deglex, degrevlex). The default ordering is DegRevLex.

After the ring is defined using the above syntax, it can be chosen as the current ring with the command use .

Example
/**/  use R ::= QQ[a,b,c];  -- define and use the ring R
/**/  K := NewFractionField(R);
/**/  S ::= K[x,y], Lex;
/**/  CurrentRing;  -- the current ring is still R
RingWithID(21, "QQ[a,b,c]")
/**/  use S;  -- now the current ring is S
/**/  CurrentRing;
RingWithID(23, "RingWithID(22)[x,y]")