One of the package that is used for finite field at the Maple is use in package. Although the use in package make easy working with the finite field, when the use in package is used in the procedure at the Maple, the procedure made the following error:
Error,
Gis not a module or member
For example consider the shown procedure:
ffield:= proc(x::integer,y::integer,n::integer)
local G,a,b;
G := GF(2, abs(n));
print(G);
a:=G:-input(x);
b:=G:-input(y);
use G in a/b end use;
end proc;
My Question: How to solve this error. I defined $G$ as a module but did not work.
Thanks for any suggestion
Edit: When I run your updated code, the following error made:
The issue is that G has not yet been defined at the time the use ... end use statement is being processed in creating the procedure. The finite field (a module) G is defined when you execute the procedure with specific arguments. The use ... end use statement is processed when the procedure ffield is created. Since G is not yet known at that time, it is not possible to process the use statement, since the exports of G are, of course, not yet known.
The correct way to code this is to write explicit bindings for the module exports in the use statement. For example,
This form of the use statement does not require the exports of G to be known (as they cannot be) when the procedure ffield is being created.