All inputs must be homogenized to get Gröbner basis
by the command `groebner`.
Usually, the variable is used for the homogenization.
In this example,
Gröbner bases in
are computed,
but rational coefficients in the input is not allowed.
All coefficients must be integers.

The operator `groebner_sugar` is for non-homogenized
computation of Gröbner basis.

The following code is a convinient template to obtain Gröbner bases.

% gbrev.sm1 [ (y,x) % Change here. Declare the variables that you use. ring_of_polynomials 0 % Change here. Define the characteristic here. ] define_ring /inputp [ % Polynomials must be enclosed by ( and ). or $ and $. ( x^2+y^2-4*h^2 ). % Change here. Write a polynomial for input. (x*y-h^2). % Change here. Write a polynomial for input. ] def [inputp] groebner /ans set ans dehomogenize ::

The letters after the symbol `%` are ignored by `kan/sm1` ;
comments begin with the symbol `%`.
If one needs to compute Gröbner basis of a given set of polynomials,
one may only change the lines marked by the comment
`% Change here`.

% gblex.sm1 [ (y,x) % Change here. Declare the variables that you use. ring_of_polynomials [[(y) 1] [(x) 1]] weight_vector 0 % Change here. Define the characteristic here. ] define_ring /inputp [ % Polynomials must be enclosed by ( and ). or $ and $. ( x^2+y^2-4 ). % Change here. Write a polynomial for input. ( x*y-1 ). % Change here. Write a polynomial for input. ] def [inputp] groebner_sugar /ans set ans ::In this example, the order is specified by the weight vector. If the line

` [vec1 vec2 ...] weight_vector `

is given in the definition of the ring,
monomials are compared by the weight vector
The weigth vector is expressed in the form
`[v1 w1 v2 w2 ... vp wp ]`,
which
means that the variable `v1` has the weight `w1`,
the variable `v2` has the weight `w2`, .
For example,
when the ring is defined by

[(x,y,z) ring_of_polynomials [[(x) 1 (y) 3] [(z) -5]] weight_vector 0] define_ringtwo monomials if and only if or ( and ) or ( and and ) where denotes the graded reverse lexicographic order.

The Buchberger's criterion 1 is turned off by default,
because it does not work in case of the ring of differential operators.
To turn it on,
input
` [(UseCriterion1) 1] system_variable `

The operator `groebner` outputs the status of degree by degree computation
of Gröbner basis.
To turn off this message, input
` [(KanGBmessage) 0] system_variable `

% gbelim.sm1 [ (x,y,z) % Change here. Declare the variables that you use. ring_of_polynomials [[(x) 1 (y) 1]] weight_vector 0 % Change here. Define the characteristic here. ] define_ring /inputp [ % Polynomials must be enclosed by ( and ). or $ and $. ( x^2+y^2+z^2-1 ). % Change here. Write a polynomial for input. ( x*y+y*z+z*x-1 ). % Change here. Write a polynomial for input. ( x*y*z-1 ). % Change here. Write a polynomial for input. ] def [inputp] groebner_sugar /ans set ans dehomogenize ::