The new Groebner package in Release 5 allows to use user defined termorders in the form: user(P,L) (e.g. of type: identical(user)([procedure,list(name)]) )
I do not succeed in making Maple to accept my specific user(P,L) There is an error message telling that the type is not correct ???
Remark: My termorder is a module-induced order on terms which are linear in a subset of the variables and is such that it cannot be represented by a matrix.
Using the Groebner package in Maple V release 5 one can construct different term orders on the polynomialring Q[X_1,...,X_n]. Especialy one can construct weighted graded lexicographic order where the weights are elements in N (the set of natural numbers). Also one can construct the weighted graded order where the weights are linearly independent elements in \(N^n\). I will however like to be able to work with
weighted graded lexicographic orders, where the weights are elements in \(N^r, 1<r<n\). Fortunately the package contains a facility for creating userdefined term orders.
Unfortunately I have difficulties with using this facility. Following the help on Groebner[termorder] I do the following. First I load the Groebner package. I then define a procedure P, that takes two terms (actually monomials) as input and then return true if the first is smaller than the last with respect to my term order, and returns false if this is not the case. Then I define the polynomialring. In the case \(n=3\) I write
with(Ore_algebra); A:=poly_algebra(X,Y,Z);
I should now be able to create the wanted termorder. As I understand the help pages, I should write
T:=termorder(A,user(P,[X,Y,Z]));
or something like that. No matter what I try, I get the message that the second argument is of a wrong type. I will be very gratefull to hear if someone knows how to make userdefined termorders on a polynomialring.
I have encountered the same problem with user-defined term orders in the Groebner package in Maple V Release 5. I believe the cause is a bug in the definition of the Groebner[termorder] procedure. If you look at the code, you will see that the procedure heading looks like this:
proc (Alg::OreAlgebra, ord::{ShortTermOrder, {identical(user), identical(user_min)}({[procedure, procedure, list(name)], [procedure, list(name)]})})
(i.e. the ord parameter is supposed to be either a predefined ShortTermOrder, or else the string "user" followed in parentheses by either two procedure names and a list (of variables), or else a single procedure name and a list. However I think this syntax for a type definition is actually *invalid* -- the identical "user" cannot be followed directly by the parentheses (I tried several tests like
this:
> type(user(f),identical(user)(name)); false > type(user=(f),identical(user)=(name)); true \begin{MAPLEinline} which seem to indicate that some separator is needed before the parentheses. Moreover, again in the code for Groebner[termorder], the case that is supposed to handle this looks like this: \begin{MAPLEinline} elif type(ord,{identical('user'), identical('user_min')} = ['procedure', 'list'('name')]) then term_order['order'] := order_value[1]; term_order['leadmon'] := readlib(`Groebner/create_leading_monomial`) ['general'](order_value[2],`if`(order_type = ('user'),'max','min')); term_order['orderindet'] := order_value[2]
Note the equals sign (!) I have sent a separate email message about this to Frederic Chyzak, the author of the package. Looking forward to seeing this get fixed, because it would be a very useful feature to have!
I ran into this same problem and asked Maple Tech. Support. It is a bug. Here is what they suggested to work around it:
Begin Message .................. Yes. This is a bug. I am going to forward your message to our developers for further investigation. In the mean time you may find the following workaround useful :
> restart: > with(Groebner): > with(Ore_algebra): > L:=[x,y]: > H:=poly_algebra(x,y): > P:=proc(t1,t2) if t1>t2 then true else false fi end: > readlib(`Groebner/term_order`): > NewTermOrder := subsop([1,1,2,2] = {identical(SortTermOrder), > And(specfunc(anything, {user, user_min}), {anyfunc(procedure, procedure,list(name)),anyfunc(procedure,list(name))})},`Groebner/term_order`): > # Replace the old error checking with new error checking. > # Use the NewTermOrder( ) in place of termorder( ) > NewTermOrder(H,user(P,L));
We apologize for any inconvenience this error might have caused to you. ................... End Message