k:=Dom::IntegerMod(17):
f:=poly(x^2+y^2,[x,y],k):
f^17;
34 34
poly(x + y , [x, y], Dom::IntegerMod(17))
R:=Dom::IntegerMod(6):
g:=poly(2*X+Y,[X,Y],R):
h:=poly(3*Y+1,[X,Y],R):
g*h;
2
poly(2 X + 3 Y + Y, [X, Y], Dom::IntegerMod(6))
expr(g*h); // poly をはずす。
2
3 Y + Y + 2 X
要するに expr は「素朴なかたちになおす」ものです。 poly 以外にもいろいろ使えますのでやってみてください。