Hello

In my last question, I asked for help converting an old Maple V3 code to the latest version. With the help of @Rouben Rostamian, I managed to get most of the procedures working again. Unfortunately, there is one procedure that I cannot figure out how to convert. Below is the procedure, along with an example that works and one that does not.

saturbasis := proc(ps,js,ord)
local qs,gb,zz,j,aux;
print("ps = ",ps):
print("js = ",js):
print("ord = ",ord):
if js <> {} then
qs := [op(ps),'`@z`.j*js[j]-1' $ ('j' = 1 .. nops(js))];print("qs = ",%):
zz := ['`@z`.(nops(js)-j+1)' $ ('j' = 1 .. nops(js))];print("zz = ",%):
aux:= [op(zz),'ord[nops(ord)-j+1]' $ ('j' = 1 .. nops(ord))]:print("aux = ",aux):
gb := grobner['gbasis'](qs,aux,'plex');
qs := [];
for j to nops(gb) do
if {op(zz)} minus indets(gb[j]) = {op(zz)} then
qs := [gb[j],op(qs)]
fi
od
else qs := ps
fi;
qs
end proc:

First example:

ps:=[2*x1^2 + 3*x2^2 + 4*x1 + x2, x1*x3 - 3*x2 - 1, 2*x1*x4 + 3*x2 + 1]:
js:={x1}:
ord:=[x1, x2, x3, x4]:
saturbasis(ps,js,ord);
[ 2 2
"ps = ", [2 x1 + 3 x2 + 4 x1 + x2, x1 x3 - 3 x2 - 1,
]
2 x1 x4 + 3 x2 + 1]
"js = ", {x1}
"ord = ", [x1, x2, x3, x4]
[ 2 2
"qs = ", [2 x1 + 3 x2 + 4 x1 + x2, x1 x3 - 3 x2 - 1,
]
2 x1 x4 + 3 x2 + 1, @z x1 - 1]
"zz = ", [@z]
"aux = ", [@z, x4, x3, x2, x1]
Warning, grobner[gbasis] is deprecated. Please, use Groebner[Basis].
[ 2 2
[2 x1 + 3 x2 + 4 x1 + x2, x1 x3 - 3 x2 - 1, x2 x3 + 2 x1 + 4,
]
2 x4 + x3]

Second example:

ps:=[2*x1*x4^2 + 3*x1 + x4 + 6, x3*x4^3 + 2*x4^4 - 9*x3 - 18*x4, 2*x2*x4^2 + 3*x2 - 4*x4 + 1]:
js:={2*x4^2 + 3, x4^3 - 9}:
ord:={2*x4^2 + 3, x4^3 - 9}:
saturbasis(ps,js,ord);
[ 2
"ps = ", [2 x1 x4 + 3 x1 + x4 + 6,
3 4 2 ]
x3 x4 + 2 x4 - 9 x3 - 18 x4, 2 x2 x4 + 3 x2 - 4 x4 + 1]
/ 2 3 \
"js = ", { 2 x4 + 3, x4 - 9 }
\ /
/ 2 3 \
"ord = ", { 2 x4 + 3, x4 - 9 }
\ /
[ 2
"qs = ", [2 x1 x4 + 3 x1 + x4 + 6,
3 4 2
x3 x4 + 2 x4 - 9 x3 - 18 x4, 2 x2 x4 + 3 x2 - 4 x4 + 1,
/ 2 \ / 3 \ ]
@z \2 x4 + 3/ - 1, 2 @z \x4 - 9/ - 1]
"zz = ", [2 @z, @z]
[ 3 2 ]
"aux = ", [2 @z, @z, x4 - 9, 2 x4 + 3]
Warning, grobner[gbasis] is deprecated. Please, use Groebner[Basis].
Error, (in grobner:-gbasis) invalid input: Groebner:-Basis expects its 2nd argument, tord1, to be of type Or(ShortMonomialOrder,name,MonomialOrder), but received plex(2*`@z`,`@z`,x4^3-9,2*x4^2+3)

I suppose that the "." is no longer used as it was back in Maple V3, and it seems that the author of the procedure was creating extra auxiliary variables to solve the problem.

What did the author use @ for creating the variables? And how to fix the error?

Many thanks