# ApCoCoA-1:NCo.PrefixSaturation

## NCo.PrefixSaturation

Compute a prefix saturation of a polynomial in a finitely presented monoid ring.

### Syntax

NCo.PrefixSaturation(F:LIST[, 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 ring environment coefficient field ` K`, alphabet (or set of indeterminates) `X`, rewrite relations `Relations` and word ordering `Ordering` through the functions NCo.SetFp, NCo.SetX, NCo.SetRelations and NCo.SetOrdering, respectively, before using this function. The default coefficient field is the field of rational numbers, i.e. RAT in CoCoAL, and the default ordering is the length-lexicographic ordering "LLEX". For more information, please check the relevant functions.

@param

*F:*a LIST represents a polynomial in the monoid ring. Each polynomial is represented as a LIST of LISTs, i.e. as`[[C1,W1],...,[Cs,Ws]]`where, for each i, Wi is a term represented as a STRING and Ci is the coefficient of Wi. For example, polynomial`f=xy-y+1`is represented as F:=[[1,"xy"], [-1, "y"], [1,""]]. The zero polynomial`0`is represented as the empty LIST [].@return: a LIST of polynomials, which is a prefix saturation of F.

*Warn*that the procedure might not terminate!

About 2 optional parameters: in general, we can not know whether a polynomial in a monoid ring has a finite saturation or not. The function offers 2 optional parameters for controlling computing precess. Note that at the moment *all* of the following 2 additional optional parameters must be used at the same time.

@param

*LB:*a positive INT, which gives a bound for the main loop in saturation computation. When it runs through the main loop LB times, the function stops and returns a set of polynomials.@param

*OFlag:*a non-negative INT, which is a switch for the output of ApCoCoAServer. If OFlag=0, the server prints nothing on the screen. If OFlag=1, the server prints basic information about computing procedure. Note that the initial idea of OFlag is to use it as a tool for debugging and tracing the computing process.

#### Example

NCo.SetX(<quotes>abc</quotes>); NCo.SetOrdering(<quotes>LLEX</quotes>); NCo.SetRelations([[<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>]]); F := [[1,<quotes>a</quotes>],[1,<quotes>b</quotes>],[1,<quotes>c</quotes>]]; NCo.PrefixSaturation(F); [[[1, <quotes>a</quotes>], [1, <quotes>c</quotes>], [1, <quotes></quotes>]], [[1, <quotes>a</quotes>], [1, <quotes>b</quotes>], [1, <quotes>c</quotes>]], [[1, <quotes>cc</quotes>], [1, <quotes>b</quotes>], [1, <quotes>c</quotes>]], [[1, <quotes>ca</quotes>], [1, <quotes>a</quotes>], [1, <quotes></quotes>]], [[1, <quotes>bc</quotes>], [1, <quotes>cc</quotes>], [1, <quotes>b</quotes>]], [[1, <quotes>ba</quotes>], [1, <quotes>ca</quotes>], [1, <quotes></quotes>]]] -------------------------------

### See also