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 simplyfied 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], O;        use C[X:INDETS], O;
R is the identifier of a CoCoALanguage variable, C is a RING, X is an expression that defines the indeterminates, O 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 made to be the current ring with the command use .

/**/  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 ring S is the current ring
/**/  CurrentRing;
RingWithID(23, "RingWithID(22)[x,y]")