diff options
author | dos-reis <gdr@axiomatics.org> | 2011-03-13 03:43:50 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2011-03-13 03:43:50 +0000 |
commit | 11eebf207528f86dfa4556be3b2cc7cba57244a6 (patch) | |
tree | 17c1ed9132ec874b14d2dcd137ac16a91e7a5b27 /src/algebra | |
parent | 6c75a87d8ee00d48a0f5703aa9c86591078a50d3 (diff) | |
download | open-axiom-11eebf207528f86dfa4556be3b2cc7cba57244a6.tar.gz |
* src/algebra/: Systematically use not zero? when comparing for
equality with 0.
Diffstat (limited to 'src/algebra')
31 files changed, 59 insertions, 59 deletions
diff --git a/src/algebra/allfact.spad.pamphlet b/src/algebra/allfact.spad.pamphlet index c45d662c..7d412271 100644 --- a/src/algebra/allfact.spad.pamphlet +++ b/src/algebra/allfact.spad.pamphlet @@ -171,7 +171,7 @@ MPolyCatRationalFunctionFactorizer(E,OV,R,PRF) : C == T ground? g => g rf:PRF:=0$PRF ug:=univariate(g,x) - while ug~=0 repeat + while not zero? ug repeat rf:=rf+pushdterm(ug,x) ug := reductum ug rf diff --git a/src/algebra/clifford.spad.pamphlet b/src/algebra/clifford.spad.pamphlet index 262afa86..8e85a25d 100644 --- a/src/algebra/clifford.spad.pamphlet +++ b/src/algebra/clifford.spad.pamphlet @@ -389,7 +389,7 @@ CliffordAlgebra(n, K, Q): T == Impl where c = 1 => be c::Ex * be coerce(x): Ex == - tl := [coerceMonom(x.i,i) for i in 0..dim-1 | x.i~=0] + tl := [coerceMonom(x.i,i) for i in 0..dim-1 | not zero? x.i] null tl => "0"::Ex reduce("+", tl) diff --git a/src/algebra/eigen.spad.pamphlet b/src/algebra/eigen.spad.pamphlet index 9cab7430..db92f178 100644 --- a/src/algebra/eigen.spad.pamphlet +++ b/src/algebra/eigen.spad.pamphlet @@ -137,7 +137,7 @@ EigenPackage(R) : C == T tff(p:SUF,x:SE) : F == degree p=0 => leadingCoefficient p r:F:=0$F - while p~=0 repeat + while not zero? p repeat r:=r+fft(p,x) p := reductum p r diff --git a/src/algebra/ffnb.spad.pamphlet b/src/algebra/ffnb.spad.pamphlet index 007f1efd..95b5c316 100644 --- a/src/algebra/ffnb.spad.pamphlet +++ b/src/algebra/ffnb.spad.pamphlet @@ -236,7 +236,7 @@ InnerNormalBasisFieldFunctions(GF): Exports == Implementation where else erg:VGF:=plist.(first(l)) i:SI:=k for j in rest(l) repeat - if j~=0 then erg:=erg *$$ qPot(plist.j,i)$$ + if not zero? j then erg:=erg *$$ qPot(plist.j,i)$$ i:=i+k erg diff --git a/src/algebra/fspace.spad.pamphlet b/src/algebra/fspace.spad.pamphlet index 30c6fccd..684448f0 100644 --- a/src/algebra/fspace.spad.pamphlet +++ b/src/algebra/fspace.spad.pamphlet @@ -691,14 +691,14 @@ FunctionSpace(R: SetCategory): Category == Definition where u := third l arg := argument k ans:% := 0 - if (not member?(u,done)) and (ans := differentiate(u,x))~=0 then + if (not member?(u,done)) and not zero?(ans := differentiate(u,x)) then ans := ans * kernel(opdiff, [subst(expr, [kd], [kernel(opdiff, [first l, gg, gg])]), gg, u]) done := concat(gg, done) is?(k, opdiff) => ans + diffdiff0(arg, x, expr, k, done) for i in minIndex arg .. maxIndex arg for b in arg repeat - if (not member?(b,done)) and (bp:=differentiate(b,x))~=0 then + if (not member?(b,done)) and not zero?(bp:=differentiate(b,x)) then g := symsub(gendiff, i)::% ans := ans + bp * kernel(opdiff, [subst(expr, [kd], [kernel(opdiff, [substArg(op, arg, i, g), gg, u])]), g, b]) diff --git a/src/algebra/gaussfac.spad.pamphlet b/src/algebra/gaussfac.spad.pamphlet index bb4cb963..79d32551 100644 --- a/src/algebra/gaussfac.spad.pamphlet +++ b/src/algebra/gaussfac.spad.pamphlet @@ -180,7 +180,7 @@ GaussianFactorizationPackage() : C == T prime?(n)$IntegerPrimesPackage(Z) => true re : Z := real a im : Z := imag a - re~=0 and im~=0 => false + not zero? re and not zero? im => false p : Z := abs(re+im) -- a is of the form p, -p, %i*p or -%i*p p rem 4 ~= 3 => false -- return-value true, if p is a rational prime, diff --git a/src/algebra/gaussian.spad.pamphlet b/src/algebra/gaussian.spad.pamphlet index d8ac1583..44e9b918 100644 --- a/src/algebra/gaussian.spad.pamphlet +++ b/src/algebra/gaussian.spad.pamphlet @@ -327,12 +327,12 @@ ComplexCategory(R:CommutativeRing): Category == xx := x * y1 x1 := real(xx) rem r a := x1 - if x1~=0 and sizeLess?(r, 2 * x1) then + if not zero? x1 and sizeLess?(r, 2 * x1) then a := x1 - r if sizeLess?(x1, a) then a := x1 + r x2 := imag(xx) rem r b := x2 - if x2~=0 and sizeLess?(r, 2 * x2) then + if not zero? x2 and sizeLess?(r, 2 * x2) then b := x2 - r if sizeLess?(x2, b) then b := x2 + r y1 := (complex(a, b) exquo y1)::% diff --git a/src/algebra/gdpoly.spad.pamphlet b/src/algebra/gdpoly.spad.pamphlet index 2a212926..e477aa04 100644 --- a/src/algebra/gdpoly.spad.pamphlet +++ b/src/algebra/gdpoly.spad.pamphlet @@ -148,7 +148,7 @@ GeneralDistributedMultivariatePolynomial(vl,R,E): public == private where p := reductum p for i in 1..n repeat maxdeg.i := max(maxdeg.i, tdeg.i) - [index(i:PositiveInteger) for i in 1..n | maxdeg.i~=0] + [index(i:PositiveInteger) for i in 1..n | not zero? maxdeg.i] reorder(p: %,perm: List Integer):% == #perm ~= n => error "must be a complete permutation of all vars" diff --git a/src/algebra/geneez.spad.pamphlet b/src/algebra/geneez.spad.pamphlet index 3c449fe1..c3647b6c 100644 --- a/src/algebra/geneez.spad.pamphlet +++ b/src/algebra/geneez.spad.pamphlet @@ -96,7 +96,7 @@ GenExEuclid(R,BP) : C == T exactquo(u:BP,v:BP,p:R):Union(BP,"failed") == invlcv:=modInverse(leadingCoefficient v,p) r:=monicDivide(u,reduction(invlcv*v,p)) - reduction(r.remainder,p) ~=0 => "failed" + not zero? reduction(r.remainder,p) => "failed" reduction(invlcv*r.quotient,p) FP:=EuclideanModularRing(R,BP,R,reduction,merge,exactquo) @@ -120,7 +120,7 @@ GenExEuclid(R,BP) : C == T ftab:Vector L FP := map(reduceList(#1,lmod),table)$VectorFunctions2(List BP,List FP) sln:L FP:=[0$FP for xx in ftab.1 ] - for i in 0 .. d |(cc:=coefficient(err,i)) ~=0 repeat + for i in 0 .. d |not zero?(cc:=coefficient(err,i)) repeat sln:=[slp+reduce(cc::BP,lmod)*pp for pp in ftab.(i+1) for slp in sln] nsol:=[f-lmodk*reduction(g::BP,lmod) for f in oldsol for g in sln] @@ -165,7 +165,7 @@ GenExEuclid(R,BP) : C == T -- Actually, there's no possibility of failure d:=degree m sln:L BP:=[0$BP for xx in table.1] - for i in 0 .. d | coefficient(m,i)~=0 repeat + for i in 0 .. d | not zero? coefficient(m,i) repeat sln:=[slp+coefficient(m,i)*pp for pp in table.(i+1) for slp in sln] sln @@ -192,7 +192,7 @@ GenExEuclid(R,BP) : C == T map(reduceList(#1,pmod),table)$VectorFunctions2(List BP,List FP) lpolys:L BP:=table.(#table) sln:L FP:=[0$FP for xx in ftab.1] - for i in 0 .. d | coefficient(m,i)~=0 repeat + for i in 0 .. d | not zero? coefficient(m,i) repeat sln:=[slp+reduce(coefficient(m,i)::BP,pmod)*pp for pp in ftab.(i+1) for slp in sln] soln:=[slp::BP for slp in sln] diff --git a/src/algebra/ghensel.spad.pamphlet b/src/algebra/ghensel.spad.pamphlet index baf7e85c..64ff2a89 100644 --- a/src/algebra/ghensel.spad.pamphlet +++ b/src/algebra/ghensel.spad.pamphlet @@ -63,7 +63,7 @@ GeneralHenselPackage(RP,TP):C == T where exactquo(u:TP,v:TP,p:RP):Union(TP,"failed") == invlcv:=modInverse(leadingCoefficient v,p) r:=monicDivide(u,reduction(invlcv*v,p)) - reduction(r.remainder,p) ~=0 => "failed" + not zero? reduction(r.remainder,p) => "failed" reduction(invlcv*r.quotient,p) FP:=EuclideanModularRing(RP,TP,RP,reduction,merge,exactquo) @@ -112,7 +112,7 @@ GeneralHenselPackage(RP,TP):C == T where fln = nfln and zero?(err:=poly-*/fln) => leave "finished" fln := nfln Modulus := prime*Modulus - if constp~=0 then fln:=cons(constp,fln) + if not zero? constp then fln:=cons(constp,fln) [fln,Modulus] completeHensel(m:TP,tl1:List TP,prime:RP,bound:PI) == diff --git a/src/algebra/groebsol.spad.pamphlet b/src/algebra/groebsol.spad.pamphlet index 2fb8161e..95af1daf 100644 --- a/src/algebra/groebsol.spad.pamphlet +++ b/src/algebra/groebsol.spad.pamphlet @@ -97,7 +97,7 @@ GroebnerSolve(lv,F,R) : C == T then return "failed" newlpol :=concat(redPol(g::DPoly,newlpol),newlpol) rlvar:=rest rlvar - else if redPol(f,newlpol)~=0 then return"failed" + else if not zero? redPol(f,newlpol) then return"failed" newlpol diff --git a/src/algebra/ideal.spad.pamphlet b/src/algebra/ideal.spad.pamphlet index 311be81b..936b9d0c 100644 --- a/src/algebra/ideal.spad.pamphlet +++ b/src/algebra/ideal.spad.pamphlet @@ -174,7 +174,7 @@ PolynomialIdeals(F,Expon,VarSet,DPoly) : C == T q=0$newPoly => 0$DPoly dq:newExpon:=degree q n:NNI:=selectfirst (dq) - n~=0 => "failed" + not zero? n => "failed" ((g:=oldpoly reductum q) case "failed") => "failed" monomial(leadingCoefficient q,selectsecond dq)$DPoly + (g::DPoly) @@ -379,7 +379,7 @@ PolynomialIdeals(F,Expon,VarSet,DPoly) : C == T vec2.i:=1 g:nPoly:=0$nPoly pol:=0$P - while f~=0 repeat + while not zero? f repeat df:=degree(f-reductum f,lvint) lcf:=leadingCoefficient f pol:=pol+monompol(df,lcf,lvint) @@ -400,7 +400,7 @@ PolynomialIdeals(F,Expon,VarSet,DPoly) : C == T solsn:List P:=[] for q in lf repeat g:Polynomial F :=0 - while q~=0 repeat + while not zero? q repeat dq:=degree q lcq:=leadingCoefficient q q:=reductum q @@ -417,7 +417,7 @@ PolynomialIdeals(F,Expon,VarSet,DPoly) : C == T empty? Idl => [0$DPoly] :: OutputForm Idl :: OutputForm - ideal(Id:List DPoly) :Ideal == [[f for f in Id|f~=0],false] + ideal(Id:List DPoly) :Ideal == [[f for f in Id|not zero? f],false] groebnerIdeal(Id:List DPoly) : Ideal == [Id,true] diff --git a/src/algebra/idecomp.spad.pamphlet b/src/algebra/idecomp.spad.pamphlet index 8dd14b10..d5c5d4e4 100644 --- a/src/algebra/idecomp.spad.pamphlet +++ b/src/algebra/idecomp.spad.pamphlet @@ -153,7 +153,7 @@ IdealDecompositionPackage(vl,nv) : C == T -- take away nv, now doesn't lf:=Id.first ris:= generators(zeroRadComp(groebnerIdeal(Id.rest),truelist.rest)) ris:=cons(lf,ris) - if pv~=0 then + if not zero? pv then ris:=[(univariate(h,x)).pw for h in ris] groebnerIdeal(groebner ris) @@ -246,7 +246,7 @@ IdealDecompositionPackage(vl,nv) : C == T -- take away nv, now doesn't pushdown(g:DPoly,x:OV) : DPoly == rf:DPoly:=0$DPoly i:=position(x,lvint) - while g~=0 repeat + while not zero? g repeat g1:=reductum g rf:=rf+pushdterm(g-g1,x,i) g := g1 @@ -266,11 +266,11 @@ IdealDecompositionPackage(vl,nv) : C == T -- take away nv, now doesn't rf:DPoly:=0$DPoly g := f xp := convert(x)@SE - while g~=0 repeat + while not zero? g repeat h:=lcm(trueden(denom leadingCoefficient g,xp),h) g:=reductum g f:=(h::F)*f - while f~=0 repeat + while not zero? f repeat g:=reductum f rf:=rf+pushuterm(f-g,xp,x) f:=g diff --git a/src/algebra/leadcdet.spad.pamphlet b/src/algebra/leadcdet.spad.pamphlet index 0c312914..7b7fb5a5 100644 --- a/src/algebra/leadcdet.spad.pamphlet +++ b/src/algebra/leadcdet.spad.pamphlet @@ -109,7 +109,7 @@ LeadingCoefDetermination(OV,E,Z,P) : C == T for k in 1..(# lpol) repeat lexp.k=0 => "next factor" h:= checkpow(vl.k,c) - if h ~=0 then + if not zero? h then if h>lexp.k then return "failed" lexp.k:=lexp.k-h aux.i := aux.i*(lpol.k ** h) diff --git a/src/algebra/lingrob.spad.pamphlet b/src/algebra/lingrob.spad.pamphlet index 41956dea..95284786 100644 --- a/src/algebra/lingrob.spad.pamphlet +++ b/src/algebra/lingrob.spad.pamphlet @@ -215,7 +215,7 @@ LinGroebnerPackage(lv,F) : C == T part:List HDPoly :=[] for f in lr repeat g:=x::HDPoly * f - if redPo(g,mB).poly~=0 then part:=concat(g,part) + if not zero?(redPo(g,mB).poly) then part:=concat(g,part) concat(part,intcompBasis(x,part,mB)) ----- coordinate of f with respect to the basis B ----- @@ -223,7 +223,7 @@ LinGroebnerPackage(lv,F) : C == T coord(f:HDPoly,B:List HDPoly) : VF == ndim := #B vv:VF:=new(ndim,0$F)$VF - while f~=0 repeat + while not zero? f repeat rf := reductum f lf := f-rf lcf := leadingCoefficient f diff --git a/src/algebra/listgcd.spad.pamphlet b/src/algebra/listgcd.spad.pamphlet index fac17b6d..856e006b 100644 --- a/src/algebra/listgcd.spad.pamphlet +++ b/src/algebra/listgcd.spad.pamphlet @@ -78,7 +78,7 @@ HeuGcd (BP):C == T --compute the height of a polynomial height(f:BP):PI == k:PI:=1 - while f~=0 repeat + while not zero? f repeat k:=max(k,abs(leadingCoefficient(f)@Z)::PI) f:=reductum f k @@ -88,7 +88,7 @@ HeuGcd (BP):C == T genpoly(dval:Z,value:PI):BP == d:=0$BP val:=dval - for i in 0.. while (val~=0) repeat + for i in 0.. while not zero? val repeat val1:=negShiftz(val rem value,value) d:= d+monomial(val1,i) val:=(val-val1) quo value diff --git a/src/algebra/mfinfact.spad.pamphlet b/src/algebra/mfinfact.spad.pamphlet index 73483b86..bca79804 100644 --- a/src/algebra/mfinfact.spad.pamphlet +++ b/src/algebra/mfinfact.spad.pamphlet @@ -301,7 +301,7 @@ MultFiniteFactorize(OV,E,F,PG) : C == T pushup(f:P,x:OV) :PG == ground? f => pushupconst((retract f)@R,x) rr:PG:=0 - while f~=0 repeat + while not zero? f repeat lf:=leadingMonomial f cf:=pushupconst(leadingCoefficient f,x) lvf:=variables lf @@ -314,7 +314,7 @@ MultFiniteFactorize(OV,E,F,PG) : C == T ground? g => ((retract g)@F)::R::P rf:P:=0$P ug:=univariate(g,x) - while ug~=0 repeat + while not zero? ug repeat cf:=monomial(1,degree ug)$R rf:=rf+cf*pushdcoef(leadingCoefficient ug) ug := reductum ug @@ -324,7 +324,7 @@ MultFiniteFactorize(OV,E,F,PG) : C == T pushupconst(r:R,x:OV):PG == ground? r => (retract r)@F ::PG rr:PG:=0 - while r~=0 repeat + while not zero? r repeat rr:=rr+monomial((leadingCoefficient r)::PG,x,degree r)$PG r:=reductum r rr @@ -385,14 +385,14 @@ MultFiniteFactorize(OV,E,F,PG) : C == T leadcomp1:=[retract eval(pol,lvar,lval) for pol in plist] testp and or/[unit? epl for epl in leadcomp1] => range:=range+1 newm:SUP R:=completeEval(um,lvar,lval) - degum ~= degree newm or minimumDegree newm ~=0 => range:=range+1 + degum ~= degree newm or not zero? minimumDegree newm => range:=range+1 lffc1:=content newm newm:=(newm exquo lffc1)::SUP R testp and leadtest and not polCase(lffc1*clc,#plist,leadcomp1) => range:=range+1 Dnewm := differentiate newm D2newm := map(differentiate, newm) - degree(gcd [newm,Dnewm,D2newm])~=0 => range:=range+1 + not zero? degree(gcd [newm,Dnewm,D2newm]) => range:=range+1 -- if R has Integer then luniv:=henselFact(newm,false)$ -- else lcnm:F:=1 diff --git a/src/algebra/moddfact.spad.pamphlet b/src/algebra/moddfact.spad.pamphlet index 5cb2893d..9cf3d902 100644 --- a/src/algebra/moddfact.spad.pamphlet +++ b/src/algebra/moddfact.spad.pamphlet @@ -79,7 +79,7 @@ ModularDistinctDegreeFactorizer(U):C == T where exactquo(u:U,v:U,p:I):Union(U,"failed") == invlcv:=modInverse(leadingCoefficient v,p) r:=monicDivide(u,reduction(invlcv*v,p)) - reduction(r.remainder,p) ~=0 => "failed" + not zero? reduction(r.remainder,p) => "failed" reduction(invlcv*r.quotient,p) EMR := EuclideanModularRing(Integer,U,Integer, reduction,merge,exactquo) diff --git a/src/algebra/modgcd.spad.pamphlet b/src/algebra/modgcd.spad.pamphlet index b094a863..afe60ab5 100644 --- a/src/algebra/modgcd.spad.pamphlet +++ b/src/algebra/modgcd.spad.pamphlet @@ -205,7 +205,7 @@ InnerModularGcd(R,BP,pMod,nextMod):C == T exactquo(u:BP,v:BP,p:R):Union(BP,"failed") == invlcv:=modInverse(leadingCoefficient v,p) r:=monicDivide(u,reduction(invlcv*v,p)) - reduction(r.remainder,p) ~=0 => "failed" + not zero? reduction(r.remainder,p) => "failed" reduction(invlcv*r.quotient,p) diff --git a/src/algebra/modmon.spad.pamphlet b/src/algebra/modmon.spad.pamphlet index cb60793e..94872e38 100644 --- a/src/algebra/modmon.spad.pamphlet +++ b/src/algebra/modmon.spad.pamphlet @@ -139,7 +139,7 @@ ModMonic(R,Rep): C == T frobenius(a:%):% == aq:% := 0 - while a~=0 repeat + while not zero? a repeat aq:= aq + leadingCoefficient(a)*frobeniusPower(degree a) a := reductum a aq diff --git a/src/algebra/multfact.spad.pamphlet b/src/algebra/multfact.spad.pamphlet index de704ea2..86293e50 100644 --- a/src/algebra/multfact.spad.pamphlet +++ b/src/algebra/multfact.spad.pamphlet @@ -182,7 +182,7 @@ InnerMultFact(OV,E,R,P) : C == T "max"/[numberOfMonomials ff for ff in lum] "max"/[+/[euclideanSize cc for i in 0..degree ff| - (cc:= coefficient(ff,i))~=0] for ff in lum] + not zero? (cc:= coefficient(ff,i))] for ff in lum] --- Choose the integer to reduce to univariate case --- intChoose(um:USP,lvar:L OV,clc:R,plist:L P,ltry:L L R, @@ -220,12 +220,12 @@ InnerMultFact(OV,E,R,P) : C == T leadcomp1:=[retract eval(pol,lvar,lval) for pol in plist] testp and or/[unit? epl for epl in leadcomp1] => range:=2*range newm:BP:=completeEval(um,lvar,lval) - degum ~= degree newm or minimumDegree newm ~=0 => range:=2*range + degum ~= degree newm or not zero? minimumDegree newm => range:=2*range lffc1:=content newm newm:=(newm exquo lffc1)::BP testp and leadtest and not polCase(lffc1*clc,#plist,leadcomp1) => range:=2*range - degree(gcd [newm,differentiate(newm)])~=0 => range:=2*range + not zero? degree(gcd [newm,differentiate(newm)]) => range:=2*range luniv:=ufactor(newm) lunivf:= factors luniv lffc1:R:=retract(unit luniv)@R * lffc1 diff --git a/src/algebra/multsqfr.spad.pamphlet b/src/algebra/multsqfr.spad.pamphlet index 6c54e72c..f1cd64f4 100644 --- a/src/algebra/multsqfr.spad.pamphlet +++ b/src/algebra/multsqfr.spad.pamphlet @@ -206,7 +206,7 @@ MultivariateSquareFree (E,OV,R,P) : C == T where makeFR(unit result,append(result1,factorList result)) ldeg:=degree(f,lvar) --- general case --- - m:="min"/[j for j in ldeg|j~=0] + m:="min"/[j for j in ldeg| not zero? j] i:Z:=1 for j in ldeg while j>m repeat i:=i+1 x:=lvar.i diff --git a/src/algebra/npcoef.spad.pamphlet b/src/algebra/npcoef.spad.pamphlet index 47710d88..a1ada373 100644 --- a/src/algebra/npcoef.spad.pamphlet +++ b/src/algebra/npcoef.spad.pamphlet @@ -104,7 +104,7 @@ NPCoef(BP,E,OV,R,P) : C == T where #termlist=1 => vterm:=termlist.first for elterm in vterm while doit<2 repeat - (cu1:=elterm.pcoef)~=0 => cfu:=cu1*cfu + not zero?(cu1:=elterm.pcoef) => cfu:=cu1*cfu doit:=doit+1 poselt:=position(elterm,vterm):NNI doit=2 or (pp:=tterm.coefu exquo cfu) case "failed" => "failed" @@ -148,7 +148,7 @@ NPCoef(BP,E,OV,R,P) : C == T where for celt in ctdet repeat if celt.cfpos.expt=cfexp then celt.cfpos.pcoef:=cfcoef - if (and/[cc.pcoef ~=0 for cc in celt]) then + if (and/[not zero? cc.pcoef for cc in celt]) then k:=position(celt,ctdet):NNI lterase:=cons(k,lterase) cterm.coefu:=(cterm.coefu - */[cc.pcoef for cc in celt]) diff --git a/src/algebra/numsolve.spad.pamphlet b/src/algebra/numsolve.spad.pamphlet index 04935b6b..1c7a516c 100644 --- a/src/algebra/numsolve.spad.pamphlet +++ b/src/algebra/numsolve.spad.pamphlet @@ -169,7 +169,7 @@ InnerNumericFloatSolvePackage(K,F,Par): Cat == Cap where if lq~=[] then gb:=GroebnerInternalPackage(K,DirectProduct(#lv,NNI),OV,dmp) partRes:=[pr for pr in partRes| - and/[(redPol(fq,pr pretend List(dmp))$gb) ~=0 + and/[not zero?(redPol(fq,pr pretend List(dmp))$gb) for fq in lq]] -- select the components in "generic" form diff --git a/src/algebra/pgcd.spad.pamphlet b/src/algebra/pgcd.spad.pamphlet index 2caf53de..eb38b2c1 100644 --- a/src/algebra/pgcd.spad.pamphlet +++ b/src/algebra/pgcd.spad.pamphlet @@ -183,7 +183,7 @@ PolynomialGcdPackage(E,OV,R,P):C == T where (gd1,gd2):=(l,l) ul:=completeEval(l,lvar1,lval) dl:=degree ul - if degree gcd(ul,differentiate ul) ~=0 then + if not zero? degree gcd(ul,differentiate ul) then newchoice:=good(l,lvar1,ltry) ul:=newchoice.upol ltry:=newchoice.inval @@ -195,7 +195,7 @@ PolynomialGcdPackage(E,OV,R,P):C == T where d:SUP:=gcd(cons(ul,ulist)) if degree d =0 then return gd1 lquo:=(ul exquo d)::SUP - if degree lquo ~=0 then + if not zero? degree lquo then lgcd:=gcd(cons(leadingCoefficient l,lcpol)) (gdl:=lift(l,d,lquo,lgcd,lvar1,ldeg,lval)) case "failed" => return notCoprime(g,p2,ldeg,lvar1,ltry) diff --git a/src/algebra/poly.spad.pamphlet b/src/algebra/poly.spad.pamphlet index 71a7d8df..b86755a0 100644 --- a/src/algebra/poly.spad.pamphlet +++ b/src/algebra/poly.spad.pamphlet @@ -902,7 +902,7 @@ UnivariatePolynomialSquareFree(RC:IntegralDomain,P):C == T makeFR(u,[["sqfr",c,1]]) i:NonNegativeInteger:=0; lffe:List FF:=[] lcp := leadingCoefficient p - while degree(ci)~=0 repeat + while not zero? degree(ci) repeat ci:=(ci exquo pi)::P di:=(di exquo pi)::P - differentiate(ci) pi:=gcd(ci,di) @@ -924,7 +924,7 @@ UnivariatePolynomialSquareFree(RC:IntegralDomain,P):C == T di := (p exquo ci)::P i:NonNegativeInteger:=0; lffe:List FF:=[] dunit : P := 1 - while degree(di)~=0 repeat + while not zero? degree(di) repeat diprev := di di := gcd(ci,di) ci:=(ci exquo di)::P @@ -1054,7 +1054,7 @@ PolynomialSquareFree(VarSet:OrderedSet,E,RC:GcdDomain,P):C == T where squareFree(p:P) == mv:=mainVariable p mv case "failed" => makeFR(p,[])$Factored(P) - characteristic$RC ~=0 => finSqFr(p,variables p) + not zero?(characteristic$RC) => finSqFr(p,variables p) up:=univariate(p,mv) cont := content up up := (up exquo cont)::SUP diff --git a/src/algebra/qalgset.spad.pamphlet b/src/algebra/qalgset.spad.pamphlet index f93f1ef0..4679a5c5 100644 --- a/src/algebra/qalgset.spad.pamphlet +++ b/src/algebra/qalgset.spad.pamphlet @@ -151,7 +151,7 @@ QuasiAlgebraicSet(R, Var,Expon,Dpoly) : C == T q=0$newPoly => 0$Dpoly dq:newExpon:=degree q n:NNI:=selectfirst (dq) - n~=0 => "failed" + not zero? n => "failed" ((g:=oldpoly reductum q) case "failed") => "failed" monomial(leadingCoefficient q,selectsecond dq)$Dpoly + (g::Dpoly) diff --git a/src/algebra/smith.spad.pamphlet b/src/algebra/smith.spad.pamphlet index 97fc3b76..34b8f55b 100644 --- a/src/algebra/smith.spad.pamphlet +++ b/src/algebra/smith.spad.pamphlet @@ -157,7 +157,7 @@ SmithNormalForm(R,Row,Col,M) : Exports == Implementation where lastStep(sf : SmithForm) : SmithForm == m:=sf.Smith m1:=min(nrows m,ncols m) - for i in 1..m1 while (mii:=m(i,i)) ~=0 repeat + for i in 1..m1 while not zero?(mii:=m(i,i)) repeat for j in i+1..m1 repeat if (m(j,j) exquo mii) case "failed" then return lastStep(ijDivide(sf,i,j)) diff --git a/src/algebra/syssolp.spad.pamphlet b/src/algebra/syssolp.spad.pamphlet index 8fd97610..3fb9ba0a 100644 --- a/src/algebra/syssolp.spad.pamphlet +++ b/src/algebra/syssolp.spad.pamphlet @@ -153,7 +153,7 @@ SystemSolvePackage(R): Cat == Cap where if lq~=[] then gb:=GroebnerInternalPackage(P R,DirectProduct(#lv,NNI),OV,dmp) parRes:=[pr for pr in parRes| - and/[(redPol(fq,pr pretend List(dmp))$gb) ~=0 + and/[not zero?(redPol(fq,pr pretend List(dmp))$gb) for fq in lq]] [[retract pushdown(pf,lvv)$push for pf in pr] for pr in parRes] diff --git a/src/algebra/twofact.spad.pamphlet b/src/algebra/twofact.spad.pamphlet index fb560b20..fd51789d 100644 --- a/src/algebra/twofact.spad.pamphlet +++ b/src/algebra/twofact.spad.pamphlet @@ -43,7 +43,7 @@ NormRetractPackage(F, ExtF, SUEx, ExtP, n):C == T where Frobenius(ff:ExtP):ExtP == fft:ExtP:=0 - while ff~=0 repeat + while not zero? ff repeat fft:=fft + monomial(map(Frobenius, leadingCoefficient ff), degree ff) ff:=reductum ff @@ -230,7 +230,7 @@ TwoFactorize(F) : C == T i:=i+1 zero? elt(lcm, vval) => "next value" umv := map(elt(#1,vval), m)$UPCF2(R, P, F, R) - degree(gcd(umv,differentiate umv))~=0 => "next val" + not zero? degree(gcd(umv,differentiate umv)) => "next val" n := 1 look := false extField:=FiniteFieldExtension(F,n) @@ -238,7 +238,7 @@ TwoFactorize(F) : C == T TP:=SparseUnivariatePolynomial SUEx mm:TP:=0 m1:=m - while m1~=0 repeat + while not zero? m1 repeat mm:=mm+monomial(map(coerce,leadingCoefficient m1)$UPCF2(F,R, extField,SUEx),degree m1) m1:=reductum m1 @@ -253,7 +253,7 @@ TwoFactorize(F) : C == T i:=i+1 elt(lcmm,val)=0 => "next value" umex := map(elt(#1,val), mm)$UPCF2(SUEx, TP, extField, SUEx) - degree(gcd(umex,differentiate umex))~=0 => "next val" + not zero? degree(gcd(umex,differentiate umex)) => "next val" look:=false prime:SUEx:=monomial(1,1)-monomial(val,0) fumex:=factor(umex)$DistinctDegreeFactorize(extField,SUEx) diff --git a/src/algebra/unifact.spad.pamphlet b/src/algebra/unifact.spad.pamphlet index f3437a81..119ee5d4 100644 --- a/src/algebra/unifact.spad.pamphlet +++ b/src/algebra/unifact.spad.pamphlet @@ -173,7 +173,7 @@ UnivariateFactorize(ZP) : public == private where q:=nextPrime(q)$IntegerPrimesPackage(Z) pretend PI (rr:=lcm rem q) = 0$Z => "next prime" disc:=gcd(m,differentiate m,q) - (degree disc)~=0 => "next prime" + not zero?(degree disc) => "next prime" k := k+1 newdd := ddFact(m,q) ((n := numFactors(newdd)) < 9) => @@ -215,7 +215,7 @@ UnivariateFactorize(ZP) : public == private where d,d2: Z d := coefficient(m,1)**2-4*coefficient(m,0)*coefficient(m,2) d2 := sqroot(d) - (d-d2**2)~=0 => [m] + not zero?(d-d2**2) => [m] alpha: Z := coefficient(m,1)+d2 beta: Z := 2*coefficient(m,2) d := gcd(alpha,beta) |