	FFT			-- needed array of longs
	
	-- factorization of an integer polynomial
	-- in the multiprecision case
factor:ZZ.c|vdZZXl.factors|r,ZZX.f
		-- squarefree decomposition of an integer polynomial
SquareFreeDecomp:vdZZXl.x|r,ZZX.f
		-- integer abs function
abs:ZZ.x|r,ZZ.a
abs:RR.x|r,RR.a

		-- square and modulo b
SqrMod:ZZ.res|r,ZZ.a|r,ZZ.b
SqrMod:ZZX.res|r,ZZX.a|r,ZZX.b
SqrMod:ZZ_pX.res|r,ZZ_pX.a|r,ZZ_pX.b
SqrMod:ZZ_pEX.res|r,ZZ_pEX.a|r,ZZ_pEX.b
SqrMod:GF2X.res|r,GF2X.a|r,GF2X.b
SqrMod:GF2EX.res|r,GF2EX.a|r,GF2EX.b
	
			-- operations modulo c
AddMod:ZZ.res|r,ZZ.a|r,ZZ.b|r,ZZ.c
	 
SubMod:ZZ.res|r,ZZ.a|r,ZZ.b|r,ZZ.c
 
MulMod:ZZ.res|r,ZZ.a|r,ZZ.b|r,ZZ.c
MulMod:ZZX.res|r,ZZX.a|r,ZZX.b|r,ZZX.c
MulMod:ZZ_pX.res|r,ZZ_pX.a|r,ZZ_pX.b|r,ZZ_pX.c
MulMod:ZZ_pEX.res|r,ZZ_pEX.a|r,ZZ_pEX.b|r,ZZ_pEX.c
MulMod:GF2X.res|r,GF2X.a|r,GF2X.b|r,GF2X.c
MulMod:GF2EX.res|r,GF2EX.a|r,GF2EX.b|r,GF2EX.c
	 
DivRem:ZZ.q|ZZ.r|r,ZZ.a|r,ZZ.b
DivRem:ZZX.q|ZZX.r|r,ZZX.a|r,ZZX.b
DivRem:ZZ_pX.q|ZZ_pX.r|r,ZZ_pX.a|r,ZZ_pX.b
DivRem:ZZ_pEX.q|ZZ_pEX.r|r,ZZ_pEX.a|r,ZZ_pEX.b
DivRem:GF2X.q|GF2X.r|r,GF2X.a|r,GF2X.b
DivRem:GF2EX.q|GF2EX.r|r,GF2EX.a|r,GF2EX.b
 
rem:ZZ.r|r,ZZ.a|r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vRR.b
negate:vZZ.a|r,vZZ.b
negate:vGF2.a|r,vGF2.b
negate:ZZ.a|r,ZZ.b
negate:ZZX.a|r,ZZX.b
negate:ZZ_p.a|r,ZZ_p.b
negate:mZZ_p.a|r,mZZ_p.b
negate:ZZ_pX.a|r,ZZ_pX.b
negate:vZZ_p.a|r,vZZ_p.b
negate:GF2.a|r,GF2.b
negate:GF2X.a|r,GF2X.b
negate:GF2EX.a|r,GF2EX.b
negate:ZZ_pE.a|r,ZZ_pE.b
negate:ZZ_pEX.a|r,ZZ_pEX.b

determinant:RR.d|r,mRR.A
determinant:ZZ.d|r,mZZ.A
determinant:ZZ_p.d|r,mZZ_p.A

solve:RR.d|vRR.X|r,mRR.A|r,vRR.b
solve:ZZ.d|vZZ.X|r,mZZ.A|r,vZZ.b
solve:ZZ_p.d|vZZ_p.X|r,mZZ_p.A|r,vZZ_p.b
solve:ZZ_pE.d|vZZ_pE.X|r,mZZ_pE.A|r,vZZ_pE.b
solve:GF2.d|vGF2.X|r,mGF2.A|r,vGF2.b

inv:GF2.X|r,GF2.A
inv:GF2E.X|r,GF2E.A
inv:ZZ_p.X|r,ZZ_p.A
inv:RR.X|r,RR.A
inv:mRR.X|r,mRR.A
inv:mZZ.X|r,mZZ.A
inv:mZZ_p.X|r,mZZ_p.A
inv:mGF2.X|r,mGF2.A

power:GF2.res|r,GF2.a|r,Clong.e
power:GF2E.res|r,GF2E.a|r,Clong.e
power:GF2X.res|r,GF2X.a|r,Clong.e
power:GF2EX.res|r,GF2EX.a|r,Clong.e
power:ZZ.res|r,ZZ.a|r,Clong.e
power:ZZ_p.res|r,ZZ_p.a|r,Clong.e
power:ZZ_pE.res|r,ZZ_pE.a|r,Clong.e
power:ZZ_pEX.res|r,ZZ_pEX.a|r,Clong.e
power:ZZ_pX.res|r,ZZ_pX.a|r,Clong.e
power:mGF2.res|r,mGF2.a|r,Clong.e
power:mRR.res|r,mRR.a|r,Clong.e
power:mZZ.res|r,mZZ.a|r,Clong.e
power:m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

		-- some problem with different schema for return values
	ProbIrredTest	
	DetIrredTest

BuildIrred_mod2extint_poly:GF2EX.res|r,Clong.l
BuildIrred_mod2int_poly:GF2X.res|r,Clong.l
BuildIrred_modextint_poly:ZZ_pEX.res|r,Clong.l
BuildIrred_modint_poly:ZZ_pX.res|r,Clong.l

BuildRandomIrred:GF2EX.res|r,GF2EX.a
BuildRandomIrred:ZZ_pEX.res|r,ZZ_pEX.a
BuildRandomIrred:ZZ_pX.res|r,ZZ_pX.a

GenPrime:ZZ.res|r,Clong.k|r,Clong.err
NextPrime:ZZ.res|r,ZZ.m|r,Clong.NumTrials

BuildFromRoots:ZZ_pEX.res|r,vZZ_pE.a
BuildFromRoots:ZZ_pX.res|r,vZZ_p.a

eval:GF2E.res|r,GF2EX.f|r,GF2E.a
eval:GF2E.res|r,GF2X.f|r,GF2E.a
eval:ZZ_p.res|r,ZZ_pX.f|r,ZZ_p.a
eval:ZZ_pE.res|r,ZZ_pEX.f|r,ZZ_pE.a
eval2:ZZ_pE.res|r,ZZ_pX.f|r,ZZ_pE.a
eval3:vZZ_p.res|r,ZZ_pX.f|r,vZZ_p.a
eval4:vZZ_pE.res|r,ZZ_pEX.f|r,vZZ_pE.a

interpolate:ZZ_pEX.res|r,vZZ_pE.a|r,vZZ_pE.b
interpolate:ZZ_pX.res|r,vZZ_p.a|r,vZZ_p.b

ComputeDegree:ZZ.res|r,ZZ_pX.a|r,ZZ_pX.f
ProbComputeDegree:ZZ.res|r,ZZ_pX.a|r,ZZ_pX.f

TraceMap:ZZ_pX.res|r,ZZ_pX.a|r,Clong.d|r,ZZ_pX.f|r,ZZ_pX.b
TraceMap:ZZ_pEX.res|r,ZZ_pEX.a|r,Clong.d|r,ZZ_pEX.f|r,ZZ_pEX.b
TraceMap:GF2X.res|r,GF2X.a|r,Clong.d|r,GF2X.f|r,GF2X.b
TraceMap:GF2EX.res|r,GF2EX.a|r,Clong.d|r,GF2EX.f|r,GF2EX.b

