 # Ordering multivariate polynomials (AbstractAlgebra)

Bonjour à tous !
I’m working now with multivariate polynomials of the AbstractAlgebra package
Everything works well, but I have a problem with ordering.
To make simple let’s consider the case of only 2 variables say ‘X’ and ‘Y’ as in textbooks.
I see 3 natural (usual) ways of ordering such polynomials given that such ordering affects only presentation of objects (printing - displaying, etc).

1. Decreasing powers of the first indeterminate which means that if A is the base ring we consider any p in A[X,Y] to be an element of A[Y] that is a polynomial in the single variable X with coefficients in A[Y]
2. Second way consists in exchanging the roles of X and Y so that our objects are elements of A[Y] and ordering is according decreasing powers of Y
3. Third way consists in ordering monomial components according their total degree.
Now the package doc specifies that ordering is controlled by a parameter ‘ordering’ with three possible values listed as :lex :deglex :degrevlex
Although I can suppose that lex is short for lexical deg shot for degree and rev short for reverse I don’t see very well the meaning, and my test simply do not work printing is done according my case n°1 whatever I try for a dynamic change of ordering.
Here’s my code :
``````using AbstractAlgebra
R, (X, Y) = QQ["X", "Y"] #polynômes à deux variables à coeff. rationnels
g = X^2*Y + 3X*Y^5 + 1
ordering(R)=:lex
println(g)
ordering(R)=:deglex
println(g)
ordering(R)=:degrevlex
println(g)
#=output
X^2*Y + 3*X*Y^5 + 1
X^2*Y + 3*X*Y^5 + 1
X^2*Y + 3*X*Y^5 + 1
=#
``````

I would be pleased if somebody can to me the meaning of the three symbols and the correct way to fix the ordering parameter (dynamically if possible). With the above code I have no compilation error but no result …
Thank you.