diff options
Diffstat (limited to 'src/algebra')
50 files changed, 108 insertions, 106 deletions
diff --git a/src/algebra/algfunc.spad.pamphlet b/src/algebra/algfunc.spad.pamphlet index bf4c4b71..5cb93af1 100644 --- a/src/algebra/algfunc.spad.pamphlet +++ b/src/algebra/algfunc.spad.pamphlet @@ -277,7 +277,7 @@ test and give $$1/(-2)^(1/n) \ne (-1/2)^(1/n)$$ <<hackroot(x, n)>>= hackroot(x, n) == (n = 1) or (x = 1) => x - (((dx := denom x) ~= 1) and + (not one?(dx := denom x) and ((rx := retractIfCan(dx)@Union(Integer,"failed")) case Integer) and positive?(rx)) => hackroot((numer x)::F, n)/hackroot(rx::Integer::F, n) diff --git a/src/algebra/carten.spad.pamphlet b/src/algebra/carten.spad.pamphlet index 6d7de173..ed391bf4 100644 --- a/src/algebra/carten.spad.pamphlet +++ b/src/algebra/carten.spad.pamphlet @@ -372,7 +372,7 @@ CartesianTensor(minix, dim, R): Exports == Implementation where lengthRankOrElse n elt(x) == - #x ~= 1 => error "Index error (the rank is not 0)" + not one?(#x) => error "Index error (the rank is not 0)" get(x,0) elt(x, i: I) == #x ~= dim => error "Index error (the rank is not 1)" diff --git a/src/algebra/ddfact.spad.pamphlet b/src/algebra/ddfact.spad.pamphlet index 2fbc0ca5..80e8b3fd 100644 --- a/src/algebra/ddfact.spad.pamphlet +++ b/src/algebra/ddfact.spad.pamphlet @@ -101,12 +101,12 @@ DistinctDegreeFactorize(F,FP): C == T factlist : List(ParFact) :=empty() llf : List FFE fln :List(FP) := empty() - if (lcm:=leadingCoefficient m)~=1 then m:=(inv lcm)*m + if not one?(lcm:=leadingCoefficient m) then m:=(inv lcm)*m llf:= factorList(squareFree(m)) for lf in llf repeat d1:= lf.xpnt pol := lf.fctr - if (lcp:=leadingCoefficient pol)~=1 then pol := (inv lcp)*pol + if not one?(lcp:=leadingCoefficient pol) then pol := (inv lcp)*pol degree pol=1 => factlist:=cons([pol,d1]$ParFact,factlist) fln := appl(pol) factlist :=append([[pf,d1]$ParFact for pf in fln],factlist) @@ -159,7 +159,8 @@ DistinctDegreeFactorize(F,FP): C == T g := gcd(v-mon,u) dg := degree g dg =0 => "next k1" - if leadingCoefficient g ~=1 then g := (inv leadingCoefficient g)*g + if not one? leadingCoefficient g then + g := (inv leadingCoefficient g)*g ddfact := cons([k1,g]$fact,ddfact) testirr => return ddfact u := u quo g @@ -222,7 +223,7 @@ DistinctDegreeFactorize(F,FP): C == T fln : List(FP) :=empty() --make m monic - if (lcm := leadingCoefficient m) ~=1 then m := (inv lcm)*m + if not one?(lcm := leadingCoefficient m) then m := (inv lcm)*m --is x**d factor of m? if positive?(d := minimumDegree m) then diff --git a/src/algebra/derham.spad.pamphlet b/src/algebra/derham.spad.pamphlet index fe2a2e36..6e526e21 100644 --- a/src/algebra/derham.spad.pamphlet +++ b/src/algebra/derham.spad.pamphlet @@ -87,7 +87,8 @@ ExtAlgBasis(): Export == Implement where coerce(li:(L I)) == for x in li repeat - if x ~= 1 and x ~= 0 then error "coerce: values can only be 0 and 1" + if not one? x and not zero? x then + error "coerce: values can only be 0 and 1" li degree x == (_+/x)::NNI diff --git a/src/algebra/divisor.spad.pamphlet b/src/algebra/divisor.spad.pamphlet index 42056811..86feaf9e 100644 --- a/src/algebra/divisor.spad.pamphlet +++ b/src/algebra/divisor.spad.pamphlet @@ -440,7 +440,7 @@ ModularHermitianRowReduction(R): Exports == Implementation where qsetelt!(x, k, j, 0) un := unitNormal qelt(x,i,j) qsetelt!(x,i,j,un.canonical) - if un.associate ~= 1 then for jj in (j+1)..ncols repeat + if not one?(un.associate) then for jj in (j+1)..ncols repeat qsetelt!(x,i,jj,un.associate * qelt(x,i,jj)) xij := qelt(x,i,j) @@ -720,7 +720,7 @@ HyperellipticFiniteDivisor(F, UP, UPUP, R): Exports == Implementation where v::UP redpolyIfCan(h, a) == - degree(p := lift h) ~= 1 => "failed" + not one? degree(p := lift h) => "failed" q := - coefficient(p, 0) / coefficient(p, 1) rec := extendedEuclidean(denom q, a) not ground?(rec.generator) => "failed" diff --git a/src/algebra/elemntry.spad.pamphlet b/src/algebra/elemntry.spad.pamphlet index e102aade..ec9e0a56 100644 --- a/src/algebra/elemntry.spad.pamphlet +++ b/src/algebra/elemntry.spad.pamphlet @@ -647,7 +647,7 @@ ElementaryFunction(R, F): Exports == Implementation where ilog x ilog x == - ((num1 := one?(num := numer x)) or num = -1) and (den := denom x) ~= 1 + ((num1 := one?(num := numer x)) or num = -1) and not one?(den := denom x) and empty? variables x => - kernel(oplog, (num1 => den; -den)::F) kernel(oplog, x) diff --git a/src/algebra/ffpoly.spad.pamphlet b/src/algebra/ffpoly.spad.pamphlet index db79d30e..c4f0c586 100644 --- a/src/algebra/ffpoly.spad.pamphlet +++ b/src/algebra/ffpoly.spad.pamphlet @@ -345,7 +345,7 @@ FiniteFieldPolynomialPackage GF : Exports == Implementation where -- determine the multiplicative order of q modulo d e : PI := 1 qe : PI := q - while (qe rem d) ~= 1 repeat + while not one?(qe rem d) repeat e := e + 1 qe := qe * q prod := prod * _ @@ -361,7 +361,7 @@ FiniteFieldPolynomialPackage GF : Exports == Implementation where -- (cf. [LN] p.89, Th. 3.16, and p.87, following Th. 3.11) n : NNI := degree f n = 0 => false - leadingCoefficient f ~= 1 => false + not one? leadingCoefficient f => false coefficient(f, 0) = 0 => false q : PI := sizeGF qn1: PI := (q**n - 1) :: NNI :: PI @@ -371,7 +371,7 @@ FiniteFieldPolynomialPackage GF : Exports == Implementation where -- may be improved by tabulating the residues x**(i*q) -- for i = 0,...,n-1 : -- - lift(x ** qn1)$MM ~= 1 => false -- X**(q**n - 1) rem f in GF[X] + not one? lift(x ** qn1)$MM => false -- X**(q**n - 1) rem f in GF[X] lrec : L Record(factor:I, exponent:I) := factors(factor qn1) lfact : L PI := [] -- collect the prime factors for rec in lrec repeat -- of q**n - 1 @@ -387,7 +387,7 @@ FiniteFieldPolynomialPackage GF : Exports == Implementation where -- x, x**q, ... , x**(q**(n-1)) are linearly independent over GF n : NNI := degree f n = 0 => false - leadingCoefficient f ~= 1 => false + not one? leadingCoefficient f => false coefficient(f, 0) = 0 => false n = 1 => true not irreducible? f => false @@ -428,7 +428,7 @@ FiniteFieldPolynomialPackage GF : Exports == Implementation where n : NNI := degree f n = 0 => error "polynomial must have positive degree" -- make f monic - if (lcf := leadingCoefficient f) ~= 1 then f := (inv lcf) * f + if not one?(lcf := leadingCoefficient f) then f := (inv lcf) * f -- if f = fn*X**n + ... + f{i0}*X**{i0} with the fi non-zero -- then fRepr := [[n,fn], ... , [i0,f{i0}]] fRepr : Repr := f pretend Repr @@ -506,7 +506,7 @@ FiniteFieldPolynomialPackage GF : Exports == Implementation where n : NNI := degree f n = 0 => error "polynomial must have positive degree" -- make f monic - if (lcf := leadingCoefficient f) ~= 1 then f := (inv lcf) * f + if not one?(lcf := leadingCoefficient f) then f := (inv lcf) * f -- if f = fn*X**n + ... + f{i0}*X**{i0} with the fi non-zero -- then fRepr := [[n,fn], ... , [i0,f{i0}]] fRepr : Repr := f pretend Repr @@ -626,7 +626,7 @@ FiniteFieldPolynomialPackage GF : Exports == Implementation where n : NNI := degree f n = 0 => error "polynomial must have positive degree" -- make f monic - if (lcf := leadingCoefficient f) ~= 1 then f := (inv lcf) * f + if not one?(lcf := leadingCoefficient f) then f := (inv lcf) * f -- if f = fn*X**n + ... + f{i0}*X**{i0} with the fi non-zero -- then fRepr := [[n,fn], ... , [i0,f{i0}]] fRepr : Repr := f pretend Repr @@ -740,7 +740,7 @@ FiniteFieldPolynomialPackage GF : Exports == Implementation where n : NNI := degree f n = 0 => error "polynomial must have positive degree" -- make f monic - if (lcf := leadingCoefficient f) ~= 1 then f := (inv lcf) * f + if not one?(lcf := leadingCoefficient f) then f := (inv lcf) * f -- if f = fn*X**n + ... + f{i0}*X**{i0} with the fi non-zero -- then fRepr := [[n,fn], ... , [i0,f{i0}]] fRepr : Repr := f pretend Repr diff --git a/src/algebra/ffpoly2.spad.pamphlet b/src/algebra/ffpoly2.spad.pamphlet index 76c5780f..b4f6b767 100644 --- a/src/algebra/ffpoly2.spad.pamphlet +++ b/src/algebra/ffpoly2.spad.pamphlet @@ -108,7 +108,7 @@ FiniteFieldPolynomialPackage2(F,GF):Exports == Implementation where h:=gcd(stillToFactor,trModp +$(SUP F) _ (index(j pretend PI)$GF::F::(SUP F)))$(SUP F) -- make the gcd polynomial monic - if leadingCoefficient(h)$(SUP F) ~= 1$F then + if not one? leadingCoefficient(h)$(SUP F) then h:= (inv leadingCoefficient(h)) * h degh:=degree(h)$(SUP F) degSTF:=degree(stillToFactor)$(SUP F) diff --git a/src/algebra/fr.spad.pamphlet b/src/algebra/fr.spad.pamphlet index a77e5370..babaa801 100644 --- a/src/algebra/fr.spad.pamphlet +++ b/src/algebra/fr.spad.pamphlet @@ -187,7 +187,7 @@ Factored(R: IntegralDomain): Exports == Implementation where -- l := concat(convert(rec.fctr)@InputForm, l) -- l := concat(convert(rec.fctr)@InputForm ** rec.xpnt, l) empty? l => convert(unit x)@InputForm - if unit x ~= 1 then l := concat(convert(unit x)@InputForm,l) + if not one? unit x then l := concat(convert(unit x)@InputForm,l) empty? rest l => first l binary(convert(_*::Symbol)@InputForm, l)@InputForm diff --git a/src/algebra/gaussfac.spad.pamphlet b/src/algebra/gaussfac.spad.pamphlet index 8f922d92..bb4cb963 100644 --- a/src/algebra/gaussfac.spad.pamphlet +++ b/src/algebra/gaussfac.spad.pamphlet @@ -132,7 +132,7 @@ GaussianFactorizationPackage() : C == T result : List FFE :=[] unity:ZI:=1$ZI - if d~=1 then + if not one? d then a:=(a exquo d)::Z b:=(b exquo d)::Z r:= intfactor(d) @@ -163,13 +163,13 @@ GaussianFactorizationPackage() : C == T m:=m quo z result:=concat(part,result) - if m~=1 then unity:=unity * m + if not one? m then unity:=unity * m makeFR(unity,result) ---- write p prime like sum of two squares ---- sumSquares(p:Z) : List Z == p=2 => [1,1] - p rem 4 ~= 1 => error "no solutions" + not one?(p rem 4) => error "no solutions" sumsq1(p) diff --git a/src/algebra/gbeuclid.spad.pamphlet b/src/algebra/gbeuclid.spad.pamphlet index 95e7bb51..963e210b 100644 --- a/src/algebra/gbeuclid.spad.pamphlet +++ b/src/algebra/gbeuclid.spad.pamphlet @@ -252,7 +252,7 @@ EuclideanGroebnerBasisPackage(Dom, Expon, VarSet, Dpol): T == C where if xx2 = 1 then prinpolINFO(Pol) print(" THE GROEBNER BASIS over EUCLIDEAN DOMAIN"::Ex) - if xx1 = 1 and xx2 ~= 1 then + if xx1 = 1 and not one? xx2 then print(" THE GROEBNER BASIS over EUCLIDEAN DOMAIN"::Ex) H diff --git a/src/algebra/gbintern.spad.pamphlet b/src/algebra/gbintern.spad.pamphlet index a150f100..77e72e6f 100644 --- a/src/algebra/gbintern.spad.pamphlet +++ b/src/algebra/gbintern.spad.pamphlet @@ -168,7 +168,7 @@ GroebnerInternalPackage(Dom, Expon, VarSet, Dpol): T == C where if xx2 = 1 then prinpolINFO(Pol) messagePrint(" THE GROEBNER BASIS POLYNOMIALS") - if xx1 = 1 and xx2 ~= 1 then + if xx1 = 1 and not one? xx2 then messagePrint(" THE GROEBNER BASIS POLYNOMIALS") Pol diff --git a/src/algebra/gdpoly.spad.pamphlet b/src/algebra/gdpoly.spad.pamphlet index b169c548..2a212926 100644 --- a/src/algebra/gdpoly.spad.pamphlet +++ b/src/algebra/gdpoly.spad.pamphlet @@ -254,7 +254,7 @@ GeneralDistributedMultivariatePolynomial(vl,R,E): public == private where t.k.i = 1 => l := cons(vl1.i,l) l := cons(vl1.i ** t.k.i ::OutputForm,l) l := reverse l - if (t.c ~= 1) or (null l) then l := cons(t.c :: OutputForm,l) + if not one? t.c or (null l) then l := cons(t.c :: OutputForm,l) 1 = #l => lt := cons(first l,lt) lt := cons(reduce("*",l),lt) 1 = #lt => first lt diff --git a/src/algebra/geneez.spad.pamphlet b/src/algebra/geneez.spad.pamphlet index 453ae3bd..3c449fe1 100644 --- a/src/algebra/geneez.spad.pamphlet +++ b/src/algebra/geneez.spad.pamphlet @@ -146,7 +146,7 @@ GenExEuclid(R,BP) : C == T rpol := first redListPol redListPol := rest redListPol for rpol2 in redListPol repeat - gcd(rpol, rpol2) ~= 1 => return false + not one? gcd(rpol, rpol2) => return false true if R has Field then diff --git a/src/algebra/groebf.spad.pamphlet b/src/algebra/groebf.spad.pamphlet index 9d7c70a3..abda5441 100644 --- a/src/algebra/groebf.spad.pamphlet +++ b/src/algebra/groebf.spad.pamphlet @@ -260,7 +260,7 @@ GroebnerFactorizationPackage(Dom, Expon, VarSet, Dpol): T == C where doSplitting? => for fnP in allReducedFactors repeat - if fnP ~= 1$Dpol + if not one? fnP then newInputPolys : L Dpol := _ sort( degree #1 > degree #2 ,cons(fnP,inputPolys)) diff --git a/src/algebra/idecomp.spad.pamphlet b/src/algebra/idecomp.spad.pamphlet index cec341b3..8dd14b10 100644 --- a/src/algebra/idecomp.spad.pamphlet +++ b/src/algebra/idecomp.spad.pamphlet @@ -145,7 +145,7 @@ IdealDecompositionPackage(vl,nv) : C == T -- take away nv, now doesn't lf:=Id.first pv:DPoly:=0 pw:DPoly:=0 - while degree(lf,y)~=1 repeat + while not one? degree(lf,y) repeat val:=random()$Z rem 23 pv:=px+val*py pw:=px-val*py @@ -296,7 +296,7 @@ IdealDecompositionPackage(vl,nv) : C == T -- take away nv, now doesn't is0dimprimary(J:FIdeal,truelist:List OV) : Boolean == element?(1,J) => true Jd:=generators(groebner J) - #(factors factor Jd.last)~=1 => return false + not one?(#(factors factor Jd.last)) => return false i:=subtractIfCan(#truelist,1) (i case "failed") => return true JR:=(reverse Jd);JM:=groebnerIdeal([JR.first]);JP:List(DPoly):=[] @@ -356,7 +356,7 @@ IdealDecompositionPackage(vl,nv) : C == T -- take away nv, now doesn't #Jd~=n => false for f in Jd repeat if not ismonic(f,lvint.i) then return false - if i<n and (degree univariate(f,lvint.i))~=1 then return false + if i<n and not one?(degree univariate(f,lvint.i)) then return false i:=i+1 g:=Jd.n #(lfact:=factors(factor g)) >1 => false diff --git a/src/algebra/intaux.spad.pamphlet b/src/algebra/intaux.spad.pamphlet index 875fbcb8..d88eb62b 100644 --- a/src/algebra/intaux.spad.pamphlet +++ b/src/algebra/intaux.spad.pamphlet @@ -104,7 +104,7 @@ IntegrationResult(F:Field): Exports == Implementation where cc::O * logandp coeffp:O := (outputForm(rec.coeff, alpha) = 0::Z::O)@O logandp := alpha * prefix('log::O, [outputForm(rec.logand, alpha)]) - if (cc := Q2F(rec.scalar)) ~= 1 then + if not one?(cc := Q2F(rec.scalar)) then logandp := cc::O * logandp sum(logandp, coeffp) diff --git a/src/algebra/intpm.spad.pamphlet b/src/algebra/intpm.spad.pamphlet index 9d47548f..f529f043 100644 --- a/src/algebra/intpm.spad.pamphlet +++ b/src/algebra/intpm.spad.pamphlet @@ -117,7 +117,7 @@ PatternMatchIntegration(R, F): Exports == Implementation where [cc, nc] if (v := isPower f) case Record(val:F, exponent:Z) then vv := v::Record(val:F, exponent:Z) - (vv.exponent ~= 1) => + not one?(vv.exponent) => rec := splitConstant(vv.val, x) return [rec.const ** vv.exponent, rec.nconst ** vv.exponent] error "splitConstant: should not happen" @@ -248,7 +248,7 @@ PatternMatchIntegration(R, F): Exports == Implementation where rec.coef * sqrt(rec.radicand) pmintegrate(f, x) == - (rc := splitConstant(f, x)).const ~= 1 => + not one?((rc := splitConstant(f, x)).const) => (u := pmintegrate(rc.nconst, x)) case "failed" => "failed" rec := u::ANS [rc.const * rec.special, rc.const * rec.integrand] @@ -266,7 +266,7 @@ PatternMatchIntegration(R, F): Exports == Implementation where "failed" pmComplexintegrate(f, x) == - (rc := splitConstant(f, x)).const ~= 1 => + not one?((rc := splitConstant(f, x)).const) => (u := pmintegrate(rc.nconst, x)) case "failed" => "failed" rec := u::ANS [rc.const * rec.special, rc.const * rec.integrand] diff --git a/src/algebra/laplace.spad.pamphlet b/src/algebra/laplace.spad.pamphlet index 9bbabadb..8a04817b 100644 --- a/src/algebra/laplace.spad.pamphlet +++ b/src/algebra/laplace.spad.pamphlet @@ -134,7 +134,7 @@ LaplaceTransform(R, F): Exports == Implementation where [c, c1, c0] if (v := isPower f) case Record(val:F, exponent:Integer) then w := v::Record(val:F, exponent:Integer) - (w.exponent ~= 1) and + not one?(w.exponent) and ((r := aexp(w.val, t)) case Record(coef:F,coef1:F,coef0:F)) => rec := r::Record(coef:F, coef1:F, coef0:F) return [rec.coef ** w.exponent, w.exponent * rec.coef1, @@ -194,7 +194,7 @@ LaplaceTransform(R, F): Exports == Implementation where -- Use linearity (u := mkPlus f) case List(F) => +/[locallaplace(g, t, tt, s, ss) for g in u::List(F)] - (rec := splitConstant(f, t)).const ~= 1 => + not one?((rec := splitConstant(f, t)).const) => rec.const * locallaplace(rec.nconst, t, tt, s, ss) -- laplace(t^n*f(t),t,s) = (-1)^n*D(laplace(f(t),t,s), s, n)) diff --git a/src/algebra/leadcdet.spad.pamphlet b/src/algebra/leadcdet.spad.pamphlet index 47ac9d85..0c312914 100644 --- a/src/algebra/leadcdet.spad.pamphlet +++ b/src/algebra/leadcdet.spad.pamphlet @@ -62,7 +62,7 @@ LeadingCoefDetermination(OV,E,Z,P) : C == T q := unitNormal(lval.i).canonical for j in 0..(i-1)::NNI repeat y := distlist.((i-j)::NNI) - while y~=1 repeat + while not one? y repeat y := gcd(y,q) q := q quo y if q=1 then return false @@ -87,7 +87,7 @@ LeadingCoefDetermination(OV,E,Z,P) : C == T d := vl.i quo d unilist.i := d*unilist.i contm := contm quo d - if contm ~=1 then for i in 1..nf repeat pl.i := contm*pl.i + if not one? contm then for i in 1..nf repeat pl.i := contm*pl.i [pl,contm,unilist]$LeadFact distFact(contm:Z,unilist:List(BP),plead:FinalFact, diff --git a/src/algebra/limitps.spad.pamphlet b/src/algebra/limitps.spad.pamphlet index ac82fee8..74158c85 100644 --- a/src/algebra/limitps.spad.pamphlet +++ b/src/algebra/limitps.spad.pamphlet @@ -167,7 +167,7 @@ PowerSeriesLimitPackage(R,FE): Exports == Implementation where xkers := [k for k in tower fcn | member?(x,variables(k::FE))] # xkers ~= 2 => "failed" expKers := [k for k in xkers | is?(k, "exp" :: Symbol)] - # expKers ~= 1 => "failed" + not one?(# expKers) => "failed" -- fcn is a rational function of x and exp(g(x)) for some rational function g expKer := first expKers (fval := limitPlus(expKer::FE,x)) case "failed" => "failed" @@ -188,7 +188,7 @@ PowerSeriesLimitPackage(R,FE): Exports == Implementation where specialLimit1(fcn,x) == -- find the first interesting kernel in tower(fcn) xkers := [k for k in kernels fcn | member?(x,variables(k::FE))] - #xkers ~= 1 => "failed" + not one?(#xkers) => "failed" ker := first xkers vv := new()$SY; eq : EQ FE := equation(ker :: FE,vv :: FE) cc := eval(fcn,eq) diff --git a/src/algebra/lingrob.spad.pamphlet b/src/algebra/lingrob.spad.pamphlet index 2cb3aca7..41956dea 100644 --- a/src/algebra/lingrob.spad.pamphlet +++ b/src/algebra/lingrob.spad.pamphlet @@ -115,7 +115,7 @@ LinGroebnerPackage(lv,F) : C == T ofirstmon:DPoly:=1$DPoly orecfmon:Record(poly:HDPoly, mult:F) := [1,1] i:NNI:=2 - while (firstmon:=choosemon(firstmon,ltresult))~=1 repeat + while not one?(firstmon:=choosemon(firstmon,ltresult)) repeat if (v:=firstmon exquo ofirstmon) case "failed" then recfmon:=rRedPol(transform firstmon,B) else @@ -274,7 +274,7 @@ LinGroebnerPackage(lv,F) : C == T ofirstmon:DPoly:=1$DPoly orecfmon:Record(poly:HDPoly, mult:F) := [1,1] lx:= lvar.last - while (firstmon:=choosemon(firstmon,ltresult))~=1 repeat + while not one?(firstmon:=choosemon(firstmon,ltresult)) repeat if (v:=firstmon exquo ofirstmon) case "failed" then recfmon:=rRedPol(transform(eval(firstmon,lx,nval)),B) else diff --git a/src/algebra/matfuns.spad.pamphlet b/src/algebra/matfuns.spad.pamphlet index 23617e39..47cc96e3 100644 --- a/src/algebra/matfuns.spad.pamphlet +++ b/src/algebra/matfuns.spad.pamphlet @@ -737,7 +737,7 @@ MatrixLinearAlgebraFunctions(R,Row,Col,M):Exports == Implementation where un := unitNormal qelt(x,i,j) qsetelt!(x,i,j,un.canonical) - if un.associate ~= 1 then for jj in (j+1)..maxC repeat + if not one?(un.associate) then for jj in (j+1)..maxC repeat qsetelt!(x,i,jj,un.associate * qelt(x,i,jj)) xij := qelt(x,i,j) diff --git a/src/algebra/mathml.spad.pamphlet b/src/algebra/mathml.spad.pamphlet index ba186863..086d0d0f 100644 --- a/src/algebra/mathml.spad.pamphlet +++ b/src/algebra/mathml.spad.pamphlet @@ -1023,7 +1023,7 @@ have to be switched by swapping names. atomE : L E := atomize(expr) op : S := stringify first atomE op ~= "SUPERSUB" => "<mtext>Mistake in formatSuperSub: no SUPERSUB1</mtext>" - #args ~= 1 => "<mtext>Mistake in SuperSub1: #args <> 1</mtext>" + not one?(#args) => "<mtext>Mistake in SuperSub1: #args <> 1</mtext>" var : E := first args -- should be looking at something like {{SUPERSUB}{var}{ }{,,...,}} for -- example here's the second derivative of y w.r.t. x @@ -1052,7 +1052,7 @@ have to be switched by swapping names. atomE : L E := atomize(expr) op : S := stringify first atomE op ~= "SUPERSUB" => "<mtext>Mistake in formatSuperSub: no SUPERSUB</mtext>" - #args ~= 1 => "<mtext>Mistake in SuperSub: #args <> 1</mtext>" + not one?(#args) => "<mtext>Mistake in SuperSub: #args <> 1</mtext>" var : E := first args -- should be looking at something like {{SUPERSUB}{var}{ }{,,...,}} for -- example here's the second derivative of y w.r.t. x diff --git a/src/algebra/mfinfact.spad.pamphlet b/src/algebra/mfinfact.spad.pamphlet index 55153b57..73483b86 100644 --- a/src/algebra/mfinfact.spad.pamphlet +++ b/src/algebra/mfinfact.spad.pamphlet @@ -218,7 +218,7 @@ MultFiniteFactorize(OV,E,F,PG) : C == T x := lvar.1 lvar:=lvar.rest pc:= gcd coefficients um - if pc~=1 then + if not one? pc then um:=(um exquo pc)::SUP P ffactor:=multivariate(um,x) for lcterm in mFactor(pc,dx).factors repeat @@ -228,7 +228,7 @@ MultFiniteFactorize(OV,E,F,PG) : C == T -- should be unitNormal if unified, but for now it is easier lcum:F:= leadingCoefficient leadingCoefficient leadingCoefficient um - if lcum ~=1 then + if not one? lcum then um:=((inv lcum)::R::P) * um flead.contp := (lcum::R) *flead.contp @@ -286,13 +286,13 @@ MultFiniteFactorize(OV,E,F,PG) : C == T lpol:= dist.polfac dd := dist.correct unifact:=dist.corrfact - if dd~=1 then + if not one? dd then unifact := [dd*unifact.i for i in 1..nfact] um := ((dd**(nfact-1)::NNI)::P)*um (ffin:= lifting(um,lvar,unifact,lval,lpol,ldeg,pM(unifact))) case "failed" => intfact(um,lvar,ldeg,tleadpol,ltry) factfin: L SUP P:=ffin :: L SUP P - if dd~=1 then + if not one? dd then factfin:=[primitivePart ff for ff in factfin] factfin @@ -397,7 +397,7 @@ MultFiniteFactorize(OV,E,F,PG) : C == T -- else lcnm:F:=1 -- should be unitNormal if unified, but for now it is easier - if (lcnm:=leadingCoefficient leadingCoefficient newm)~=1 then + if not one?(lcnm:=leadingCoefficient leadingCoefficient newm) then newm:=((inv lcnm)::R)*newm dx:="max"/[degree uc for uc in coefficients newm] luniv:=generalTwoFactor(newm)$TwoFactorize(F) diff --git a/src/algebra/moddfact.spad.pamphlet b/src/algebra/moddfact.spad.pamphlet index 14795411..5cb2893d 100644 --- a/src/algebra/moddfact.spad.pamphlet +++ b/src/algebra/moddfact.spad.pamphlet @@ -114,7 +114,7 @@ ModularDistinctDegreeFactorizer(U):C == T where ans::U ddfactor(u) == - if (c:= lc(u)) ~= 1$I then u:= makeMonic(u) + if not one?(c:= lc(u)) then u:= makeMonic(u) ans:= sepfact(ddfact(u)) cons(c::EMR,[makeMonic(f) for f in ans | positive? degree(f)]) @@ -133,7 +133,7 @@ ModularDistinctDegreeFactorizer(U):C == T where w:= reduce(monomial(1,1)$U,p) m:= w d:I:= 1 - if (c:= lc(u)) ~= 1$I then u:= makeMonic u + if not one?(c:= lc(u)) then u:= makeMonic u ans:DDList:= [] repeat w:= exptmod(w,p,u) @@ -173,7 +173,7 @@ ModularDistinctDegreeFactorizer(U):C == T where u:= f.factor p:=modulus u (d := f.degree) = 0 => [u] - if (c:= lc(u)) ~= 1$I then u:= makeMonic(u) + if not one?(c:= lc(u)) then u:= makeMonic(u) d = (du := degree(u)) => [u] ans:L EMR:= [] x:U:= monomial(1,1) diff --git a/src/algebra/modmon.spad.pamphlet b/src/algebra/modmon.spad.pamphlet index 84c10d58..cb60793e 100644 --- a/src/algebra/modmon.spad.pamphlet +++ b/src/algebra/modmon.spad.pamphlet @@ -73,7 +73,7 @@ ModMonic(R,Rep): C == T setPoly (mon : Rep) == mon =$Rep m => mon oldm := m - leadingCoefficient mon ~= 1 => error "polynomial must be monic" + not one? leadingCoefficient mon => error "polynomial must be monic" -- following copy code needed since FFPOLY can modify mon copymon:Rep:= 0 while not zero? mon repeat diff --git a/src/algebra/mring.spad.pamphlet b/src/algebra/mring.spad.pamphlet index 6adb05f8..9521b586 100644 --- a/src/algebra/mring.spad.pamphlet +++ b/src/algebra/mring.spad.pamphlet @@ -186,13 +186,13 @@ MonoidRing(R: Ring, M: Monoid): MRcategory == MRdefinition where if M has Group then recip a == lt := terms a - #lt ~= 1 => "failed" + not one?(#lt) => "failed" (u := recip lt.first.Cf) case "failed" => "failed" --(u::R) * inv lt.first.Mn monomial((u::R), inv lt.first.Mn)$% else recip a == - #a ~= 1 or a.first.Mn ~= 1 => "failed" + not one?(#a) or not one?(a.first.Mn) => "failed" (u := recip a.first.Cf) case "failed" => "failed" u::R::% diff --git a/src/algebra/multfact.spad.pamphlet b/src/algebra/multfact.spad.pamphlet index b6009e97..de704ea2 100644 --- a/src/algebra/multfact.spad.pamphlet +++ b/src/algebra/multfact.spad.pamphlet @@ -325,7 +325,7 @@ InnerMultFact(OV,E,R,P) : C == T lpol:= dist.polfac dd := dist.correct unifact:=dist.corrfact - if dd~=1 then + if not one? dd then -- if polcase then lpol := [unitCanonical lp for lp in lpol] -- dd:=unitCanonical(dd) unifact := [dd * unif for unif in unifact] @@ -334,7 +334,7 @@ InnerMultFact(OV,E,R,P) : C == T (ffin:=lifting(umd,lvar,unifact,lval,lpol,ldeg,pmod)) case "failed" => intfact(um,lvar,ldeg,tleadpol,ltry,ufactor) factfin: L USP:=ffin :: L USP - if dd~=1 then + if not one? dd then factfin:=[primitivePart ff for ff in factfin] factfin @@ -425,7 +425,7 @@ InnerMultFact(OV,E,R,P) : C == T x := lvar.first lvar := lvar.rest pc:= gcd coefficients um - if pc~=1 then + if not one? pc then um:=(um exquo pc)::USP ffactor:=multivariate(um,x) for lcterm in mFactor(pc,ufactor).factors repeat diff --git a/src/algebra/multpoly.spad.pamphlet b/src/algebra/multpoly.spad.pamphlet index d7cb75c5..b558f0af 100644 --- a/src/algebra/multpoly.spad.pamphlet +++ b/src/algebra/multpoly.spad.pamphlet @@ -481,11 +481,11 @@ SparseMultivariatePolynomial(R: Ring,VarSet: OrderedSet): C == T where gcd(leadingCoefficient b, content a)::SUP $ conta := content a mona:SUP $ := monomial(conta, minimumDegree a) - if mona ~= 1 then + if not one? mona then a := (a exquo mona)::SUP $ contb := content b monb:SUP $ := monomial(contb, minimumDegree b) - if monb ~= 1 then + if not one? monb then b := (b exquo monb)::SUP $ mong:SUP $ := monomial(gcd(conta, contb), min(degree mona, degree monb)) diff --git a/src/algebra/multsqfr.spad.pamphlet b/src/algebra/multsqfr.spad.pamphlet index 7114c0f6..6c54e72c 100644 --- a/src/algebra/multsqfr.spad.pamphlet +++ b/src/algebra/multsqfr.spad.pamphlet @@ -111,13 +111,13 @@ MultivariateSquareFree (E,OV,R,P) : C == T where exp0:Z:=0 unitsq:P:=1 lcf:P:=leadingCoefficient f - if ctf~=1 then + if not one? ctf then f0:=ctf*f0 f:=(ctf::P)*f lcf:=ctf*lcf sqlead:List FFEP:= empty() sqlc:Factored P:=1 - if lcf~=1$P then + if not one? lcf then leadpol:=true sqlc:=squareFree lcf unitsq:=unitsq*(unit sqlc) @@ -132,7 +132,7 @@ MultivariateSquareFree (E,OV,R,P) : C == T where gg := unitNormal leadingCoefficient f sqdec:=cons([gg.associate*f,exp0],sqdec) return [gg.unit, sqdec]$squareForm - if ctf~=1 then g0:=ctf*g0 + if not one? ctf then g0:=ctf*g0 npol:=consnewpol(f,f0,exp0) (d,d0):=(npol.pol,npol.polval) if leadpol then lcoef:=coefChoose(exp0,sqlc) @@ -147,8 +147,8 @@ MultivariateSquareFree (E,OV,R,P) : C == T where f:=h::SUP f0:=completeEval(h,lvar,lval) lcr:P:=leadingCoefficient result0 - if leadpol and lcr~=1$P then - for lpfact in sqlead while lcr~=1 repeat + if leadpol and not one? lcr then + for lpfact in sqlead while not one? lcr repeat ground? lcr => unitsq:=(unitsq exquo lcr)::P lcr:=1$P @@ -195,7 +195,7 @@ MultivariateSquareFree (E,OV,R,P) : C == T where y:=lvar.im p:=p*monomial(1$P,y,n) result1:=cons(["sqfr",y::P,n],result1) - if p~=1$P then + if not one? p then f := (f exquo p)::P if ground? f then return makeFR(f, result1) lvar:=variables(f) diff --git a/src/algebra/nlode.spad.pamphlet b/src/algebra/nlode.spad.pamphlet index 4e4a7c25..ddb365b2 100644 --- a/src/algebra/nlode.spad.pamphlet +++ b/src/algebra/nlode.spad.pamphlet @@ -101,7 +101,7 @@ NonLinearFirstOrderODESolver(R, F): Exports == Implementation where r := denom(f := m / n)::F (not freeOf?(r, y := ky::F)) or (d := degree(p := univariate(numer f, ky))) < 2 - or degree(pp := reductum p) ~= 1 or reductum(pp) ~= 0 + or not one? degree(pp := reductum p) or reductum(pp) ~= 0 or (not freeOf?(a := (leadingCoefficient(pp)::F), y)) or (not freeOf?(b := (leadingCoefficient(p)::F), y)) => "failed" [a / r, b / r, d] diff --git a/src/algebra/npcoef.spad.pamphlet b/src/algebra/npcoef.spad.pamphlet index 7278870e..47710d88 100644 --- a/src/algebra/npcoef.spad.pamphlet +++ b/src/algebra/npcoef.spad.pamphlet @@ -63,7 +63,7 @@ NPCoef(BP,E,OV,R,P) : C == T where changed:Boolean:=true ltochange:List(NNI):=empty() ltodel:List(NNI):=empty() - while changed and ndet~=1 repeat + while changed and not one? ndet repeat changed :=false dt:=#tablecoef for i in 1..dt while not changed repeat diff --git a/src/algebra/numsolve.spad.pamphlet b/src/algebra/numsolve.spad.pamphlet index ae969619..04935b6b 100644 --- a/src/algebra/numsolve.spad.pamphlet +++ b/src/algebra/numsolve.spad.pamphlet @@ -148,7 +148,7 @@ InnerNumericFloatSolvePackage(K,F,Par): Cat == Cap where p0 := primitivePart multivariate(vec.0, mainvar) p1 := primitivePart(multivariate(vec.1, mainvar),mainvar) zero? p1 or - gcd(p0, leadingCoefficient(univariate(p1,mainvar))) ~=1 => + not one? gcd(p0, leadingCoefficient(univariate(p1,mainvar))) => innerSolve(cons(0,lp),empty(),lv,eps) findGenZeros([p1, p0], reverse lv, eps) @@ -286,12 +286,12 @@ FloatingRealPackage(Par): Cat == Cap where -- real zeros of the system of polynomial lp -- realRoots(lp:L RFI,lv:L SE,eps: Par) : L L Par == lnum:=[numer p for p in lp] - lden:=[dp for p in lp |(dp:=denom p)~=1] + lden:=[dp for p in lp |not one?(dp:=denom p)] innerSolve(lnum,lden,lv,eps)$INFSP(I,Par,Par) solve(lp:L RFI,eps : Par) : L L EQ P Par == lnum:=[numer p for p in lp] - lden:=[dp for p in lp |(dp:=denom p)~=1] + lden:=[dp for p in lp |not one?(dp:=denom p)] lv:="setUnion"/[variables np for np in lnum] if lden~=[] then lv:=setUnion(lv,"setUnion"/[variables dp for dp in lden]) @@ -301,7 +301,7 @@ FloatingRealPackage(Par): Cat == Cap where solve(le:L EQ RFI,eps : Par) : L L EQ P Par == lp:=[lhs ep - rhs ep for ep in le] lnum:=[numer p for p in lp] - lden:=[dp for p in lp |(dp:=denom p)~=1] + lden:=[dp for p in lp |not one?(dp:=denom p)] lv:="setUnion"/[variables np for np in lnum] if lden~=[] then lv:=setUnion(lv,"setUnion"/[variables dp for dp in lden]) @@ -406,12 +406,12 @@ FloatingComplexPackage(Par): Cat == Cap where -- find the complex zeros of an univariate polynomial -- complexRoots(lp:L FPK,lv:L SE,eps:Par) : L L C Par == lnum:=[numer p for p in lp] - lden:=[dp for p in lp |(dp:=denom p)~=1] + lden:=[dp for p in lp |not one?(dp:=denom p)] innerSolve(lnum,lden,lv,eps)$INFSP(K,C Par,Par) complexSolve(lp:L FPK,eps : Par) : L L EQ P C Par == lnum:=[numer p for p in lp] - lden:=[dp for p in lp |(dp:=denom p)~=1] + lden:=[dp for p in lp |not one?(dp:=denom p)] lv:="setUnion"/[variables np for np in lnum] if lden~=[] then lv:=setUnion(lv,"setUnion"/[variables dp for dp in lden]) @@ -421,7 +421,7 @@ FloatingComplexPackage(Par): Cat == Cap where complexSolve(le:L EQ FPK,eps : Par) : L L EQ P C Par == lp:=[lhs ep - rhs ep for ep in le] lnum:=[numer p for p in lp] - lden:=[dp for p in lp |(dp:=denom p)~=1] + lden:=[dp for p in lp |not one?(dp:=denom p)] lv:="setUnion"/[variables np for np in lnum] if lden~=[] then lv:=setUnion(lv,"setUnion"/[variables dp for dp in lden]) diff --git a/src/algebra/numtheor.spad.pamphlet b/src/algebra/numtheor.spad.pamphlet index 98a30591..0e40d82e 100644 --- a/src/algebra/numtheor.spad.pamphlet +++ b/src/algebra/numtheor.spad.pamphlet @@ -131,7 +131,7 @@ Using the half extended Euclidean algorithm we compute 1/a mod b. r:I := a-q*b (a,b):=(b,r) (c1,d1):=(d1,c1-q*d1) - a ~= 1 => error("moduli are not relatively prime") + not one? a => error("moduli are not relatively prime") positiveRemainder(c1,borg) @ @@ -155,11 +155,11 @@ inverse(a,b) == print [a, "=", q, "*(", b, ")+", r] (a,b):=(b,r) (c1,d1):=(d1,c1-q*d1) - a ~= 1 => error("moduli are not relatively prime") + not one? a => error("moduli are not relatively prime") positiveRemainder(c1,borg) -if ((inverse(26,15)*26)::IntegerMod(15) ~= 1) then print "DALY BUG" -if ((inverse(15,26)*15)::IntegerMod(26) ~= 1) then print "DALY BUG" +if not one?((inverse(26,15)*26)::IntegerMod(15)) then print "DALY BUG" +if not one?((inverse(15,26)*15)::IntegerMod(26)) then print "DALY BUG" @ \subsection{The Chinese Remainder Algorithm} @@ -566,7 +566,7 @@ PolynomialNumberTheoryFunctions(): Exports == Implementation where MonicQuotient: (SUP(I),SUP(I)) -> SUP(I) MonicQuotient (a,b) == - leadingCoefficient(b) ~= 1 => error "divisor must be monic" + not one? leadingCoefficient(b) => error "divisor must be monic" b = 1 => a da := degree a db := degree b -- assertion: degree b > 0 diff --git a/src/algebra/permgrps.spad.pamphlet b/src/algebra/permgrps.spad.pamphlet index ee5c746a..f3c8fa7d 100644 --- a/src/algebra/permgrps.spad.pamphlet +++ b/src/algebra/permgrps.spad.pamphlet @@ -350,7 +350,7 @@ PermutationGroup(S:SetCategory): public == private where ort := orbitWithSvc ( group , i ) k := ort.orb k1 := # k - if k1 ~= 1 then leave + if not one? k1 then leave gpsgs := nil()$(L V NNI) words2 := nil()$(L L NNI) gplength : NNI := #group diff --git a/src/algebra/pgcd.spad.pamphlet b/src/algebra/pgcd.spad.pamphlet index edbbccb0..2caf53de 100644 --- a/src/algebra/pgcd.spad.pamphlet +++ b/src/algebra/pgcd.spad.pamphlet @@ -322,7 +322,7 @@ PolynomialGcdPackage(E,OV,R,P):C == T where df:=degree f leadlist:List(P):=[] - if lgcd~=1 then + if not one? lgcd then leadpol:=true f:=lgcd*f ldeg:=[n0+n1 for n0 in ldeg for n1 in degree(lgcd,lvar)] diff --git a/src/algebra/poly.spad.pamphlet b/src/algebra/poly.spad.pamphlet index d055f03d..71a7d8df 100644 --- a/src/algebra/poly.spad.pamphlet +++ b/src/algebra/poly.spad.pamphlet @@ -618,7 +618,7 @@ SparseUnivariatePolynomial(R:Ring): UnivariatePolynomialCategory(R) with monicDivide(p1:%,p2:%) == null p2 => error "monicDivide: division by 0" - leadingCoefficient p2 ~= 1 => error "Divisor Not Monic" + not one? leadingCoefficient p2 => error "Divisor Not Monic" p2 = 1 => [p1,0] null p1 => [0,0] degree p1 < (n:=degree p2) => [0,p1] @@ -1045,7 +1045,7 @@ PolynomialSquareFree(VarSet:OrderedSet,E,RC:GcdDomain,P):C == T where cont1:=cont1*((unit listfin1)**uexp) pfaclist:=append(flistfin1,pfaclist) cont:=cont*cont1 - cont ~= 1 => + not one? cont => sqp := squareFree cont pfaclist:= append (factorList sqp,pfaclist) makeFR(unit(sqp)*coefficient(unit squf,0),pfaclist) @@ -1062,7 +1062,7 @@ PolynomialSquareFree(VarSet:OrderedSet,E,RC:GcdDomain,P):C == T where pfaclist:List FF := [[u.flg,multivariate(u.fctr,mv),u.xpnt] for u in factorList squp] - cont ~= 1 => + not one? cont => sqp := squareFree cont makeFR(unit(sqp)*coefficient(unit squp,0), append(factorList sqp, pfaclist)) diff --git a/src/algebra/primelt.spad.pamphlet b/src/algebra/primelt.spad.pamphlet index c72e09f6..9163b529 100644 --- a/src/algebra/primelt.spad.pamphlet +++ b/src/algebra/primelt.spad.pamphlet @@ -92,7 +92,7 @@ PrimitiveElement(F): Exports == Implementation where ll := nil()$List(UP) for v in lv repeat ((u := findUniv(l, v, w)) case "failed") or - (degree(p := univariate(u::P, v)) ~= 1) => return "failed" + not one? degree(p := univariate(u::P, v)) => return "failed" (bc := extendedEuclidean(univariate leadingCoefficient p, pw,1)) case "failed" => error "Should not happen" ll := concat(map(#1, diff --git a/src/algebra/rf.spad.pamphlet b/src/algebra/rf.spad.pamphlet index 26184004..ccb642c3 100644 --- a/src/algebra/rf.spad.pamphlet +++ b/src/algebra/rf.spad.pamphlet @@ -91,8 +91,8 @@ PolynomialCategoryQuotientFunctions(E, V, R, P, F): mymerge(variables numer f, variables denom f) isPower f == - (den := denom f) ~= 1 => - numer f ~= 1 => "failed" + not one?(den := denom f) => + not one? numer f => "failed" (ur := isExpt den) case "failed" => [den::F, -1] r := ur::Record(var:V, exponent:NonNegativeInteger) [r.var::P::F, - (r.exponent::Integer)] @@ -123,7 +123,7 @@ PolynomialCategoryQuotientFunctions(E, V, R, P, F): concat!(l::List(F), d) isPlus f == - denom f ~= 1 => "failed" + not one? denom f => "failed" (s := isPlus numer f) case "failed" => "failed" [x::F for x in s] diff --git a/src/algebra/rinterp.spad.pamphlet b/src/algebra/rinterp.spad.pamphlet index 73d12ede..468f9004 100644 --- a/src/algebra/rinterp.spad.pamphlet +++ b/src/algebra/rinterp.spad.pamphlet @@ -116,7 +116,7 @@ some of the data points may not be interpolated correctly. However, the solution is often still useful, thus we do not signal an error. <<RINTERP Implementation>>= - if #res~=1 then output("Warning: unattainable points!" _ + if not one?(#res) then output("Warning: unattainable points!" _ ::OutputForm)$OutputPackage @ diff --git a/src/algebra/space.spad.pamphlet b/src/algebra/space.spad.pamphlet index 6d688e47..60d4a13e 100644 --- a/src/algebra/space.spad.pamphlet +++ b/src/algebra/space.spad.pamphlet @@ -616,7 +616,7 @@ ThreeSpace(R:Ring):Exports == Implementation where numCurves := numCurves + 1 (#kid = 2) and _ (#children first kid = 1) and _ - (#children first rest kid ~= 1) => + not one?(#children first rest kid) => numPolys := numPolys + 1 numConstructs := numConstructs + 1 -- otherwise, a mathematical surface is assumed diff --git a/src/algebra/sregset.spad.pamphlet b/src/algebra/sregset.spad.pamphlet index dc961607..c301db79 100644 --- a/src/algebra/sregset.spad.pamphlet +++ b/src/algebra/sregset.spad.pamphlet @@ -1296,7 +1296,7 @@ SquareFreeRegularTriangularSet(R,E,V,P) : Exports == Implementation where not (mvar(ts) < mvar(p)) => "failed"::Union($,"failed") invertible?(init(p),ts)@Boolean => lts: Split := augment(p,ts) - #lts ~= 1 => "failed"::Union($,"failed") + not one?(#lts) => "failed"::Union($,"failed") (first lts)::Union($,"failed") "failed"::Union($,"failed") diff --git a/src/algebra/sttaylor.spad.pamphlet b/src/algebra/sttaylor.spad.pamphlet index 2de808ad..a3ddc781 100644 --- a/src/algebra/sttaylor.spad.pamphlet +++ b/src/algebra/sttaylor.spad.pamphlet @@ -558,7 +558,7 @@ Finally, we return the result with the correct order. powerre: (A,ST A,ST A) -> ST A powerre(s,x,c) == delay empty? x => zro() - frst x~=1 => error "**:constant coefficient should be 1" + not one? frst x => error "**:constant coefficient should be 1" concat(frst x,finteg((s+1)*(c*deriv x))-rst x * c) power(s,x) == YS(powerre(s,x,#1)) diff --git a/src/algebra/sum.spad.pamphlet b/src/algebra/sum.spad.pamphlet index e3d66075..aa5ae39f 100644 --- a/src/algebra/sum.spad.pamphlet +++ b/src/algebra/sum.spad.pamphlet @@ -269,13 +269,13 @@ GosperSummationMethod(E, V, R, P, Q): Exports == Impl where linearAndNNIntRoot(mp, v) == p := univariate(mp, v) - degree p ~= 1 => "failed" + not one? degree p => "failed" (p1 := retractIfCan(coefficient(p, 1))@Union(RN,"failed")) case "failed" or (p0 := retractIfCan(coefficient(p, 0))@Union(RN,"failed")) case "failed" => "failed" rt := -(p0::RN)/(p1::RN) - negative? rt or denom rt ~= 1 => "failed" + negative? rt or not one? denom rt => "failed" numer rt @ diff --git a/src/algebra/syssolp.spad.pamphlet b/src/algebra/syssolp.spad.pamphlet index 82218fa6..8fd97610 100644 --- a/src/algebra/syssolp.spad.pamphlet +++ b/src/algebra/syssolp.spad.pamphlet @@ -147,7 +147,7 @@ SystemSolvePackage(R): Cat == Cap where push:=PushVariables(R,DP,OV,dmp) lq : L dmp lvv:L OV:=[variable(vv)::OV for vv in lv] - lq:=[pushup(df::dmp,lvv)$push for f in lf|(df:=denom f)~=1] + lq:=[pushup(df::dmp,lvv)$push for f in lf|not one?(df:=denom f)] lp:=[pushup(numer(f)::dmp,lvv)$push for f in lf] parRes:=groebSolve(lp,lvv)$GroebnerSolve(lv,P R,R) if lq~=[] then diff --git a/src/algebra/twofact.spad.pamphlet b/src/algebra/twofact.spad.pamphlet index 2161c9a2..fb560b20 100644 --- a/src/algebra/twofact.spad.pamphlet +++ b/src/algebra/twofact.spad.pamphlet @@ -159,7 +159,7 @@ TwoFactorize(F) : C == T pfaclist) unitPart := unit(nfacs)**uexp * unitPart pfaclist := cons(u,pfaclist) - cont ~= 1 => + not one? cont => sqp := squareFree cont contlist:=[[w.flg,(w.fctr)::P,w.xpnt] for w in factorList sqp] pfaclist:= append(contlist, pfaclist) @@ -274,7 +274,7 @@ TwoFactorize(F) : C == T while not empty? lfacth repeat ff := first lfacth lfacth := rest lfacth - if (c:=leadingCoefficient leadingCoefficient ff) ~=1 then + if not one?(c:=leadingCoefficient leadingCoefficient ff) then ff:=((inv c)::SUEx)* ff not ((ffu:= retractIfCan(ff)$Normp) case "failed") => lfactk := cons(ffu::P, lfactk) diff --git a/src/algebra/unifact.spad.pamphlet b/src/algebra/unifact.spad.pamphlet index ab5a3e8e..f3437a81 100644 --- a/src/algebra/unifact.spad.pamphlet +++ b/src/algebra/unifact.spad.pamphlet @@ -136,7 +136,7 @@ UnivariateFactorize(ZP) : public == private where nm := (degree m)::NNI nmq2:NNI := nm quo 2 norm: Z := sqroot(+/[coefficient(m,k)**2 for k in 0..nm]) - if nmq2~=1 then nm := (nmq2-1):NNI + if not one? nmq2 then nm := (nmq2-1):NNI else nm := nmq2 bin0 := nm cbound := (bin0*norm+lcm)::PI @@ -219,7 +219,7 @@ UnivariateFactorize(ZP) : public == private where alpha: Z := coefficient(m,1)+d2 beta: Z := 2*coefficient(m,2) d := gcd(alpha,beta) - if d ~=1 then + if not one? d then alpha := alpha quo d beta := beta quo d m0: ZP := monomial(beta,1)+monomial(alpha,0) diff --git a/src/algebra/xlpoly.spad.pamphlet b/src/algebra/xlpoly.spad.pamphlet index 54526022..f607199d 100644 --- a/src/algebra/xlpoly.spad.pamphlet +++ b/src/algebra/xlpoly.spad.pamphlet @@ -254,7 +254,7 @@ LyndonWord(VarSet:OrderedSet):Public == Private where lyndon? w == w = 1$OFMON => false f: OFMON := rest w - while f ~= 1$OFMON repeat + while not one? f repeat not lexico(w,f) => return false f := rest f true @@ -807,7 +807,7 @@ PoincareBirkhoffWittLyndonBasis(VarSet: OrderedSet): Public == Private where null x.rest retract x == - #x ~= 1 => error "cannot convert to Lyndon word" + not one?(#x) => error "cannot convert to Lyndon word" x.first retractIfCan x == diff --git a/src/algebra/xpoly.spad.pamphlet b/src/algebra/xpoly.spad.pamphlet index b946d8bd..249a5e0e 100644 --- a/src/algebra/xpoly.spad.pamphlet +++ b/src/algebra/xpoly.spad.pamphlet @@ -267,7 +267,7 @@ FreeModule1(R:Ring,S:OrderedSet): FMcat == FMdef where monomials x == [ monom (t.k, t.c) for t in x] retractIfCan x == - numberOfMonomials(x) ~= 1 => "failed" + not one? numberOfMonomials(x) => "failed" x.first.c = 1 => x.first.k "failed" @@ -574,7 +574,7 @@ XPolynomialRing(R:Ring,E:OrderedMonoid): T == C where constant? p == (p = 0) or (maxdeg(p) = 1$E) constant p == coef(p,1$E) - quasiRegular? p == (p=0) or (last p).k ~= 1$E + quasiRegular? p == (p=0) or not one?((last p).k) quasiRegular p == quasiRegular?(p) => p [t for t in p | not(t.k = 1$E)] |