P<j,k,m,n,r,s,t,u,v,w,x,y,z>:=RationalFunctionField(Integers(),13);
trim:=function(t)
//remove any leading or trailing blanks
s:=t;
n:=#s; while s[1] eq" " do
s:=Substring(s,2,n-1);
n:=n-1; endwhile; while s[n] eq" " do
s:=Substring(s,1,n-1);
n:=n-1; endwhile;
return s; end function;
split:=function(s)
S:={"a","b","c","d","e","f","g","p","^", "0","1","2","3","4","5","6","7","8","9"};
T:={"0","1","2","3","4","5","6","7","8","9", "j","k","m","n","r","s","t", "u","v","w","x","y","z", "(",")","+","-","*","/","^"};
U:={"0","1","2","3","4","5","6","7","8","9"};
n:=#s;
s1:=""; if n eq0 then
return [s1,s1,s1,s1]; endif;
i:=0; while (i+1le n) and (s[i+1] in T) do
s1:=s1*s[i+1];
i:=i+1; endwhile;
s2:="0"; if (i+1le n) and (s[i+1] eq"p") then
s2:="1";
i:=i+1; if s[i+1] eq"^" then
i:=i+1;
s2:=""; while (i+1le n) and (s[i+1] in U) do
s2:=s2*s[i+1];
i:=i+1; endwhile; endif; endif;
s3:=""; while (i+1le n) and (s[i+1] in S) do
s3:=s3*s[i+1];
i:=i+1; endwhile;
s4:=""; if i+1le n then
s4:=Substring(s,i+1,n-i); endif;
return [s1,s2,s3,s4]; end function;
match:=function(s,i)
n:=#s; if (i le0) or (i ge n) or (s[i] ne"(") then
return 0; endif;
count:=1; for j in [i+1..n] do if s[j] eq"(" then
count:=count+1; endif; if s[j] eq")" then
count:=count-1; endif; if count eq0 then
return j; endif; endfor;
return 0; end function;
right:=function(s,t)
spot:=0;
n:=#s;
i:=0; while i lt n do
i:=i+1; if s[i] eq t then
spot:=i; endif; if s[i] eq"(" then
i:=match(s,i); if i eq0 then
return 0; endif; endif; endwhile;
return spot; end function;
getpol:=function(P,s)
if (s eq"") or (s eq"1") or (s eq"+") or (s eq"+1") then
return P!1; endif;
if (s eq"-") then
return P!(-1); endif;
n:=#s;
//strip initial + if s[1] eq"+" then
s:=Substring(s,2,n-1);
return $$(P,s); endif;
//strip trailing * if s[n] eq"*" then
s:=Substring(s,1,n-1);
return $$(P,s); endif;
//Check for s = (t) if s[1] eq"("and match(s,1) eq n then
s:=Substring(s,2,n-2);
return $$(P,s); endif;
//look for +
spot:=right(s,"+"); if spot gt 0 then
s1:=Substring(s,1,spot-1);
s2:=Substring(s,spot+1,n-spot);
return $$(P,s1)+$$(P,s2); endif;
//look for -
spot:=right(s,"-"); if spot eq1 then
s1:=Substring(s,2,n-1);
return -$$(P,s1); endif; if spot gt 1 then s1:=Substring(s,1,spot-1);
s2:=Substring(s,spot+1,n-spot);
return $$(P,s1)-$$(P,s2); endif;
//look for /
spot:=right(s,"/");
//can only divide by an integer if spot gt 0 then
s1:=Substring(s,1,spot-1);
s2:=Substring(s,spot+1,n-spot);
a:=StringToInteger(s2);
a:=P!a;
a:=a^-1;
return a*$$(P,s1); endif;
//look for *
spot:=right(s,"*"); if spot gt 0 then
s1:=Substring(s,1,spot-1);
s2:=Substring(s,spot+1,n-spot);
return $$(P,s1)*$$(P,s2); endif;
//look for ^
spot:=right(s,"^");
//can only raise by an integer exponent if spot gt 0 then
s1:=Substring(s,1,spot-1);
s2:=Substring(s,spot+1,n-spot);
a:=StringToInteger(s2);
return $$(P,s1)^a; endif;
//s should be an integer or one of w,x,y,z,t!!! if s eq"j" then
return P.1; endif; if s eq"k" then
return P.2; endif; if s eq"m" then
return P.3; endif; if s eq"n" then
return P.4; endif; if s eq"r" then
return P.5; endif; if s eq"s" then
return P.6; endif; if s eq"t" then
return P.7; endif; if s eq"u" then
return P.8; endif; if s eq"v" then
return P.9; endif; if s eq"w" then
return P.10; endif; if s eq"x" then
return P.11; endif; if s eq"y" then
return P.12; endif; if s eq"z" then
return P.13; endif;
return StringToInteger(s);
end function;
strtogen:=function(defns,clend,ndgen,cc,s) if s eq""or #s gt cc then
return 0; endif; if #s eq1 then
i:=StringToCode(s)-96; if i gt 0and i le ndgen then
return i; else;
return 0; endif; endif;
i:=StringToCode(s[1])-96; if i le0or i gt ndgen then
return 0; endif; for j in [2..#s] do
k:=StringToCode(s[j])-96; if k le0or k gt ndgen then
return 0; endif;
m:=0; for n in [clend[j-1]+1..clend[j]] do if defns[n] eq [i,k] then
m:=n;
break; endif; endfor; if m eq0 then
return 0; endif;
i:=m; endfor;
return i; end function;
gentostr:=function(defns,ndgen,lastg,i)
s:=""; if i le0or i gt lastg then
return s; endif;
//See if i is defined as a power
exp:=0; while i gt ndgen and defns[i,1] eq0 do
i:=defns[i,2];
exp:=exp+1; endwhile;
while i gt ndgen do
s:=CodeToString(defns[i,2]+96)*s;
i:=defns[i,1]; endwhile;
s:=CodeToString(i+96)*s;
if exp eq0 then
return s; endif; if exp eq1 then
return "p"*s; endif; if exp gt 1 then
return "p^"*IntegerToString(exp)*s; endif;
end function;
poltostr:=function(P,a);
s:=""; if TotalDegree(a) gt 5or a eq0 then
return s; endif;
b:=Coefficients(a);
c:=Monomials(a);
n:=#c;
brack:=0; for i in [1..n] do
d:=b[i];
e:=c[i];
deg:=TotalDegree(e); if d gt 0and i gt 1 then
s:=s*"+"; endif; if d eq1or d eq -1 then if e eq1 then
s:=s*IntegerToString(Numerator(d)); else; if d eq -1 then
s:=s*"-"; endif; endif; else; if e ne1 then
brack:=1; endif;
s:=s*IntegerToString(Numerator(d)); if Denominator(d) gt 1 then
brack:=1;
s:=s*"/"*IntegerToString(Denominator(d)); endif; if e ne1 then
s:=s*"*"; endif; endif;
j:=Degree(e,w); if j eq1 then
s:=s*"w"; endif; if j gt 1 then
s:=s*"w"*"^"*(IntegerToString(j)); endif;
deg:=deg-j; if deg gt 0and j gt 0 then
brack:=1;
s:=s*"*"; endif;
j:=Degree(e,x); if j eq1 then
s:=s*"x"; endif; if j gt 1 then
s:=s*"x"*"^"*(IntegerToString(j)); endif;
deg:=deg-j; if deg gt 0and j gt 0 then
brack:=1;
s:=s*"*"; endif;
j:=Degree(e,y); if j eq1 then
s:=s*"y"; endif; if j gt 1 then
s:=s*"y"*"^"*(IntegerToString(j)); endif;
deg:=deg-j; if deg gt 0and j gt 0 then
brack:=1;
s:=s*"*"; endif;
j:=Degree(e,z); if j eq1 then
s:=s*"z"; endif; if j gt 1 then
s:=s*"z"*"^"*(IntegerToString(j)); endif;
deg:=deg-j; if deg gt 0and j gt 0 then
brack:=1;
s:=s*"*"; endif;
j:=Degree(e,t); if j eq1 then
s:=s*"t"; endif; if j gt 1 then
s:=s*"t"*"^"*(IntegerToString(j)); endif;
deg:=deg-j; if deg gt 0 then
print "Arghhhh!!!!!"; endif;
endfor; if n gt 1or brack eq1 then
s:="("*s*")"; endif;
return s; end function;
lietogrp:=function(s);
a:=split(s);
s:=a[3];
n:=#s; if n eq1 then
t:=s; else;
t:="("; for i in [1..n-1] do
t:=t*s[i]*","; endfor;
t:=t*s[n]*")"; endif;
u:=""; if a[2] eq"1" then
u:="p"; endif; if a[2] ne"0"and a[2] ne"1" then
u:="p^"*a[2]; endif;
return [t,u]; end function;
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.5 Sekunden
(vorverarbeitet am 2026-07-01)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.