# ApCoCoA-1:NCo.MRGB

## NCo.MRGB

Enumerate a (partial) Groebner basis of a finitely generated two-sided ideal in a finitely presented monoid ring via the Buchberger procedure.

Note that, given a word ordering `Ordering`, a set `G` of non-zero polynomials is called a *Groebner basis* with respect to `Ordering` if, for every non-zero polynomial `f` in the ideal `<G>`, there exists a polynomial `g` in `G` such that `MRLW(f)` is a multiple of `MRLW(g)`. Note that a two-sided ideal can not have finite Groebner bases.

### Syntax

NCo.MRGB(X:STRING, Ordering:STRING, Relations:LIST, G:LIST[, DB:INT, LB:INT, OFlag:INT]):LIST

### Description

*Please note:* The function(s) explained on this page is/are using the *ApCoCoAServer*. You will have to start the ApCoCoAServer in order to use it/them.

Please set coefficient field via the function NCo.SetFp (or NCo.UnsetFp) before calling this function. The default coefficient field is the field of rational numbers, i.e. RAT in CoCoAL. For more information, please check the relevant functions.

@param

*X:*a finite alphabet (or set of indeterminates). It is of STRING type. Note that every letter in X MUST appear only once.The order of letters in X induces word orderings.@param

*Ordering:*a word ordering induced by the order of letters in X. It is a STRING, which is a shortened-form of the name of corresponding word ordering. Note that "LLEX" (the length-lexicographic ordering), "ELIM" (an elimination ordering) and "LRLEX" (the length-reverse-lexicographic ordering) are supported currently. See NCo.SetOrdering for more details.@param

*Relations:*a finite set of relations. It is of LIST type. Each element in Relations is of the form [W1, W2], where W1 and W2 are words in`<X>`. Each word is represented as a STRING. For example, the word`xy^2x`is represented as "xyyx", and the identity is represented as the empty string "". Thus, the relation`(yx, xy)`is represented as ["yx", "xy"], and the set of relations`{(yx, xy),(zx,xz),(zy,yz)}`is represented as [["yx", "xy"],["zx", "xz"],["zy", "yz"]].@param

*G:*a LIST of non-zero polynomials generating a two-sided ideal. Each polynomial is represented as a LIST of monomials, which are pairs of the form [C, W] where W is a word in`<X>`and C is the coefficient of W. For example, the polynomial`f=xy-y+1`is represented as F:=[[1,"xy"], [-1, "y"], [1,""]].@return: a LIST of polynomials, which is a Groebner basis with respect to the word ordering Ordering if there exists a finite Groebner basis and the enumerating procedure doesn't terminate due to reaching the degree bound DB or the loop bound LB, and is a partial Groebner basis otherwise.

About 3 optional parameters: for most cases we do not know whether or not there exists a finite Groebner basis beforehand. Thus, the function offers 3 optional parameters for the enumerating procedure. Note that at the moment *all* of the following 3 optional parameters must be used at the same time.

@param

*DB:*a positive INT, which gives a degree bound of S-polynomials (or obstructions) during the enumerating procedure. When the degree bound is reached, the procedure will be interrupted and return a partial Groebner basis.@param

*LB:*a positive INT, which gives a loop bound of enumerating steps. When the LB-th enumerating step finishes, the procedure will be interrupted and return a partial Groebner basis.@param

*OFlag:*a non-negative INT, which is a multi-switch for the output of the ApCoCoAServer. If OFlag=0, the server displaces nothing on the screen. If OFlag=1, the server prints basic information on the enumerating procedure, such as the number of enumerating steps has been proceeded, the number of elements in partial Groebner basis, the number of unselected obstructions; the total number of obstructions, the number of selected obstructions, and the number of unnecessary obstructions. If OFlag=2, besides the information as OFlag=1, the server also displays explicitly the elements in partial Groebner basis and the current selected S-polynonial. Note that the initial idea of using OFlag is to trace and debug the enumerating procedure.

#### Example

X := <quotes>xyzt</quotes>; Ordering := <quotes>LLEX</quotes>; Relations:=[]; F1 := [[1,<quotes>xx</quotes>], [-1,<quotes>yx</quotes>]]; F2 := [[1,<quotes>xy</quotes>], [-1,<quotes>ty</quotes>]]; F3 := [[1,<quotes>xt</quotes>], [-1, <quotes>tx</quotes>]]; F4 := [[1,<quotes>yt</quotes>], [-1, <quotes>ty</quotes>]]; G := [F1, F2,F3,F4]; NCo.MRGB(X, Ordering, Relations, G); [[[1, <quotes>yt</quotes>], [-1, <quotes>ty</quotes>]], [[1, <quotes>xt</quotes>], [-1, <quotes>tx</quotes>]], [[1, <quotes>xy</quotes>], [-1, <quotes>ty</quotes>]], [[1, <quotes>xx</quotes>], [-1, <quotes>yx</quotes>]], [[1, <quotes>tyy</quotes>], [-1, <quotes>tty</quotes>]], [[1, <quotes>yyx</quotes>], [-1, <quotes>tyx</quotes>]]] ------------------------------- X := <quotes>abc</quotes>; Ordering := <quotes>LLEX</quotes>; Relations := [[<quotes>aa</quotes>,<quotes></quotes>], [<quotes>bb</quotes>,<quotes></quotes>], [<quotes>ab</quotes>,<quotes>c</quotes>], [<quotes>ac</quotes>, <quotes>b</quotes>], [<quotes>cb</quotes>, <quotes>a</quotes>]]; F1 := [[1,<quotes>a</quotes>], [1,<quotes>b</quotes>], [1,<quotes>c</quotes>]]; F2 := [[1,<quotes>b</quotes>]]; G := [F1, F2]; NCo.MRGB(X, Ordering, Relations, G); [[[1, <quotes>b</quotes>]], [[1, <quotes>a</quotes>], [1, <quotes>b</quotes>], [1, <quotes>c</quotes>]]] -------------------------------

### See also