restart;

with(Groebner):

IsNullZero := proc(tau)

if assigned(tau) then

return tau

else

return 0

end if

end proc;

DoExist := proc(tau, n)

if rtable_num_elems(tau) >= n then

return tau[n];

else

return 0;

end if;

end proc;

LeadingTermVector := proc(a,b)

result := a;

for i from 1 to rtable_num_elems(a) do

result[i] = `*`(LeadingTerm(a[i], b));

od;

return result;

end proc;

LCMVector := proc(a,b)

result := a;

for i from 1 to rtable_num_elems(a) do

result[i] = lcm(a[i], b[i]);

od;

return result;

end proc;

SPolynomialVector := proc(a, b, c)

result := a;

for i from 1 to rtable_num_elems(a) do

result[i] = SPolynomial(a[i], b[i], c);

od;

return result;

end proc;

DivideVector := proc(a, b)

result8 := a;

for i from 1 to rtable_num_elems(a) do

if a[i] = 0 then

result8[i] = 0;

else

result8[i] = a[i]/b[i];

end if;

od;

return result8;

end proc;

BasisVector := proc(a, b, num)

result6 := 0;

for i from 1 to num do

result6[i] := 0;

od;

for i from 1 to num do

result6[i] := Basis(convert(a(i, 1 .. -1),list), b);

od;

return result6;

end proc;

NormalFormVector := proc(a, b, c, d, num)

for i from 1 to num do

NormalForm(a[i], b[i], c, d);

od;

end proc;

NormalFormVector := proc(a, b, c, d, num)

for i from 1 to rtable_num_elems(b) do

NormalForm(a[i], b[i], c, d);

od;

end proc;

g1 := Vector([1, 1]);

g2 := Vector([x+y, 0]);

g3 := Vector([y^2+1, 0]);

g4 := Vector([0, y^3+y]);

g5 := Vector([0, x-y]);

X1 := `*`(LeadingTermVector(g1, tdeg(x, y)));

X2 := `*`(LeadingTermVector(g2, tdeg(x, y)));

X3 := `*`(LeadingTermVector(g3, tdeg(x, y)));

X4 := `*`(LeadingTermVector(g4, tdeg(x, y)));

X5 := `*`(LeadingTermVector(g5, tdeg(x, y)));

X12 := LCMVector(X1,X2);

X13 := LCMVector(X1,X3);

X14 := LCMVector(X1,X4);

X15 := LCMVector(X1,X5);

X23 := LCMVector(X2,X3);

X24 := LCMVector(X2,X4);

X25 := LCMVector(X2,X5);

X34 := LCMVector(X3,X4);

X35 := LCMVector(X3,X5);

X45 := LCMVector(X4,X5);

S12 := SPolynomialVector(g1, g2, lexdeg([x, y]));

S13 := SPolynomialVector(g1, g3, lexdeg([x, y]));

S14 := SPolynomialVector(g1, g4, lexdeg([x, y]));

S15 := SPolynomialVector(g1, g5, lexdeg([x, y]));

S23 := SPolynomialVector(g2, g3, lexdeg([x, y]));

S24 := SPolynomialVector(g2, g4, lexdeg([x, y]));

S25 := SPolynomialVector(g2, g5, lexdeg([x, y]));

S34 := SPolynomialVector(g3, g4, lexdeg([x, y]));

S35 := SPolynomialVector(g3, g5, lexdeg([x, y]));

S45 := SPolynomialVector(g4, g5, lexdeg([x, y]));

e1 := Vector([1,0,0,0,0]);

e2 := Vector([0,1,0,0,0]);

e3 := Vector([0,0,1,0,0]);

e4 := Vector([0,0,0,1,0]);

e5 := Vector([0,0,0,0,1]);

#with(LinearAlgebra):

eq1 := S12 - expand(h121*g1 + h122*g2 + h123*g3 + h124*g4 + h125*g5):

for i from 1 to 2 do

NormalForm(eq1[i], r7[i], tdeg(x, y, h121, h122, h123, h124, h125), 'Q');

od;

NormalFormVector(eq1,

BasisVector(<g1|g2|g3|g4|g5>, tdeg(x, y, h121, h122, h123, h124, h125), 2),

tdeg(x, y, h121, h122, h123, h124, h125),

'Q',2);

**Q = BasisVector(<g1|g2|g3|g4|g5>**, tdeg(x, y, h121, h122, h123, h124, h125), 2)

**when NormalFormVector function run this**

**rtable_num_elems got this error**