In SINGULAR the standard basis algorithm is implemented as follows:

*S*:=**StandardBasis**

INPUT:*G*, a set of polynomial vectors

OUTPUT:*S*, a standard base of the submodule generated by*G*with respect to the given monomial ordering*S*:=*G*^{h}

update*S*)

HCtest

*T*:=*S*

*L*:=`initPairs`(*S*)

clear*S*)

WHILE`DO`-
*p*:= (*a*,*b*,*s*) the last element from*L*

IF the spoly of*a*and*b*is not computed yet THEN*s*:= spoly (*a*,*b*)

*h*:= LazyNF (*p*|*T*)

IF THEN- HCtest

updatePairs (*h*)

clear (*S*)

`END`

*S*:=`completeReduce`(*S*)`.`

During the algorithm the set *S* is sorted by increasing monomial ordering of
the leading terms of the elements with respect to

The set *T* (respectively *L*) is sorted by increasing (respectively
decreasing) monomial ordering of the leading terms of the elements
(respectively the S-polynomial of the corresponding pair) with respect to

or

Now we explain the procedures used in the standard basis algorithm:

**Update**

INPUT: *S*, a set of polynomial vectors

OUTPUT: *S*, the set of polynomial vectors after the interreduction

`for all `` DO `` NFBuchberger `
`.
`

**HCtest**

INPUT: *S*, a set of polynomials

OUTPUT: a boolean value (does a ``highest corner'' exist?)
and, if so, the monomial ``highest corner''

`If `
` (that is `*r* = 1`) then it tests if there are
`
` such that `
`
occur as leading terms in `*S*` for all `*i*`. If this is true it computes the minimal
monomial `` (with respect to the ordering `<` in `*K*[*x*]`) which is not
in the ideal generated by the leading terms of the elements of `*S*(*t* = 1)`.
This monomial is called ``highest corner''.
`

`It changes the polynomial arithmetic to cancel all monomials `
`
with `
` in further computations.`

1cm

correspond to leading terms of *S*(*t* = 1),
corresponds to the ``highest corner'' .

` initPairs `

INPUT:

OUTPUT:

`We have two options: usually the criteria are applied for the
pairs `
` that is in `*K*[*x*]`. In the
option sugar crit we apply it to `*L*` using the idea of [GMNRT].`

**Clear**

INPUT and OUTPUT: *S*, a set of polynomial vectors

`Deletes `*f*` from `*S*` if `
` for some `` and ``.
`

**Update**

INPUT and OUTPUT: *h*, a polynomial vector

- IF sugar THEN RETURN END

IF*t*|*h*THEN- choose
maximal such that

**UpdatePairs**

INPUT: *h*, a polynomial vector

*S*, a set of polynomial vectors

OUTPUT: *L*, the set of critical pairs from *S* and *h*

- It updates the pairset
*L*.

,*s*the leading term of spoly.

The criteria to cancel useless pairs are used as in initPairs.

*h* :=` LazyNF `

INPUT:

(

OUTPUT:

*h*:=*s*

WHILE exist such that for some DO- choose the first possible
*f*with respect to the ordering in*T*such that is minimal.

IF THEN- IF the position of (
*a*,*b*,*h*) in*L*is not the last one THEN

RETURN 0

END

NFupdate pairs (*h*)

*h*:= spoly

update (*h*)

IF degree (*h*) > degree(*s*) and

the position of (*a*,*b*,*h*) in*L*is not the last one THEN-

RETURN 0

**NFupdatePairs**

INPUT: *h*, a polynomial vector

*S*, a set of polynomial vectors

OUTPUT: *L* the set of some critical pairs from *S* and *h*

- IF NOT more pairs THEN RETURN END

the leading term of spoly

The criteria to cancel useless pairs are used as in initPairs.

` completeReduce `

INPUT and OUTPUT:

- IF < is a wellordering or
and

THEN-
*S*:=*S*(*t*=1)

FOR all DO*s*:= redtail (*s*|*S*)

- FOR all
DO
*s*:= redtail (*s*|*S*)

*S*:=*S*(*t*= 1)

` redtail `

INPUT and OUTPUT: