up previous next
 4.8.2 New Rings
CoCoA starts with the default ring R = QQ[t,x,y,z]. The command for building a new ring is:
```          I ::= C[X:INDETS]
```
or
```          I ::= C[X:INDETS], M_1, ... , M_n
```
where I is the identifier of a CoCoAL variable, C: RING is an expression defining a coefficient ring (Z, Q or ZZ/(N)), X is an expression that defines the indeterminates, and the M_i are modifiers. Each of these components is discussed in separate sections, below.

The modifiers are used to modify the default settings of the base ring. The modifiers are of three classes: term-orderings, weights, term orderings for modules. These classes are discussed in separate sections below. It is possible to have no modifiers. The default values are: DegRevLex for the term-ordering, 1 for the weight of each indeterminate, and ToPos for the module term-ordering.

After the ring is defined using the above syntax, it can be made to be the current ring with the command Use or it can be accessed temporarily from within the current ring with the command Using . See these two commands for more information. There are also several examples of ring-building in the tutorial.

 Example
 ``` Use R ::= QQ[x,y,z]; -- define and use the ring R S ::= ZZ/(103)[x,y], Lex; -- define the ring S with Lex term-ordering CurrentRing(); -- the current ring is still R QQ[x,y,z] ------------------------------- Use S; -- now the ring S is the current ring ZZ/(103)[x,y] ------------------------------- Using R Do X := z^2-3 EndUsing; -- define a variable in R (not the current -- ring) Y := R::x^2+y^2+z^2; -- another way of defining a variable in R while -- S is the current ring T ::= QQ[x[1..4],y[1..5,1..5]], Elim(y[1..5,1]), ToPos; -- a more -- complicated ring ```