I am writing a function in worksheet mode.
I made a newline with "shift+enter". A new line indeed is made.
like:
MON_DEGREE :=proc(f,variables,weights) local deg, i;
if not type(f,polynom) then
ERROR(`ERROR: The First argument must be a monomial.`);
end if;
end
But I found in other worksheet file, it is like:
>MON_DEGREE :=proc(f,variables,weights) local deg, i;
>if not type(f,polynom) then
>ERROR(`ERROR: The First argument must be a monomial.`);
>end if;
>end
there is a '>' at the beginning of each new line.
How can I make it in this way? Only "shift+center" is not enough.
thank you.

Just a quick question:

The string in my file "s.txt" is

p=a^c*m;

after parsing it, it became:

a^{c} m;

is that weird?

Thanks

Sorry, I fixed it.

Before using cnt, first assigning some value to it.

T[cnt]:=parse(line);

and then

for cnt do

......

Thanks a lot.

I got an error message:

"error, (in unknown) invalid terms in product"

HandleGB :=proc(file) local line, T,L;

f:=fopen(file,READ);

try

T:=table();

for cnt do

line:=readline(f);

if line=0 then break; end if;

T[cnt]:=parse(line);

end do;

finally

fclose(f);

end try; L:=convert(T,'list');

end;

Thanks

I changed the code in your way:

/***************code***********************/

Handle :=proc(f) local line,line2, L;

L:=[];

line:=readline("s.txt");

while line <> 0

do

L:=[op(L),line2];

line:=readline("s.txt");

line2:=parse(line);

end do;

L;

end proc;

/***************code***********************/

when I executed the function, I got a message:

invalid input: parse expects its 1st argument, st, to be of type string, but received 0

Could you explain it a little bit?

Thanks

another weird problem is when I created a file using document mode, the readline can work fine.
readline("s.txt");
"1+1=2"
the problem here is that i do not want the quotation marks ".
How can I remove the quotation marks ".
Thanks in advance.

Thank you.
I just have a quick read and it is not easy to master the openmaple quickly.
I just want to use Groebner Basis in my application. Does anyone have any ideas how to do that?

Sorry, the second question should be:
Why are there brackets in the result which is actually NOT a fully expanded expression.

For a given galois field, suppose there is such a polynomial function mapping from GF(q) to GF(q):
x^(q+m)+x^(q+m-1)+x^(q+m-2)+...+x^(1).
I can use x^q-x=0 to "reduce" it to such the following form:
x^(q-1)+x^(q-2)+x^(q-3)+...+x^(1)
now, the problem is whether this is the only method (x^q-x=0) to reduce a polynomial function mapping from GF(q) to GF(q)?
Thanks a lot.

From GF(2^m) to GF(2^m), there is a polynomial function:
sum of f(a)(1-(x-a)^(q-1)), for all a belongs to GF(2^m),
I wonder whether such a polynomial function is canonical?
Thanks in advance , Alex.

alias(f=RootOf(_Z^2+_Z+1));
with calculations mod 2 defines GF(4) with elements 0, 1, f, f+1.
--------------------------------------------------------------------------------
for this part, I can understand, but i cannot understand the following part:
--------------------------------------------------------------------------------
alias(k=RootOf(_Z^2+_Z+f));
with calculations mod 2 defines GF(16) with elements 0, 1, f, f+1, k, k+1, k+f, k+f+1, kf, kf+1, kf+f, kf+f+1, kf+k, kf+k+1, kf+k+f, kf+k+f+1.
----------------------------------------------------------------------------
this is the form for each element in GF(16), and x is the root of _Z^2+_Z+f=0
ax^3+bx^2+cx+d
substitute a, b,c,d from 0000 to 1111, we can get 16 different elements.
How can we generate 'f' here?
Thanks

yes, but do we have a polynomial function between them?
For example, from GF(4) to GF(16)?
Besides, whether there is a function from GF(16) to GF(4)?
Thanks a lot, Alex.

Thank you for your explain.

After further study, I do not think there is such a mapping exist. If such a mapping exist, I mean, if there is a polynomial function to map between Z(2^m) and GF(2^m) to satisfy the addition and multiplication ,then, Z(2^m) will be a field which is impossible.