aboutsummaryrefslogtreecommitdiff
path: root/src/algebra
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-03-12 19:17:32 +0000
committerdos-reis <gdr@axiomatics.org>2011-03-12 19:17:32 +0000
commitc93e84048964194e5674e859d6bd8827010f09f6 (patch)
tree407ca23d232bf3f974550fce0175c49495ef49c0 /src/algebra
parent52fddea19454dc2b9bcb54c6edd5a4cd4f5765a9 (diff)
downloadopen-axiom-c93e84048964194e5674e859d6bd8827010f09f6.tar.gz
* src/algebra/: Systematically use negative? when comparing for
greater than 0.
Diffstat (limited to 'src/algebra')
-rw-r--r--src/algebra/aggcat.spad.pamphlet8
-rw-r--r--src/algebra/algext.spad.pamphlet2
-rw-r--r--src/algebra/algfunc.spad.pamphlet12
-rw-r--r--src/algebra/allfact.spad.pamphlet2
-rw-r--r--src/algebra/array1.spad.pamphlet4
-rw-r--r--src/algebra/bags.spad.pamphlet2
-rw-r--r--src/algebra/catdef.spad.pamphlet8
-rw-r--r--src/algebra/combfunc.spad.pamphlet2
-rw-r--r--src/algebra/complet.spad.pamphlet4
-rw-r--r--src/algebra/crfp.spad.pamphlet4
-rw-r--r--src/algebra/curve.spad.pamphlet2
-rw-r--r--src/algebra/ddfact.spad.pamphlet2
-rw-r--r--src/algebra/defaults.spad.pamphlet2
-rw-r--r--src/algebra/defintef.spad.pamphlet6
-rw-r--r--src/algebra/defintrf.spad.pamphlet5
-rw-r--r--src/algebra/divisor.spad.pamphlet2
-rw-r--r--src/algebra/dpolcat.spad.pamphlet2
-rw-r--r--src/algebra/efstruc.spad.pamphlet4
-rw-r--r--src/algebra/efuls.spad.pamphlet8
-rw-r--r--src/algebra/expexpan.spad.pamphlet4
-rw-r--r--src/algebra/f02.spad.pamphlet2
-rw-r--r--src/algebra/ffpoly2.spad.pamphlet2
-rw-r--r--src/algebra/float.spad.pamphlet26
-rw-r--r--src/algebra/formula.spad.pamphlet4
-rw-r--r--src/algebra/fparfrac.spad.pamphlet2
-rw-r--r--src/algebra/free.spad.pamphlet10
-rw-r--r--src/algebra/fs2expxp.spad.pamphlet6
-rw-r--r--src/algebra/fs2ups.spad.pamphlet8
-rw-r--r--src/algebra/galfact.spad.pamphlet4
-rw-r--r--src/algebra/gaussian.spad.pamphlet2
-rw-r--r--src/algebra/gdpoly.spad.pamphlet2
-rw-r--r--src/algebra/ghensel.spad.pamphlet4
-rw-r--r--src/algebra/gpol.spad.pamphlet2
-rw-r--r--src/algebra/interval.spad.pamphlet4
-rw-r--r--src/algebra/intfact.spad.pamphlet4
-rw-r--r--src/algebra/intrf.spad.pamphlet14
-rw-r--r--src/algebra/irexpand.spad.pamphlet2
-rw-r--r--src/algebra/laplace.spad.pamphlet2
-rw-r--r--src/algebra/laurent.spad.pamphlet4
-rw-r--r--src/algebra/listgcd.spad.pamphlet4
-rw-r--r--src/algebra/lodop.spad.pamphlet2
-rw-r--r--src/algebra/manip.spad.pamphlet2
-rw-r--r--src/algebra/matfuns.spad.pamphlet8
-rw-r--r--src/algebra/mathml.spad.pamphlet34
-rw-r--r--src/algebra/mfinfact.spad.pamphlet4
-rw-r--r--src/algebra/mkfunc.spad.pamphlet2
-rw-r--r--src/algebra/moddfact.spad.pamphlet12
-rw-r--r--src/algebra/modgcd.spad.pamphlet4
-rw-r--r--src/algebra/mring.spad.pamphlet2
-rw-r--r--src/algebra/mset.spad.pamphlet12
-rw-r--r--src/algebra/multfact.spad.pamphlet4
-rw-r--r--src/algebra/newpoly.spad.pamphlet2
-rw-r--r--src/algebra/numode.spad.pamphlet2
-rw-r--r--src/algebra/odealg.spad.pamphlet2
-rw-r--r--src/algebra/oderf.spad.pamphlet2
-rw-r--r--src/algebra/opalg.spad.pamphlet4
-rw-r--r--src/algebra/outform.spad.pamphlet2
-rw-r--r--src/algebra/pade.spad.pamphlet2
-rw-r--r--src/algebra/pattern.spad.pamphlet2
-rw-r--r--src/algebra/pdecomp.spad.pamphlet2
-rw-r--r--src/algebra/permgrps.spad.pamphlet16
-rw-r--r--src/algebra/pfbr.spad.pamphlet10
-rw-r--r--src/algebra/plot.spad.pamphlet2
-rw-r--r--src/algebra/plot3d.spad.pamphlet2
-rw-r--r--src/algebra/poly.spad.pamphlet6
-rw-r--r--src/algebra/polycat.spad.pamphlet8
-rw-r--r--src/algebra/primelt.spad.pamphlet2
-rw-r--r--src/algebra/prs.spad.pamphlet6
-rw-r--r--src/algebra/random.spad.pamphlet2
-rw-r--r--src/algebra/rdeef.spad.pamphlet10
-rw-r--r--src/algebra/rderf.spad.pamphlet4
-rw-r--r--src/algebra/rdesys.spad.pamphlet2
-rw-r--r--src/algebra/realzero.spad.pamphlet8
-rw-r--r--src/algebra/reclos.spad.pamphlet8
-rw-r--r--src/algebra/regset.spad.pamphlet2
-rw-r--r--src/algebra/riccati.spad.pamphlet2
-rw-r--r--src/algebra/seg.spad.pamphlet6
-rw-r--r--src/algebra/sf.spad.pamphlet2
-rw-r--r--src/algebra/sgcf.spad.pamphlet2
-rw-r--r--src/algebra/si.spad.pamphlet4
-rw-r--r--src/algebra/sign.spad.pamphlet2
-rw-r--r--src/algebra/solvedio.spad.pamphlet8
-rw-r--r--src/algebra/sregset.spad.pamphlet2
-rw-r--r--src/algebra/stream.spad.pamphlet8
-rw-r--r--src/algebra/sttaylor.spad.pamphlet2
-rw-r--r--src/algebra/sturm.spad.pamphlet4
-rw-r--r--src/algebra/syssolp.spad.pamphlet2
-rw-r--r--src/algebra/taylor.spad.pamphlet2
-rw-r--r--src/algebra/tex.spad.pamphlet12
-rw-r--r--src/algebra/tree.spad.pamphlet4
-rw-r--r--src/algebra/twofact.spad.pamphlet2
-rw-r--r--src/algebra/unifact.spad.pamphlet2
92 files changed, 228 insertions, 225 deletions
diff --git a/src/algebra/aggcat.spad.pamphlet b/src/algebra/aggcat.spad.pamphlet
index 8e9a0b23..e58fac69 100644
--- a/src/algebra/aggcat.spad.pamphlet
+++ b/src/algebra/aggcat.spad.pamphlet
@@ -1565,17 +1565,17 @@ UnaryRecursiveAggregate(S:Type): Category == RecursiveAggregate S with
less?(l, n) ==
i := n::Integer
- while i > 0 and not empty? l repeat (l := rest l; i := i - 1)
- i > 0
+ while positive? i and not empty? l repeat (l := rest l; i := i - 1)
+ positive? i
more?(l, n) ==
i := n::Integer
- while i > 0 and not empty? l repeat (l := rest l; i := i - 1)
+ while positive? i and not empty? l repeat (l := rest l; i := i - 1)
zero?(i) and not empty? l
size?(l, n) ==
i := n::Integer
- while not empty? l and i > 0 repeat (l := rest l; i := i - 1)
+ while not empty? l and positive? i repeat (l := rest l; i := i - 1)
empty? l and zero? i
#x ==
diff --git a/src/algebra/algext.spad.pamphlet b/src/algebra/algext.spad.pamphlet
index 01657494..b5e2d470 100644
--- a/src/algebra/algext.spad.pamphlet
+++ b/src/algebra/algext.spad.pamphlet
@@ -147,7 +147,7 @@ SimpleAlgebraicExtension(R:CommutativeRing,
i:Integer := k rem size()
p:Integer := size()$R
ans:$ := 0
- for j in 0.. while i > 0 repeat
+ for j in 0.. while positive? i repeat
h := i rem p
-- index(p) = 0$R
if h ~= 0 then
diff --git a/src/algebra/algfunc.spad.pamphlet b/src/algebra/algfunc.spad.pamphlet
index b32e1f56..bf4c4b71 100644
--- a/src/algebra/algfunc.spad.pamphlet
+++ b/src/algebra/algfunc.spad.pamphlet
@@ -222,25 +222,25 @@ AlgebraicallyClosedFunctionSpace(R: IntegralDomain):
zeroOf(p:$, x:Symbol) ==
n := numer(f := univariate(p, kernel(x)$Kernel($)))
- degree denom f > 0 => error "zeroOf: variable appears in denom"
+ positive? degree denom f => error "zeroOf: variable appears in denom"
degree n = 0 => error "zeroOf: constant expression"
zeroOf(n, x)
rootOf(p:$, x:Symbol) ==
n := numer(f := univariate(p, kernel(x)$Kernel($)))
- degree denom f > 0 => error "roofOf: variable appears in denom"
+ positive? degree denom f => error "roofOf: variable appears in denom"
degree n = 0 => error "rootOf: constant expression"
rootOf(n, x)
zerosOf(p:$, x:Symbol) ==
n := numer(f := univariate(p, kernel(x)$Kernel($)))
- degree denom f > 0 => error "zerosOf: variable appears in denom"
+ positive? degree denom f => error "zerosOf: variable appears in denom"
degree n = 0 => empty()
zerosOf(n, x)
rootsOf(p:$, x:Symbol) ==
n := numer(f := univariate(p, kernel(x)$Kernel($)))
- degree denom f > 0 => error "roofsOf: variable appears in denom"
+ positive? degree denom f => error "roofsOf: variable appears in denom"
degree n = 0 => empty()
rootsOf(n, x)
@@ -358,7 +358,7 @@ AlgebraicFunction(R, F): Exports == Implementation where
(r := retractIfCan(p)@Union(F, "failed")) case "failed" =>
inrootof(p, k::F)
n := numer(f := univariate(r::F, k))
- degree denom f > 0 => error "roofOf: variable appears in denom"
+ positive? degree denom f => error "roofOf: variable appears in denom"
inrootof(n, k::F)
dvalg(l, x) ==
@@ -368,7 +368,7 @@ AlgebraicFunction(R, F): Exports == Implementation where
ialg l ==
f := univariate(p := first l, retract(x := second l)@K)
- degree denom f > 0 => error "roofOf: variable appears in denom"
+ positive? degree denom f => error "roofOf: variable appears in denom"
inrootof(numer f, x)
operator op ==
diff --git a/src/algebra/allfact.spad.pamphlet b/src/algebra/allfact.spad.pamphlet
index c0b520d5..c45d662c 100644
--- a/src/algebra/allfact.spad.pamphlet
+++ b/src/algebra/allfact.spad.pamphlet
@@ -192,7 +192,7 @@ MPolyCatRationalFunctionFactorizer(E,OV,R,PRF) : C == T
---- push x back from the coefficient domain ----
pushuconst(r:F,x:OV):PRF ==
xs:SE:=convert x
- degree(denom r,xs)>0 => error "bad polynomial form"
+ positive? degree(denom r,xs) => error "bad polynomial form"
inv((denom r)::F)*pushucoef(univariate(numer r,xs),x)
diff --git a/src/algebra/array1.spad.pamphlet b/src/algebra/array1.spad.pamphlet
index 0a521e77..48ee917f 100644
--- a/src/algebra/array1.spad.pamphlet
+++ b/src/algebra/array1.spad.pamphlet
@@ -199,8 +199,8 @@ IndexedFlexibleArray(S:Type, mn: Integer): Exports == Implementation where
growAdding(r, b, s) ==
b = 0 => r
- #r > 0 => growAndFill(r, b, (r.f).0)
- #s > 0 => growAndFill(r, b, (s.f).0)
+ positive?(#r) => growAndFill(r, b, (r.f).0)
+ positive?(#s) => growAndFill(r, b, (s.f).0)
error "no default filler element"
growAndFill(r, b, x) ==
diff --git a/src/algebra/bags.spad.pamphlet b/src/algebra/bags.spad.pamphlet
index 69f6d509..38c5ab33 100644
--- a/src/algebra/bags.spad.pamphlet
+++ b/src/algebra/bags.spad.pamphlet
@@ -276,7 +276,7 @@ Heap(S:OrderedSet): Exports == Implementation where
-- Williams' insertion algorithm O(log n)
j := (#r) :: Integer
r:=concat!(r,concat(x,empty()$Rep))
- while j > 0 repeat
+ while positive? j repeat
i := (j-1) quo 2
if r(i) >= x then leave
r(j) := r(i)
diff --git a/src/algebra/catdef.spad.pamphlet b/src/algebra/catdef.spad.pamphlet
index 2b6ff9d2..26aa0469 100644
--- a/src/algebra/catdef.spad.pamphlet
+++ b/src/algebra/catdef.spad.pamphlet
@@ -90,7 +90,7 @@ AbelianGroup(): Category == Join(CancellationAbelianMonoid, LeftLinearSet Intege
if not (% has Ring) then
n:Integer * x:% ==
zero? n => 0
- n>0 => double(n pretend PositiveInteger,x)
+ positive? n => double(n pretend PositiveInteger,x)
double((-n) pretend PositiveInteger,-x)
@
@@ -1015,8 +1015,10 @@ GcdDomain(): Category == IntegralDomain with
c1:= content(p1); c2:= content(p2)
p1:= (p1 exquo c1)::SUP %
p2:= (p2 exquo c2)::SUP %
- if (e1:=minimumDegree p1) > 0 then p1:=(p1 exquo monomial(1,e1))::SUP %
- if (e2:=minimumDegree p2) > 0 then p2:=(p2 exquo monomial(1,e2))::SUP %
+ if positive?(e1:=minimumDegree p1) then
+ p1:=(p1 exquo monomial(1,e1))::SUP %
+ if positive?(e2:=minimumDegree p2) then
+ p2:=(p2 exquo monomial(1,e2))::SUP %
e1:=min(e1,e2); c1:=gcd(c1,c2)
p1:=
degree p1 = 0 or degree p2 = 0 => monomial(c1,0)
diff --git a/src/algebra/combfunc.spad.pamphlet b/src/algebra/combfunc.spad.pamphlet
index f1dc9583..d89697fd 100644
--- a/src/algebra/combfunc.spad.pamphlet
+++ b/src/algebra/combfunc.spad.pamphlet
@@ -518,7 +518,7 @@ dummy variable is introduced to make the indexing variable \lq local\rq.
if R has RetractableTo(Z) and F has Algebra(Fraction(Z)) then
iibinom l ==
(s:=retractIfCan(first l-second l)@Union(R,"failed")) case R and
- (t:=retractIfCan(s)@Union(Z,"failed")) case Z and t > 0 =>
+ (t:=retractIfCan(s)@Union(Z,"failed")) case Z and positive? t =>
ans:=1::F
for i in 1..t repeat
ans:=ans*(second l+i::R::F)
diff --git a/src/algebra/complet.spad.pamphlet b/src/algebra/complet.spad.pamphlet
index 5ac5d928..d6d6244d 100644
--- a/src/algebra/complet.spad.pamphlet
+++ b/src/algebra/complet.spad.pamphlet
@@ -79,7 +79,7 @@ OrderedCompletion(R:SetCategory): Exports == Implementation where
n:Integer * x:% ==
x case inf =>
- n > 0 => x
+ positive? n => x
negative? n => [not(x.inf)]
error "Undefined product"
[n * x.fin]
@@ -103,7 +103,7 @@ OrderedCompletion(R:SetCategory): Exports == Implementation where
characteristic == characteristic$R
fininf(b, r) ==
- r > 0 => [b]
+ positive? r => [b]
negative? r => [not b]
error "Undefined product"
diff --git a/src/algebra/crfp.spad.pamphlet b/src/algebra/crfp.spad.pamphlet
index 1ac1ba20..8bbd8ee9 100644
--- a/src/algebra/crfp.spad.pamphlet
+++ b/src/algebra/crfp.spad.pamphlet
@@ -306,7 +306,7 @@ ComplexRootFindingPackage(R, UP): public == private where
-- next we check if one of these centers is a root
centerIsRoot : Boolean := false
for i in 1..maxIndex lp repeat
- if (mD := minimumDegree lp.i) > 0 then
+ if positive? (mD := minimumDegree lp.i) then
pp : UP := monomial(1,1)-monomial(listOfCenters.i-u,0)
centerIsRoot := true
fp := fp * irreducibleFactor(pp,mD)
@@ -418,7 +418,7 @@ ComplexRootFindingPackage(R, UP): public == private where
divisorCascade(p, tp, info) ==
lfae : L FAE := nil()
- for i in 1..degree tp while (degree tp > 0) repeat
+ for i in 1..degree tp while positive? degree tp repeat
-- USE monicDivide !!!
qr : Record(quotient: UP, remainder: UP) := divide(p,tp)
factor1 : UP := tp
diff --git a/src/algebra/curve.spad.pamphlet b/src/algebra/curve.spad.pamphlet
index 57fd38d3..d69d6bfe 100644
--- a/src/algebra/curve.spad.pamphlet
+++ b/src/algebra/curve.spad.pamphlet
@@ -305,7 +305,7 @@ FunctionFieldCategory(F, UP, UPUP): Category == Definition where
infValue f ==
zero? f => 0
- (n := infOrder f) > 0 => 0
+ positive?(n := infOrder f) => 0
zero? n =>
(leadingCoefficient numer f) / (leadingCoefficient denom f)
error "f not locally integral at infinity"
diff --git a/src/algebra/ddfact.spad.pamphlet b/src/algebra/ddfact.spad.pamphlet
index 46ef51c6..2fbc0ca5 100644
--- a/src/algebra/ddfact.spad.pamphlet
+++ b/src/algebra/ddfact.spad.pamphlet
@@ -225,7 +225,7 @@ DistinctDegreeFactorize(F,FP): C == T
if (lcm := leadingCoefficient m) ~=1 then m := (inv lcm)*m
--is x**d factor of m?
- if (d := minimumDegree m)>0 then
+ if positive?(d := minimumDegree m) then
m := (monicDivide (m,monomial(1,d))).quotient
factlist := [[monomial(1,1),d]$ParFact]
d:=degree m
diff --git a/src/algebra/defaults.spad.pamphlet b/src/algebra/defaults.spad.pamphlet
index 8de63814..e5e47e40 100644
--- a/src/algebra/defaults.spad.pamphlet
+++ b/src/algebra/defaults.spad.pamphlet
@@ -160,7 +160,7 @@ FiniteLinearAggregateSort(S, V): Exports == Implementation where
g := 1
while g <= (n-m) repeat g := 3*g+1
g := g quo 3
- while g > 0 repeat
+ while positive? g repeat
for i in m+g..n repeat
j := i-g
while j >= m and l(qelt(r, j+g), qelt(r, j)) repeat
diff --git a/src/algebra/defintef.spad.pamphlet b/src/algebra/defintef.spad.pamphlet
index 0253ac93..34eb5e03 100644
--- a/src/algebra/defintef.spad.pamphlet
+++ b/src/algebra/defintef.spad.pamphlet
@@ -118,7 +118,7 @@ ElementaryFunctionDefiniteIntegration(R, F): Exports == Implementation where
-- returns true if a > b, false if a < b, "failed" if can't decide
moreThan(a, b) ==
(r := retractIfCan(a)@Union(F, "failed")) case "failed" => -- infinite
- whatInfinity(a) > 0
+ positive? whatInfinity(a)
(u := retractIfCan(r::F)@Union(Fraction Z, "failed")) case "failed" =>
"failed"
u::Fraction(Z) > b
@@ -171,11 +171,11 @@ ElementaryFunctionDefiniteIntegration(R, F): Exports == Implementation where
z :=
(r := retractIfCan(a)@Union(F, "failed")) case "failed" => sign(f, x, a)
sign(f, x, r::F, "right")
- (b1 := z case Z) and z::Z > 0 => true
+ (b1 := z case Z) and positive?(z::Z) => true
z :=
(r := retractIfCan(b)@Union(F, "failed")) case "failed" => sign(f, x, b)
sign(f, x, r::F, "left")
- (b2 := z case Z) and z::Z > 0 => true
+ (b2 := z case Z) and positive?(z::Z) => true
b1 and b2 =>
((w := checkFor0(numer f, k, a, b)) case "failed") or (w::B) => "failed"
false
diff --git a/src/algebra/defintrf.spad.pamphlet b/src/algebra/defintrf.spad.pamphlet
index f86baafa..9122f812 100644
--- a/src/algebra/defintrf.spad.pamphlet
+++ b/src/algebra/defintrf.spad.pamphlet
@@ -181,7 +181,8 @@ DefiniteIntegrationTools(R, F): Exports == Implementation where
i case halfinf =>
empty?(l := realZeros p) => empty()
bounds:REC :=
- i.halfinf.dir > 0 => [i.halfinf.endpoint, "max"/[t.right for t in l]]
+ positive?(i.halfinf.dir) =>
+ [i.halfinf.endpoint, "max"/[t.right for t in l]]
["min"/[t.left for t in l], i.halfinf.endpoint]
l := [u::REC for t in l | (u := refine(p, t, bounds)) case REC]
incl? => l
@@ -227,7 +228,7 @@ DefiniteIntegrationTools(R, F): Exports == Implementation where
(ea := infeval(p, a)) case "failed" => "failed"
(eb := infeval(p, b)) case "failed" => "failed"
(s := sign(ea::F * eb::F)) case "failed" => "failed"
- s::Z > 0
+ positive?(s::Z)
-- returns true if p has a positive root. Include 0 is incl0? is true
posRoot(p, incl0?) ==
diff --git a/src/algebra/divisor.spad.pamphlet b/src/algebra/divisor.spad.pamphlet
index 4dc651e8..42056811 100644
--- a/src/algebra/divisor.spad.pamphlet
+++ b/src/algebra/divisor.spad.pamphlet
@@ -349,7 +349,7 @@ ModularHermitianRowReduction(R): Exports == Implementation where
normalizedDivide(n:R, d:R):Record(quotient:R, remainder:R) ==
qr := divide(n, d)
qr.remainder >= 0 => qr
- d > 0 =>
+ positive? d =>
qr.remainder := qr.remainder + d
qr.quotient := qr.quotient - 1
qr
diff --git a/src/algebra/dpolcat.spad.pamphlet b/src/algebra/dpolcat.spad.pamphlet
index 1ec8f105..64ca21c2 100644
--- a/src/algebra/dpolcat.spad.pamphlet
+++ b/src/algebra/dpolcat.spad.pamphlet
@@ -330,7 +330,7 @@ DifferentialPolynomialCategory(R:Ring,S:OrderedSet,
"max"/[order v for v in variables p]
order (p:$,s:S):NonNegativeInteger ==
ground? p => 0
- empty? (vv:= [order v for v in variables p | (variable v) = s ]) =>0
+ empty? (vv:= [order v for v in variables p | (variable v) = s ]) => 0
"max"/vv
degree (p, s) ==
diff --git a/src/algebra/efstruc.spad.pamphlet b/src/algebra/efstruc.spad.pamphlet
index 414217a8..7f9829db 100644
--- a/src/algebra/efstruc.spad.pamphlet
+++ b/src/algebra/efstruc.spad.pamphlet
@@ -481,11 +481,11 @@ ElementaryFunctionStructurePackage(R,F): Exports == Implementation where
factdeprel(l, k) ==
((r := retractIfCan(n := first argument k)@Union(Z, "failed"))
- case Z) and (r::Z > 0) => [factorial(r::Z)::F]
+ case Z) and positive?(r::Z) => [factorial(r::Z)::F]
for x in l repeat
m := first argument x
((r := retractIfCan(n - m)@Union(Z, "failed")) case Z) and
- (r::Z > 0) => return([*/[(m + i::F) for i in 1..r] * x::F])
+ positive?(r::Z) => return([*/[(m + i::F) for i in 1..r] * x::F])
[true]
else
diff --git a/src/algebra/efuls.spad.pamphlet b/src/algebra/efuls.spad.pamphlet
index 728522ce..b20867e0 100644
--- a/src/algebra/efuls.spad.pamphlet
+++ b/src/algebra/efuls.spad.pamphlet
@@ -220,7 +220,7 @@ ElementaryFunctionsUnivariateLaurentSeries(Coef,UTS,ULS):_
lc := coefficient(uls,ord)
(rat := retractIfCan(lc)@Union(RN,"failed")) case "failed" =>
(1/2) * pi()
- (rat :: RN) > 0 => (1/2) * pi()
+ positive?(rat :: RN) => (1/2) * pi()
(-1/2) * pi()
(1/2) * pi()
return "failed"
@@ -238,7 +238,7 @@ ElementaryFunctionsUnivariateLaurentSeries(Coef,UTS,ULS):_
RATS =>
lc := coefficient(uls,ord)
(rat := retractIfCan(lc)@Union(RN,"failed")) case "failed" => 0
- (rat :: RN) > 0 => 0
+ positive?(rat :: RN) => 0
TRANSFCN => pi()
return "failed"
0
@@ -321,7 +321,7 @@ ElementaryFunctionsUnivariateLaurentSeries(Coef,UTS,ULS):_
lc := coefficient(uls,ord)
(rat := retractIfCan(lc)@Union(RN,"failed")) case "failed" =>
(1/2) * pi()
- (rat :: RN) > 0 => (1/2) * pi()
+ positive?(rat :: RN) => (1/2) * pi()
(-1/2) * pi()
(1/2) * pi()
error "atan: series expansion involves transcendental constants"
@@ -342,7 +342,7 @@ ElementaryFunctionsUnivariateLaurentSeries(Coef,UTS,ULS):_
RATS =>
lc := coefficient(uls,ord)
(rat := retractIfCan(lc)@Union(RN,"failed")) case "failed" => 0
- (rat :: RN) > 0 => 0
+ positive?(rat :: RN) => 0
TRANSFCN => pi()
error "acot: series expansion involves transcendental constants"
0
diff --git a/src/algebra/expexpan.spad.pamphlet b/src/algebra/expexpan.spad.pamphlet
index 0166357c..332e8ca9 100644
--- a/src/algebra/expexpan.spad.pamphlet
+++ b/src/algebra/expexpan.spad.pamphlet
@@ -342,7 +342,7 @@ UnivariatePuiseuxSeriesWithExponentialSingularity(R,FE,var,cen):_
domTerm := termInfo.%term
(type := termInfo.%type) = "series" =>
-- find limit of series term
- (ord := order(pSeries := coeff domTerm,1)) > 0 => 0
+ positive?(ord := order(pSeries := coeff domTerm,1)) => 0
coef := coefficient(pSeries,ord)
member?(var,variables coef) => "failed"
ord = 0 => coef :: OFE
@@ -447,7 +447,7 @@ ExponentialExpansion(R,FE,var,cen): Exports == Implementation where
seriesQuotientLimit(num,den) ==
-- limit of the quotient of two series
series := num / den
- (ord := order(series,1)) > 0 => 0
+ positive?(ord := order(series,1)) => 0
coef := coefficient(series,ord)
member?(var,variables coef) => "failed"
ord = 0 => coef :: OFE
diff --git a/src/algebra/f02.spad.pamphlet b/src/algebra/f02.spad.pamphlet
index 81f1df5e..3a9be77d 100644
--- a/src/algebra/f02.spad.pamphlet
+++ b/src/algebra/f02.spad.pamphlet
@@ -489,7 +489,7 @@ NagEigenPackage(): Exports == Implementation where
zero? ncolbArg and not wantqArg and not wantpArg => 2*tem
zero? ncolbArg and wantpArg and not wantqArg => 3*tem
not wantpArg =>
- ncolbArg >0 or wantqArg => 3*tem
+ positive? ncolbArg or wantqArg => 3*tem
5*tem
cLen : Integer :=
mArg >= nArg =>
diff --git a/src/algebra/ffpoly2.spad.pamphlet b/src/algebra/ffpoly2.spad.pamphlet
index 2e2796c5..76c5780f 100644
--- a/src/algebra/ffpoly2.spad.pamphlet
+++ b/src/algebra/ffpoly2.spad.pamphlet
@@ -101,7 +101,7 @@ FiniteFieldPolynomialPackage2(F,GF):Exports == Implementation where
beta:=Frobenius(beta)
trModp:=trModp +$(SUP F) beta *$(SUP F) map(coerce,qexp.i)$SUPF2
-- if it is of degree 0, it doesn't help us finding a root
- if degree(trModp)$(SUP F) > 0 then
+ if positive? degree(trModp)$(SUP F) then
-- for all elements gf of GF do
for j in 1..sizeGF repeat
-- compute gcd(trace(beta * x) + gf,stillToFactor)
diff --git a/src/algebra/float.spad.pamphlet b/src/algebra/float.spad.pamphlet
index e3e0b5a9..917d4490 100644
--- a/src/algebra/float.spad.pamphlet
+++ b/src/algebra/float.spad.pamphlet
@@ -274,7 +274,7 @@ Float():
atan(x,y) ==
x = 0 =>
- y > 0 => pi()/2
+ positive? y => pi()/2
negative? y => -pi()/2
0
-- Only count on first quadrant being on principal branch.
@@ -338,7 +338,7 @@ Float():
-- the running time is O( sqrt p M(p) ) assuming |x| < 1
k := ISQRT (bits()-100)::I quo 4
k := max(0,2 + k + order x)
- if k > 0 then (inc k; x := x / 3**k::N)
+ if positive? k then (inc k; x := x / 3**k::N)
r := sinSeries x
for i in 1..k repeat r := itimes(3,r)-shift(r**3,2)
bits p
@@ -373,7 +373,7 @@ Float():
-- need to increase precision by more than k, otherwise recursion
-- causes loss of accuracy.
-- Michael Monagan suggests adding a factor of log(k)
- if k > 0 then (inc(k+length(k)**2); x := shift(x,-k))
+ if positive? k then (inc(k+length(k)**2); x := shift(x,-k))
r := cosSeries x
for i in 1..k repeat r := shift(r*r,1)-1
bits p
@@ -543,9 +543,9 @@ Float():
-- results in an overall running time of O( sqrt p M(p) )
k := ISQRT (p-100)::I quo 3
k := max(0,2 + k + order x)
- if k > 0 then (inc k; x := shift(x,-k))
+ if positive? k then (inc k; x := shift(x,-k))
e := expSeries x
- if k > 0 then e := square(e,k)
+ if positive? k then e := square(e,k)
bits p
e * e1
@@ -609,7 +609,7 @@ Float():
chop(x,p) ==
e : I := LENGTH x.mantissa - p
- if e > 0 then x := [shift2(x.mantissa,-e),x.exponent+e]
+ if positive? e then x := [shift2(x.mantissa,-e),x.exponent+e]
x
float(m,e) == normalize [m,e]
float(m,e,b) ==
@@ -620,10 +620,10 @@ Float():
m := x.mantissa
m = 0 => 0
e : I := LENGTH m - bits()
- if e > 0 then
+ if positive? e then
y := shift2(m,1-e)
if odd? y then
- y := (if y>0 then y+1 else y-1) quo 2
+ y := (if positive? y then y+1 else y-1) quo 2
if LENGTH y > bits() then
y := y quo 2
e := e+1
@@ -636,7 +636,7 @@ Float():
order x = order y and sign x = sign y and zero? (x - y)
x < y ==
y.mantissa = 0 => negative? x.mantissa
- x.mantissa = 0 => y.mantissa > 0
+ x.mantissa = 0 => positive? y.mantissa
negative? x and positive? y => true
negative? y and positive? x => false
order x < order y => positive? x
@@ -794,13 +794,13 @@ Float():
chop10(x,p) ==
e : I := floorLength10 x.mantissa - p
- if e > 0 then x := [x.mantissa quo 10**e::N,x.exponent+e]
+ if positive? e then x := [x.mantissa quo 10**e::N,x.exponent+e]
x
normalize10(x,p) ==
ma := x.mantissa
ex := x.exponent
e : I := length10 ma - p
- if e > 0 then
+ if positive? e then
ma := ma quo 10**(e-1)::N
ex := ex + e
(ma,r) := divide(ma, 10)
@@ -926,7 +926,7 @@ Float():
s := convert(m)@S; n := #s; o := n + e
-- Note: at least one digit is displayed after the decimal point
-- and trailing zeroes after the decimal point are dropped
- if o > 0 and o <= max(n,d) then
+ if positive? o and o <= max(n,d) then
-- fixed format: add trailing zeroes before the decimal point
if o > n then s := concat(s, new((o-n)::N,zero))
t := rightTrim(s(o + minIndex s .. n + minIndex s - 1), zero)
@@ -960,7 +960,7 @@ Float():
OUTMODE() = "floating" => floating f
OUTMODE() = "general" => general f
empty()$String
- if b > 0 then bits(b::PositiveInteger)
+ if positive? b then bits(b::PositiveInteger)
s = empty()$String => error "bad output mode"
s
diff --git a/src/algebra/formula.spad.pamphlet b/src/algebra/formula.spad.pamphlet
index 19011081..750bf710 100644
--- a/src/algebra/formula.spad.pamphlet
+++ b/src/algebra/formula.spad.pamphlet
@@ -231,7 +231,7 @@ ScriptFormulaFormat(): public == private where
lss > len => l := concat(ss,l)$List(S)
ls := ls + lss + 1
s := concat(s,concat(ss," ")$S)$S
- if ls > 0 then l := concat(s,l)$List(S)
+ if positive? ls then l := concat(s,l)$List(S)
reverse l
group str ==
@@ -403,7 +403,7 @@ ScriptFormulaFormat(): public == private where
%integer?(expr)$Foreign(Builtin) =>
i := expr : Integer
if negative? i or (i > 9) then group str else str
- (i := position(str,specialStrings)) > 0 =>
+ positive?(i := position(str,specialStrings)) =>
specialStringsInFormula.i
str
l : L E := (expr pretend L E)
diff --git a/src/algebra/fparfrac.spad.pamphlet b/src/algebra/fparfrac.spad.pamphlet
index b769ba05..f6495e21 100644
--- a/src/algebra/fparfrac.spad.pamphlet
+++ b/src/algebra/fparfrac.spad.pamphlet
@@ -141,7 +141,7 @@ FullPartialFractionExpansion(F, UP): Exports == Implementation where
lvar := concat(makeVariable(u, m), lvar)
lval := concat(inv((m+1)::F) * q, lval)
qq := q0 quo gcd(pp, q0) -- new center
- if (degree(qq) > 0) then
+ if positive? degree(qq) then
ans := concat([(n + 1 - m)::N, qq, (pp * bm * cn * cm) rem qq], ans)
cm := (c * cm) rem q0 -- cm = c**m modulo q now
um := u1 * um -- um = u**m now
diff --git a/src/algebra/free.spad.pamphlet b/src/algebra/free.spad.pamphlet
index f87666b0..34d06a9a 100644
--- a/src/algebra/free.spad.pamphlet
+++ b/src/algebra/free.spad.pamphlet
@@ -344,7 +344,7 @@ FreeMonoid(S: SetCategory): FreeMonoidCategory(S) == FMdefinition where
lb := listOfMonoms b
na: Integer := #la
nb: Integer := #lb
- while na > 0 and nb > 0 repeat
+ while positive? na and positive? nb repeat
la.first.gen > lb.first.gen => return false
la.first.gen < lb.first.gen => return true
if la.first.exp = lb.first.exp then
@@ -504,8 +504,8 @@ InnerFreeAbelianMonoid(S: SetCategory, E:CancellationAbelianMonoid, un:E):
if E has OrderedAbelianMonoid then
highCommonTerms(f, g) ==
- makeMulti [[x.gen, min(x.exp, n)] for x in listOfMonoms f |
- (n := coefficient(x.gen, g)) > 0]
+ makeMulti [[x.gen, min(x.exp, n)] for x in listOfMonoms f
+ | positive?(n := coefficient(x.gen, g))]
@
\section{domain FAMONOID FreeAbelianMonoid}
@@ -555,12 +555,12 @@ FreeAbelianGroup(S:SetCategory): Exports == Implementation where
a < b ==
zero? a =>
zero? b => false
- (inmax terms b).exp > 0
+ positive?((inmax terms b).exp)
ta := inmax terms a
zero? b => negative? ta.exp
ta := inmax terms a
tb := inmax terms b
- ta.gen < tb.gen => tb.exp > 0
+ ta.gen < tb.gen => positive? tb.exp
ta.gen > tb.gen => negative? ta.exp
ta.exp < tb.exp => true
ta.exp > tb.exp => false
diff --git a/src/algebra/fs2expxp.spad.pamphlet b/src/algebra/fs2expxp.spad.pamphlet
index 15b46ca9..4b549c83 100644
--- a/src/algebra/fs2expxp.spad.pamphlet
+++ b/src/algebra/fs2expxp.spad.pamphlet
@@ -236,7 +236,7 @@ FunctionSpaceToExponentialExpansion(R,FE,x,cen):_
-- converts an integral power to an exponential expansion
(b := iExprToXXP(fcn,posCheck?)) case %problem => b
xxp := b.%expansion
- n > 0 => [xxp ** n]
+ positive? n => [xxp ** n]
-- a Puiseux series will be reciprocated only if n < 0 and
-- numerator of 'xxp' has exactly one monomial
numberOfMonomials(num := numer xxp) > 1 => [xxp ** n]
@@ -345,7 +345,7 @@ FunctionSpaceToExponentialExpansion(R,FE,x,cen):_
negative?(deg := order(ups,1)) =>
-- this "can't happen"
error "exp of function with sigularity"
- deg > 0 => [exp(ups)]
+ positive? deg => [exp(ups)]
lc := coefficient(ups,0); varOpList := opsInvolvingX lc
not opInOpList?("log" :: Symbol,varOpList) => [exp(ups)]
-- try to fix exp(lc) if necessary
@@ -425,7 +425,7 @@ FunctionSpaceToExponentialExpansion(R,FE,x,cen):_
upxs := f :: UPXS
negative? (deg := order(upxs,1)) =>
stateProblem(fcnName,"essential singularity")
- deg > 0 => [fcn(upxs) :: UPXS :: XXP]
+ positive? deg => [fcn(upxs) :: UPXS :: XXP]
lc := coefficient(upxs,0); xOpList := opsInvolvingX lc
null xOpList => [fcn(upxs) :: UPXS :: XXP]
opInOpList?("log" :: SY,xOpList) =>
diff --git a/src/algebra/fs2ups.spad.pamphlet b/src/algebra/fs2ups.spad.pamphlet
index 6014ae65..1fd0835e 100644
--- a/src/algebra/fs2ups.spad.pamphlet
+++ b/src/algebra/fs2ups.spad.pamphlet
@@ -273,7 +273,7 @@ FunctionSpaceToUnivariatePowerSeries(R,FE,Expon,UPS,TRAN,x):_
powerToUPS(fcn,n,posCheck?,atanFlag) ==
-- converts an integral power to a power series
(b := exprToUPS(fcn,posCheck?,atanFlag)) case %problem => b
- n > 0 => [(b.%series) ** n]
+ positive? n => [(b.%series) ** n]
-- check lowest order coefficient when n < 0
ups := b.%series; deg := degree ups
if (coef := coefficient(ups,deg)) = 0 then
@@ -545,7 +545,7 @@ FunctionSpaceToUnivariatePowerSeries(R,FE,Expon,UPS,TRAN,x):_
-- (b) the lowest order coefficient is a product of exponentials
-- and functions not involving x
(b := exprToGenUPS(fcn,posCheck?,atanFlag)) case %problem => b
- n > 0 => [(b.%series) ** n]
+ positive? n => [(b.%series) ** n]
-- check lowest order coefficient when n < 0
ups := b.%series; deg := degree ups
if (coef := coefficient(ups,deg)) = 0 then
@@ -636,7 +636,7 @@ FunctionSpaceToUnivariatePowerSeries(R,FE,Expon,UPS,TRAN,x):_
-- a power series.
negative?(deg := order(ups,1)) =>
stateProblem("exp","essential singularity")
- deg > 0 => [exp ups]
+ positive? deg => [exp ups]
lc := coefficient(ups,0); xOpList := opsInvolvingX lc
not opInOpList?("log" :: SY,xOpList) => [exp ups]
-- try to fix exp(lc) if necessary
@@ -698,7 +698,7 @@ FunctionSpaceToUnivariatePowerSeries(R,FE,Expon,UPS,TRAN,x):_
ups := series.%series
negative?(deg := order(ups,1)) =>
stateProblem(fcnName,"essential singularity")
- deg > 0 => [fcn(ups) :: UPS]
+ positive? deg => [fcn(ups) :: UPS]
lc := coefficient(ups,0); xOpList := opsInvolvingX lc
null xOpList => [fcn(ups) :: UPS]
opInOpList?("log" :: SY,xOpList) =>
diff --git a/src/algebra/galfact.spad.pamphlet b/src/algebra/galfact.spad.pamphlet
index 56778a4f..43d4e9cb 100644
--- a/src/algebra/galfact.spad.pamphlet
+++ b/src/algebra/galfact.spad.pamphlet
@@ -602,7 +602,7 @@ GaloisGroupFactorizer(UP): Exports == Implementation where
f := -f
-- is x**d factor of f
- if (d := minimumDegree f) > 0 then
+ if positive?(d := minimumDegree f) then
f := monicDivide(f,monomial(1,d)).quotient
factorlist := [[monomial(1,1),d]$ParFact]
@@ -672,7 +672,7 @@ GaloisGroupFactorizer(UP): Exports == Implementation where
f := -f
-- is x**d factor of f
- if (maxd := minimumDegree f) > 0 then
+ if positive?(maxd := minimumDegree f) then
f := monicDivide(f,monomial(1,maxd)).quotient
factorlist := [[monomial(1,1),maxd]$ParFact]
r := max(2,r-maxd)::N
diff --git a/src/algebra/gaussian.spad.pamphlet b/src/algebra/gaussian.spad.pamphlet
index d32a353a..d8ac1583 100644
--- a/src/algebra/gaussian.spad.pamphlet
+++ b/src/algebra/gaussian.spad.pamphlet
@@ -109,7 +109,7 @@ ComplexCategory(R:CommutativeRing): Category ==
factorSquareFreePolynomial pp ==
pnorm:=normPolynomial pp
k:R:=0
- while degree gcd(pnorm,differentiate pnorm)>0 repeat
+ while positive? degree gcd(pnorm,differentiate pnorm) repeat
k:=k+1
pnorm:=normPolynomial
elt(pp,monomial(1,1)-monomial(complex(0,k),0))
diff --git a/src/algebra/gdpoly.spad.pamphlet b/src/algebra/gdpoly.spad.pamphlet
index 59004a5b..b169c548 100644
--- a/src/algebra/gdpoly.spad.pamphlet
+++ b/src/algebra/gdpoly.spad.pamphlet
@@ -74,7 +74,7 @@ GeneralDistributedMultivariatePolynomial(vl,R,E): public == private where
zero?(p) => "failed"
for v in vl repeat
vv := variable(v)::OV
- if degree(p,vv)>0 then return vv
+ if positive? degree(p,vv) then return vv
"failed"
ground?(p) == mainVariable(p) case "failed"
diff --git a/src/algebra/ghensel.spad.pamphlet b/src/algebra/ghensel.spad.pamphlet
index b5a1c513..baf7e85c 100644
--- a/src/algebra/ghensel.spad.pamphlet
+++ b/src/algebra/ghensel.spad.pamphlet
@@ -127,7 +127,7 @@ GeneralHenselPackage(RP,TP):C == T where
dfn :NonNegativeInteger := nm
lcm1 := leadingCoefficient m
mm := lcm1*m
- while dfn>0 and (factlist := genFact(fln,factlist))~=[] repeat
+ while positive? dfn and (factlist := genFact(fln,factlist))~=[] repeat
auxfl := []
while factlist~=[] repeat
auxl := factlist.first
@@ -153,7 +153,7 @@ GeneralHenselPackage(RP,TP):C == T where
factlist := [term for term in factlist | not member?(poly,term)]
fln := aux
factlist := auxfl
- if dfn > 0 then finallist := cons(m,finallist)
+ if positive? dfn then finallist := cons(m,finallist)
finallist
@
diff --git a/src/algebra/gpol.spad.pamphlet b/src/algebra/gpol.spad.pamphlet
index ff4b05e1..9cbcfd1b 100644
--- a/src/algebra/gpol.spad.pamphlet
+++ b/src/algebra/gpol.spad.pamphlet
@@ -119,7 +119,7 @@ LaurentPolynomial(R, UP): Exports == Implementation where
p + q ==
zero? q => p
zero? p => q
- (d := order p - order q) > 0 =>
+ positive?(d := order p - order q) =>
gpol(poly(p) * monomial(1, d::N) + poly q, order q)
negative? d => gpol(poly(p) + poly(q) * monomial(1, (-d)::N), order p)
mkgpol(order p, poly(p) + poly q)
diff --git a/src/algebra/interval.spad.pamphlet b/src/algebra/interval.spad.pamphlet
index 7fbd9fe8..94eea0f5 100644
--- a/src/algebra/interval.spad.pamphlet
+++ b/src/algebra/interval.spad.pamphlet
@@ -128,7 +128,7 @@ Interval(R:Join(FloatingPointSystem,TranscendentalFunctionCategory)): IntervalCa
contains?(u:%,f:R):Boolean == (f > inf(u)) and (f < sup(u))
- positive?(u:%):Boolean == inf(u) > 0
+ positive?(u:%):Boolean == positive? inf(u)
negative?(u:%):Boolean == negative? sup(u)
a:% < b:% ==
@@ -161,7 +161,7 @@ Interval(R:Join(FloatingPointSystem,TranscendentalFunctionCategory)): IntervalCa
a:Integer * b:% ==
- if (a > 0) then
+ if positive? a then
qinterval(a*inf(b),a*sup(b))
else if negative? a then
qinterval(a*sup(b),a*inf(b))
diff --git a/src/algebra/intfact.spad.pamphlet b/src/algebra/intfact.spad.pamphlet
index f8655319..4c4be09d 100644
--- a/src/algebra/intfact.spad.pamphlet
+++ b/src/algebra/intfact.spad.pamphlet
@@ -299,7 +299,7 @@ IntegerRoots(I:IntegerNumberSystem): Exports == Implementation where
z:I := 1
n1:= (n-1)::NNI
x: I
- while z > 0 repeat
+ while positive? z repeat
x := y
xn:= x**n1
y := (n1*x*xn+a) quo (n*xn)
@@ -459,7 +459,7 @@ IntegerFactorizationPackage(I): Exports == Implementation where
return makeFR(1, ls)
m : Integer
for m in 0.. while zero?(n rem d) repeat n := n quo d
- if m>0 then ls := concat!(ls, ["prime",d,convert m]$FFE)
+ if positive? m then ls := concat!(ls, ["prime",d,convert m]$FFE)
d := d+s
BasicMethod n ==
diff --git a/src/algebra/intrf.spad.pamphlet b/src/algebra/intrf.spad.pamphlet
index d4e2b859..79e22b48 100644
--- a/src/algebra/intrf.spad.pamphlet
+++ b/src/algebra/intrf.spad.pamphlet
@@ -70,7 +70,7 @@ SubResultantPackage(R, UP): Exports == Implementation where
-- Hum it seems that Lionel returns [] when min(|p1|,|p2|) = 0
zero?(degree(p1)) =>
res.degree(p2) := p2
- if degree(p2) > 0
+ if positive? degree(p2)
then
res.((degree(p2)-1)::NonNegativeInteger) := p1
res.0 := (leadingCoefficient(p1)**(degree p2)) :: UP
@@ -79,7 +79,7 @@ SubResultantPackage(R, UP): Exports == Implementation where
res.0 := 1
res
zero?(degree(p2)) =>
- if degree(p1) > 0
+ if positive? degree(p1)
then
res.((degree(p1)-1)::NonNegativeInteger) := p2
res.0 := (leadingCoefficient(p2)**(degree p1)) :: UP
@@ -264,7 +264,7 @@ TranscendentalHermiteIntegration(F, UP): Exports == Implementation where
p:UP := 0
mult:UP := 1
qhat := (q exquo (g0 := g := gcd(q, differentiate q)))::UP
- while(degree(qbar := g) > 0) repeat
+ while positive? degree(qbar := g) repeat
qbarhat := (qbar exquo (g := gcd(qbar, differentiate qbar)))::UP
qtil:= - ((qhat * (derivation qbar)) exquo qbar)::UP
bc :=
@@ -457,7 +457,7 @@ TranscendentalIntegration(F, UP): Exports == Implementation where
error "monomIntPoly: monomial must have degree 2 or more"
l := leadingCoefficient dt
ans:UP := 0
- while (n := 1 + degree(p)::Z - d) > 0 repeat
+ while positive?(n := 1 + degree(p)::Z - d) repeat
ans := ans + (term := monomial(leadingCoefficient(p) / (n * l), n::N))
p := p - derivation term -- degree(p) must drop here
[ans, p]
@@ -598,7 +598,7 @@ TranscendentalIntegration(F, UP): Exports == Implementation where
explimintfrac(f, derivation, lu) ==
zero? f => [0, empty()]
degree numer f >= degree denom f => error "Not a proper fraction"
- order(denom f, monomial(1,1)) > 0 => error "Not integral at t = 0"
+ positive? order(denom f, monomial(1,1)) => error "Not integral at t = 0"
r := HermiteIntegrate(f, derivation)
zero?(r.logpart) => [r.answer, empty()]
eta' := coefficient(derivation monomial(1, 1), 1)
@@ -669,7 +669,7 @@ TranscendentalIntegration(F, UP): Exports == Implementation where
gqr.remainder / (denom g))) case "failed" => "failed"
zero?(gqr.remainder) =>
-- the following FAIL cannot occur if the primitives are all logs
- degree(gqr.quotient) > 0 => FAIL
+ positive? degree(gqr.quotient) => FAIL
(u3 := primintegratepoly(fqr.quotient, extendedint,
retract derivation monomial(1, 1))) case UPUP => "failed"
[u1.ratpart + u3.answer::RF, u3.a0]
@@ -701,7 +701,7 @@ TranscendentalIntegration(F, UP): Exports == Implementation where
primintegratepoly(p, extendedint, t') ==
zero? p => [0, 0$F]
ans:UP := 0
- while (d := degree p) > 0 repeat
+ while positive?(d := degree p) repeat
(ans1 := extendedint leadingCoefficient p) case "failed" =>
return([ans, p])
p := reductum p - monomial(d * t' * ans1.ratpart, (d - 1)::N)
diff --git a/src/algebra/irexpand.spad.pamphlet b/src/algebra/irexpand.spad.pamphlet
index 1441447a..6661642a 100644
--- a/src/algebra/irexpand.spad.pamphlet
+++ b/src/algebra/irexpand.spad.pamphlet
@@ -110,7 +110,7 @@ IntegrationResultToFunction(R, F): Exports == Implementation where
sqrn := s.ans1 * rootSimp sqrt(-s.ans2)
nn := lgp + d * sqrn * ilog(e, f * sqrn,
setUnion(setUnion(kernels a, kernels b), kernels p0))
- sqr.sgn > 0 => [pp]
+ positive? sqr.sgn => [pp]
negative? sqr.sgn => [nn]
[pp, nn]
diff --git a/src/algebra/laplace.spad.pamphlet b/src/algebra/laplace.spad.pamphlet
index e961658a..9bbabadb 100644
--- a/src/algebra/laplace.spad.pamphlet
+++ b/src/algebra/laplace.spad.pamphlet
@@ -97,7 +97,7 @@ LaplaceTransform(R, F): Exports == Implementation where
atn(f, t) ==
if ((v := isExpt f) case Record(var:K, exponent:Integer)) then
w := v::Record(var:K, exponent:Integer)
- (w.exponent > 0) and
+ positive?(w.exponent) and
((vv := symbolIfCan(w.var)) case SE) and (vv::SE = t) =>
return [1, w.exponent::PI]
(u := isTimes f) case List(F) =>
diff --git a/src/algebra/laurent.spad.pamphlet b/src/algebra/laurent.spad.pamphlet
index ada65fa0..131e9eb5 100644
--- a/src/algebra/laurent.spad.pamphlet
+++ b/src/algebra/laurent.spad.pamphlet
@@ -211,7 +211,7 @@ UnivariateLaurentSeriesConstructor(Coef,UTS):_
(expDiff := getExpon(x) - getExpon(y)) = 0 =>
getUTS(x) = getUTS(y)
abs(expDiff) > _$streamCount$Lisp => false
- expDiff > 0 =>
+ positive? expDiff =>
getUTS(x) * monom(1,expDiff :: NNI) = getUTS(y)
getUTS(y) * monom(1,(- expDiff) :: NNI) = getUTS(x)
@@ -381,7 +381,7 @@ UnivariateLaurentSeriesConstructor(Coef,UTS):_
zero? n =>
zero? x => error "0 ** 0 is undefined"
1
- n > 0 => laurent(n * getExpon(x),getUTS(x) ** (n :: NNI))
+ positive? n => laurent(n * getExpon(x),getUTS(x) ** (n :: NNI))
xInv := inv x; minusN := (-n) :: NNI
laurent(minusN * getExpon(xInv),getUTS(xInv) ** minusN)
diff --git a/src/algebra/listgcd.spad.pamphlet b/src/algebra/listgcd.spad.pamphlet
index 69d50396..fac17b6d 100644
--- a/src/algebra/listgcd.spad.pamphlet
+++ b/src/algebra/listgcd.spad.pamphlet
@@ -118,7 +118,7 @@ HeuGcd (BP):C == T
empty? lind =>
member?(1,listdeg) => lincase(listdeg,listf)
localgcd listf
- or/[n>0 for n in listdeg] => cons(1$BP,listf)
+ or/[positive? n for n in listdeg] => cons(1$BP,listf)
lclistf:List(Z):= [leadingCoefficient f for f in listf]
d:=lintgcd(lclistf)
d=1 => cons(1$BP,listf)
@@ -181,7 +181,7 @@ HeuGcd (BP):C == T
minpol:=1$BP
-- extract a monomial gcd
mdeg:= "min"/[minimumDegree f for f in listf]
- if mdeg>0 then
+ if positive? mdeg then
minpol1:= monomial(1,mdeg)
listf:= [(f exquo minpol1)::BP for f in listf]
minpol:=minpol*minpol1
diff --git a/src/algebra/lodop.spad.pamphlet b/src/algebra/lodop.spad.pamphlet
index 3ebad1d2..53a38c6c 100644
--- a/src/algebra/lodop.spad.pamphlet
+++ b/src/algebra/lodop.spad.pamphlet
@@ -178,7 +178,7 @@ NonCommutativeOperatorDivision(P, F): PDcat == PDdef where
leftGcd(a,b) ==
a = 0 =>b
b = 0 =>a
- while degree b > 0 repeat (a,b) := (b, leftRemainder(a,b))
+ while positive? degree b repeat (a,b) := (b, leftRemainder(a,b))
if b=0 then a else b
-- l = leftLcm(a,b) means l = a*aa l = b*bb Uses leftDivide.
leftLcm(a,b) ==
diff --git a/src/algebra/manip.spad.pamphlet b/src/algebra/manip.spad.pamphlet
index fe59129a..4735b5e7 100644
--- a/src/algebra/manip.spad.pamphlet
+++ b/src/algebra/manip.spad.pamphlet
@@ -353,7 +353,7 @@ AlgebraicManipulations(R, F): Exports == Implementation where
n := (retract(second arg)@Integer)::NonNegativeInteger
ans:F := 0
q := univariate(p, k)
- while (d := degree q) > 0 repeat
+ while positive?(d := degree q) repeat
term :=
one?(g := gcd(d, n)) => monomial(1, k, d)
monomial(1, kernel(operator k, [a,(n quo g)::F], height k), d quo g)
diff --git a/src/algebra/matfuns.spad.pamphlet b/src/algebra/matfuns.spad.pamphlet
index f8768acb..23617e39 100644
--- a/src/algebra/matfuns.spad.pamphlet
+++ b/src/algebra/matfuns.spad.pamphlet
@@ -114,7 +114,7 @@ InnerMatrixLinearAlgebraFunctions(R,Row,Col,M):_
transpose x
copy x
y := rowEchelon y; i := maxRowIndex y
- while rk > 0 and rowAllZeroes?(y,i) repeat
+ while positive? rk and rowAllZeroes?(y,i) repeat
i := i - 1
rk := (rk - 1) :: NonNegativeInteger
rk :: NonNegativeInteger
@@ -131,7 +131,7 @@ InnerMatrixLinearAlgebraFunctions(R,Row,Col,M):_
basis : List Col := nil()
rk := nrow; row := maxR
-- compute rank = # rows - # rows of all zeroes
- while rk > 0 and rowAllZeroes?(x,row) repeat
+ while positive? rk and rowAllZeroes?(x,row) repeat
rk := (rk - 1) :: NonNegativeInteger
row := (row - 1) :: NonNegativeInteger
-- if maximal rank, return zero vector
@@ -681,7 +681,7 @@ MatrixLinearAlgebraFunctions(R,Row,Col,M):Exports == Implementation where
copy x
y := fractionFreeGauss! y
i := maxRowIndex y
- while rk > 0 and rowAllZeroes?(y,i) repeat
+ while positive? rk and rowAllZeroes?(y,i) repeat
i := i - 1
rk := (rk - 1) :: NonNegativeInteger
rk :: NonNegativeInteger
@@ -694,7 +694,7 @@ MatrixLinearAlgebraFunctions(R,Row,Col,M):Exports == Implementation where
normalizedDivide(n:R, d:R):Record(quotient:R, remainder:R) ==
qr := divide(n, d)
qr.remainder >= 0 => qr
- d > 0 =>
+ positive? d =>
qr.remainder := qr.remainder + d
qr.quotient := qr.quotient - 1
qr
diff --git a/src/algebra/mathml.spad.pamphlet b/src/algebra/mathml.spad.pamphlet
index 5cc0d658..ba186863 100644
--- a/src/algebra/mathml.spad.pamphlet
+++ b/src/algebra/mathml.spad.pamphlet
@@ -599,7 +599,7 @@ returning Void. I really only need the one coerce function.
nargs : I := #args
-- sayTeX$Lisp concat ["1: ",stringify first le," : ",string(nargs)$S]
s : S := concat ["{",sop]
- if nargs > 0 then
+ if positive? nargs then
for a in args repeat
-- sayTeX$Lisp concat ["2: ",stringify a]
s1 : S := exprex a
@@ -679,7 +679,7 @@ returning Void. I really only need the one coerce function.
endS:S := concat ["</",name,">"]
level:I := 1
--sayTeX$Lisp "eltLimit: element name: "name
- while (level > 0) repeat
+ while positive? level repeat
startI := position(startS,mathML,pI)$String
endI := position(endS,mathML,pI)$String
@@ -777,7 +777,7 @@ have to be switched by swapping names.
len : I := #str
plusminus : S := "<mo>+</mo><mo>-</mo>"
pos : I := position(plusminus,str,1)
- if pos > 0 then
+ if positive? pos then
ustart:US := segment(1,pos-1)$US
uend:US := segment(pos+20,len)$US
str := concat [str.ustart,"<mo>-</mo>",str.uend]
@@ -943,7 +943,7 @@ have to be switched by swapping names.
while k < #numLS + 1 repeat
if numLS.k = string i then j := j + 1
k := k+1
- if j > 0 then
+ if positive? j then
tmpS := stringify args.i
if j = 1 then
s := s"<mo>&#x02202;</mo><mi>"tmpS"</mi>"
@@ -1035,7 +1035,7 @@ have to be switched by swapping names.
commaS : S := stringify first rest rest rest atomE
commaTest : S := ","
i : I := 0
- while position(commaTest,commaS,1) > 0 repeat
+ while positive? position(commaTest,commaS,1) repeat
i := i+1
commaTest := commaTest","
s : S := "<msup><mi>"funcS"</mi><mrow>"
@@ -1064,7 +1064,7 @@ have to be switched by swapping names.
commaS : S := stringify first rest rest rest atomE
commaTest : S := ","
ndiffs : I := 0
- while position(commaTest,commaS,1) > 0 repeat
+ while positive? position(commaTest,commaS,1) repeat
ndiffs := ndiffs+1
commaTest := commaTest","
s : S := "<mfrac><mrow><msup><mo>&#x02146;</mo><mn>"string(ndiffs)"</mn></msup><mi>"funcS"</mi></mrow><mrow><mo>&#x02146;</mo><msup><mi>"formatMml(first args,minPrec)"</mi><mn>"string(ndiffs)"</mn></msup></mrow></mfrac><mo>&#x02061;</mo><mo>(</mo><mi>"formatMml(first args,minPrec)"</mi><mo>)</mo>"
@@ -1154,7 +1154,7 @@ have to be switched by swapping names.
-- %A for the bound variable and puts the original variable used
-- in the input command as a superscript on the integral sign.
-- I'm assuming that the axiom variable is 2 characters.
- while (i := position(varRS,integrand,i+1)) > 0 repeat
+ while positive?(i := position(varRS,integrand,i+1)) repeat
u1 := segment(1,i-1)$US
u2 := segment(i+2,#integrand)$US
integrand := concat [integrand.u1,bvarS,integrand.u2]
@@ -1253,10 +1253,10 @@ have to be switched by swapping names.
-- Note that since the resulting MathML <mfrac>s are nested we need
-- to handle the whole continued fraction at once, i.e. we can't
-- just look for, e.g., {{ZAG}{1}{6}}
- (#args > 1) and (position("ZAG",stringify first rest args,1) > 0) =>
+ (#args > 1) and positive? position("ZAG",stringify first rest args,1) =>
tmpS : S := stringify first args
- position("ZAG",tmpS,1) > 0 => formatZag(args)
--- position("ZAG",tmpS,1) > 0 => formatZag1(args)
+ positive? position("ZAG",tmpS,1) => formatZag(args)
+-- positive? position("ZAG",tmpS,1) => formatZag1(args)
concat [formatMml(first args,minPrec) "<mo>+</mo>" formatZag(rest args)]
-- At least for the ops "*","+","-" we need to test to see if a sigma or pi
-- is one of their arguments because we might need parentheses as indicated
@@ -1313,7 +1313,7 @@ have to be switched by swapping names.
#args > 1 => "<mfrac>"formatMml(first rest tmpZag,minPrec)"<mrow><mn>"formatMml(first rest rest tmpZag,minPrec)"</mn><mo>+</mo>"formatZag(rest args)"</mrow></mfrac>"
(first args = "...":: E)@Boolean => "<mo>&#x2026;</mo>"
op:S := stringify first args
- position("ZAG",op,1) > 0 =>
+ positive? position("ZAG",op,1) =>
"<mfrac>"formatMml(first rest tmpZag,minPrec)formatMml(first rest rest tmpZag,minPrec)"</mfrac>"
error "formatZag: Last argument in ZAG construct has unknown operator: "op
@@ -1356,15 +1356,15 @@ have to be switched by swapping names.
-- ExponentialE
str = "%i" => "<mi>&#x02148;</mi>"
-- ImaginaryI
- len > 0 and str.1 = char "%" => concat(concat("<mi>",str),"</mi>")
+ positive? len and str.1 = char "%" => concat(concat("<mi>",str),"</mi>")
len > 1 and digit? str.1 => concat ["<mn>",str,"</mn>"] -- should handle floats
-- presumably this is a literal string
- len > 0 and str.1 = char "_"" =>
+ positive? len and str.1 = char "_"" =>
concat(concat("<mtext>",str),"</mtext>")
len = 1 and str.1 = char " " => " "
- (i := position(str,specialStrings)) > 0 =>
+ positive?(i := position(str,specialStrings)) =>
specialStringsInMML.i
- (i := position(char " ",str)) > 0 =>
+ positive?(i := position(char " ",str)) =>
-- We want to preserve spacing, so use a roman font.
-- What's this for? Leave the \rm in for now so I can see
-- where it arises. Removed 2007-02-14
@@ -1378,10 +1378,10 @@ have to be switched by swapping names.
nargs : I := #args
-- need to test here in case first l is SUPERSUB case and then
-- pass first l and args to formatSuperSub.
- position("SUPERSUB",op,1) > 0 =>
+ positive? position("SUPERSUB",op,1) =>
formatSuperSub(first l,args,minPrec)
-- now test for SUB
- position("SUB",op,1) > 0 =>
+ positive? position("SUB",op,1) =>
formatSub1(first l,args,minPrec)
-- special cases
diff --git a/src/algebra/mfinfact.spad.pamphlet b/src/algebra/mfinfact.spad.pamphlet
index 5292b222..55153b57 100644
--- a/src/algebra/mfinfact.spad.pamphlet
+++ b/src/algebra/mfinfact.spad.pamphlet
@@ -109,7 +109,7 @@ MultFiniteFactorize(OV,E,F,PG) : C == T
factorlist:L SUParFact :=empty()
mdeg :=minimumDegree um ---- is the Mindeg > 0? ----
- if mdeg>0 then
+ if positive? mdeg then
f1:SUP P:=monomial(1,mdeg)
um:=(um exquo f1)::SUP P
factorlist:=cons([monomial(1,1),mdeg],factorlist)
@@ -173,7 +173,7 @@ MultFiniteFactorize(OV,E,F,PG) : C == T
factorlist:L MParFact :=empty()
---- is the Mindeg > 0? ----
lmdeg :=minimumDegree(m,lvar)
- or/[n>0 for n in lmdeg] => simplify(m,dx,lvar,lmdeg)
+ or/[positive? n for n in lmdeg] => simplify(m,dx,lvar,lmdeg)
---- Make the polynomial square-free ----
om:=pushup(m,basicVar)
sqfacs:=squareFree(om)
diff --git a/src/algebra/mkfunc.spad.pamphlet b/src/algebra/mkfunc.spad.pamphlet
index e3e81eea..288a3a82 100644
--- a/src/algebra/mkfunc.spad.pamphlet
+++ b/src/algebra/mkfunc.spad.pamphlet
@@ -178,7 +178,7 @@ InputForm():
conv [convert("*"::Symbol), s1, s2]$List(%)
s1:% ** n:Integer ==
- s1 = 0 and n > 0 => 0
+ s1 = 0 and positive? n => 0
s1 = 1 or zero? n => 1
one? n => s1
conv [convert("**"::Symbol), s1, convert n]$List(%)
diff --git a/src/algebra/moddfact.spad.pamphlet b/src/algebra/moddfact.spad.pamphlet
index dc68773e..14795411 100644
--- a/src/algebra/moddfact.spad.pamphlet
+++ b/src/algebra/moddfact.spad.pamphlet
@@ -103,7 +103,7 @@ ModularDistinctDegreeFactorizer(U):C == T where
exptmod(u1,i,u2) ==
negative? i => error("negative exponentiation not allowed for exptMod")
ans:= 1$EMR
- while i > 0 repeat
+ while positive? i repeat
if odd?(i) then ans:= (ans * u1) rem u2
i:= i quo 2
u1:= (u1 * u1) rem u2
@@ -116,14 +116,14 @@ ModularDistinctDegreeFactorizer(U):C == T where
ddfactor(u) ==
if (c:= lc(u)) ~= 1$I then u:= makeMonic(u)
ans:= sepfact(ddfact(u))
- cons(c::EMR,[makeMonic(f) for f in ans | degree(f) > 0])
+ cons(c::EMR,[makeMonic(f) for f in ans | positive? degree(f)])
gcd(u,v,q) == gcd(reduce(u,q),reduce(v,q))::U
factor(u,q) ==
v:= reduce(u,q)
dv:= reduce(differentiate(u),q)
- degree gcd(v,dv) > 0 =>
+ positive? degree gcd(v,dv) =>
error("Modular factor: polynomial must be squarefree")
ans:= ddfactor v
[f::U for f in ans]
@@ -138,7 +138,7 @@ ModularDistinctDegreeFactorizer(U):C == T where
repeat
w:= exptmod(w,p,u)
g:= gcd(w - m,u)
- if degree g > 0 then
+ if positive? degree g then
g:= makeMonic(g)
ans:= [[g,d],:ans]
u:= (u quo g)
@@ -179,7 +179,7 @@ ModularDistinctDegreeFactorizer(U):C == T where
x:U:= monomial(1,1)
-- for small primes find linear factors by exhaustion
d=1 and p < 1000 =>
- for i in 0.. while du > 0 repeat
+ for i in 0.. while positive? du repeat
if u(i::U) = 0 then
ans := cons(reduce(x-(i::U),p),ans)
du := du-1
@@ -230,7 +230,7 @@ ModularDistinctDegreeFactorizer(U):C == T where
p:=modulus(t)
d:= d - 1
tt:=t
- while d > 0 repeat
+ while positive? d repeat
tt:= (tt + (t:=exptmod(t,p,u))) rem u
d:= d - 1
tt
diff --git a/src/algebra/modgcd.spad.pamphlet b/src/algebra/modgcd.spad.pamphlet
index a30dd0cc..b094a863 100644
--- a/src/algebra/modgcd.spad.pamphlet
+++ b/src/algebra/modgcd.spad.pamphlet
@@ -77,7 +77,7 @@ InnerModularGcd(R,BP,pMod,nextMod):C == T
modularGcdPrimitive(listf : List BP) :BP ==
empty? listf => 0$BP
g := first listf
- for f in rest listf | not zero? f while degree g > 0 repeat
+ for f in rest listf | not zero? f while positive? degree g repeat
g:=modGcdPrimitive(g,f)
g
@@ -89,7 +89,7 @@ InnerModularGcd(R,BP,pMod,nextMod):C == T
minpol:=1$BP
-- extract a monomial gcd
mdeg:= "min"/[minimumDegree f for f in listf]
- if mdeg>0 then
+ if positive? mdeg then
minpol1:= monomial(1,mdeg)
listf:= [(f exquo minpol1)::BP for f in listf]
minpol:=minpol*minpol1
diff --git a/src/algebra/mring.spad.pamphlet b/src/algebra/mring.spad.pamphlet
index 46e50c7d..6adb05f8 100644
--- a/src/algebra/mring.spad.pamphlet
+++ b/src/algebra/mring.spad.pamphlet
@@ -106,7 +106,7 @@ MonoidRing(R: Ring, M: Monoid): MRcategory == MRdefinition where
p:Integer := size()$R
n:Integer := size()$M
ans:% := 0
- for j in 0.. while i > 0 repeat
+ for j in 0.. while positive? i repeat
h := i rem p
-- we use index(p) = 0$R
if h ~= 0 then
diff --git a/src/algebra/mset.spad.pamphlet b/src/algebra/mset.spad.pamphlet
index 22e633de..351eefee 100644
--- a/src/algebra/mset.spad.pamphlet
+++ b/src/algebra/mset.spad.pamphlet
@@ -154,10 +154,10 @@ Multiset(S: SetCategory): MultisetAggregate S with
((n := t.e) <= max) =>
remove!(e,t)
ms.count := ms.count-n
- max > 0 =>
+ positive? max =>
t.e := n-max
ms.count := ms.count-max
- (n := n+max) > 0 =>
+ positive?(n := n+max) =>
t.e := -max
ms.count := ms.count-n
ms
@@ -169,10 +169,10 @@ Multiset(S: SetCategory): MultisetAggregate S with
((n := t.e) <= max) =>
remove!(e,t)
ms.count := ms.count-n
- max > 0 =>
+ positive? max =>
t.e := n-max
ms.count := ms.count-max
- (n := n+max) > 0 =>
+ positive?(n := n+max) =>
t.e := -max
ms.count := ms.count-n
ms
@@ -245,7 +245,7 @@ Multiset(S: SetCategory): MultisetAggregate S with
n := 0
for e in keys t1 repeat
m := min(t1.e,t2.e)
- m > 0 =>
+ positive? m =>
m := t1.e + t2.e
t.e := m
n := n + m
@@ -259,7 +259,7 @@ Multiset(S: SetCategory): MultisetAggregate S with
for e in keys t1 repeat
k1 := t1.e
k2 := t2.e
- k1 > 0 and k2 = 0 =>
+ positive? k1 and k2 = 0 =>
t.e := k1
n := n + k1
n = 0 => empty()
diff --git a/src/algebra/multfact.spad.pamphlet b/src/algebra/multfact.spad.pamphlet
index 376da187..b6009e97 100644
--- a/src/algebra/multfact.spad.pamphlet
+++ b/src/algebra/multfact.spad.pamphlet
@@ -117,7 +117,7 @@ InnerMultFact(OV,E,R,P) : C == T
factorlist:L SUParFact :=empty()
mdeg :=minimumDegree um ---- is the Mindeg > 0? ----
- if mdeg>0 then
+ if positive? mdeg then
f1:USP:=monomial(1,mdeg)
um:=(um exquo f1)::USP
factorlist:=cons([monomial(1,1),mdeg],factorlist)
@@ -383,7 +383,7 @@ InnerMultFact(OV,E,R,P) : C == T
factorlist:L MParFact :=empty()
lmdeg :=minimumDegree(m,lvar) ---- is the Mindeg > 0? ----
- or/[n>0 for n in lmdeg] => simplify(m,lvar,lmdeg,ufactor)
+ or/[positive? n for n in lmdeg] => simplify(m,lvar,lmdeg,ufactor)
sqfacs := squareFree m
lcont := unit sqfacs
diff --git a/src/algebra/newpoly.spad.pamphlet b/src/algebra/newpoly.spad.pamphlet
index 573a085f..459ef7b3 100644
--- a/src/algebra/newpoly.spad.pamphlet
+++ b/src/algebra/newpoly.spad.pamphlet
@@ -1400,7 +1400,7 @@ RecursivePolynomialCategory(R:Ring, E:OrderedAbelianMonoidSup, V:OrderedSet): Ca
if ground?(tpol)
then
n := retract(ground(tpol))@INT
- if n > 0
+ if positive? n
then
stpol := concat(" +",convert(n)@String)$String
else
diff --git a/src/algebra/numode.spad.pamphlet b/src/algebra/numode.spad.pamphlet
index 84415e34..4a88a636 100644
--- a/src/algebra/numode.spad.pamphlet
+++ b/src/algebra/numode.spad.pamphlet
@@ -203,7 +203,7 @@ NumericalOrdinaryDifferentialEquations(): Exports == Implementation where
--compute the derivative
derivs(dydx,y,x)
--if overshoot, the set h accordingly
- if (x + step.tryValue - x2) > 0.0 then
+ if positive?(x + step.tryValue - x2) then
step.tryValue := x2 - x
--find the correct scaling
for i in 1..m repeat
diff --git a/src/algebra/odealg.spad.pamphlet b/src/algebra/odealg.spad.pamphlet
index 653dece6..1a3d355d 100644
--- a/src/algebra/odealg.spad.pamphlet
+++ b/src/algebra/odealg.spad.pamphlet
@@ -152,7 +152,7 @@ SystemODESolver(F, LO): Exports == Implementation where
r := r - 1
c := c - 1
firstnonzero(m, r) ~= c => error "backsolve: undetermined system"
- degree(eq := m(r, c)) > 0 => error "backsolve: pivot of order > 0"
+ positive? degree(eq := m(r, c)) => error "backsolve: pivot of order > 0"
a := leadingCoefficient(eq)::F
if part? then
part(r + offset) := (v(r + offset) - applyLodo(m, r, part, n)) / a
diff --git a/src/algebra/oderf.spad.pamphlet b/src/algebra/oderf.spad.pamphlet
index f104bc74..2fb8bf0a 100644
--- a/src/algebra/oderf.spad.pamphlet
+++ b/src/algebra/oderf.spad.pamphlet
@@ -462,7 +462,7 @@ RationalLODE(F, UP): Exports == Implementation where
ratDsolve0(op, g) ==
zero? degree op => [inv(leadingCoefficient(op)::RF) * g, empty()]
- minimumDegree op > 0 =>
+ positive? minimumDegree op =>
sol := ratDsolve0(monicRightDivide(op, monomial(1, 1)).quotient, g)
b:List(RF) := [1]
for f in sol.basis repeat
diff --git a/src/algebra/opalg.spad.pamphlet b/src/algebra/opalg.spad.pamphlet
index 759f9136..4c7a08fe 100644
--- a/src/algebra/opalg.spad.pamphlet
+++ b/src/algebra/opalg.spad.pamphlet
@@ -103,7 +103,7 @@ ModuleOperator(R: Ring, M:LeftModule(R)): Exports == Implementation where
x:$ ** i:Integer ==
i = 0 => 1
- i > 0 => expt(x,i pretend PositiveInteger)$RepeatedSquaring($)
+ positive? i => expt(x,i pretend PositiveInteger)$RepeatedSquaring($)
(inv(retract(x)@TERM)) ** (-i)
evaluateInverse(f, g) ==
@@ -171,7 +171,7 @@ ModuleOperator(R: Ring, M:LeftModule(R)): Exports == Implementation where
for rec in reverse! factors m repeat
e := rec.exp
g := rec.gen
- e > 0 =>
+ positive? e =>
for i in 1..e repeat r := opeval(g, r)
negative? e =>
for i in 1..(-e) repeat r := opInvEval(g, r)
diff --git a/src/algebra/outform.spad.pamphlet b/src/algebra/outform.spad.pamphlet
index b73ef8c3..28fbbdb4 100644
--- a/src/algebra/outform.spad.pamphlet
+++ b/src/algebra/outform.spad.pamphlet
@@ -157,7 +157,7 @@ NumberFormats(): NFexports == NFimplementation where
m0:String := concat(new(i,plen),concat("I",new(i,pren)))
mm := concat([m0 for j in 1..d]$List(String))
-- strictly speaking the blank is gratuitous
- if #s > 0 then s := concat(" ", s)
+ if positive?(#s) then s := concat(" ", s)
s := concat(mm, s)
s
diff --git a/src/algebra/pade.spad.pamphlet b/src/algebra/pade.spad.pamphlet
index 08d7bdbc..f46e79e4 100644
--- a/src/algebra/pade.spad.pamphlet
+++ b/src/algebra/pade.spad.pamphlet
@@ -145,7 +145,7 @@ PadeApproximants(R,PS,UP): Exports == Implementation where
zero? gps => constInner 0
-- Normalize so numerator or denominator has constant term.
ldeg:= min(order dps,order gps)
- if ldeg > 0 then
+ if positive? ldeg then
dps := divOutDegree(dps,ldeg)
gps := divOutDegree(gps,ldeg)
padeInner(l,m,gps,dps)
diff --git a/src/algebra/pattern.spad.pamphlet b/src/algebra/pattern.spad.pamphlet
index fd008b3e..c5a667e6 100644
--- a/src/algebra/pattern.spad.pamphlet
+++ b/src/algebra/pattern.spad.pamphlet
@@ -255,7 +255,7 @@ Pattern(R:SetCategory): Exports == Implementation where
0 == taggedElt(PAT_ZERO, empty())
p:% ** n:NonNegativeInteger ==
- p = 0 and n > 0 => 0
+ p = 0 and positive? n => 0
p = 1 or zero? n => 1
one? n => p
mkPat(constant? p, [[p, n]$REC], 1 + (p.lev))
diff --git a/src/algebra/pdecomp.spad.pamphlet b/src/algebra/pdecomp.spad.pamphlet
index 1e6f1829..b449e437 100644
--- a/src/algebra/pdecomp.spad.pamphlet
+++ b/src/algebra/pdecomp.spad.pamphlet
@@ -53,7 +53,7 @@ PolynomialDecomposition(UP, F): PDcat == PDdef where
for i in 0.. while f ~= 0 repeat
fr := divide(f, h)
f := fr.quotient; r := fr.remainder
- degree r > 0 => return "failed"
+ positive? degree r => return "failed"
g := g + r * monomial(1, i)
g
diff --git a/src/algebra/permgrps.spad.pamphlet b/src/algebra/permgrps.spad.pamphlet
index 29b849a9..ee5c746a 100644
--- a/src/algebra/permgrps.spad.pamphlet
+++ b/src/algebra/permgrps.spad.pamphlet
@@ -281,11 +281,11 @@ PermutationGroup(S:SetCategory): public == private where
randomElement : V NNI := group.randomInteger
words := nil()$(L NNI)
if wordProblem then words := word.(randomInteger::NNI)
- if maxLoops > 0 then
+ if positive? maxLoops then
numberOfLoops : I := 1 + (random()$Integer rem maxLoops)
else
numberOfLoops : I := maxLoops
- while numberOfLoops > 0 repeat
+ while positive? numberOfLoops repeat
randomInteger : I := 1 + (random()$Integer rem numberOfGenerators)
randomElement := times ( group.randomInteger , randomElement )
if wordProblem then words := append ( word.(randomInteger::NNI) , words)
@@ -331,7 +331,7 @@ PermutationGroup(S:SetCategory): public == private where
word := nil()$(L NNI)
oorb := o.orb
osvc := o.svc
- while degree > 0 repeat
+ while positive? degree repeat
p := osvc.ppt
negative? p => return [ xelt , word ]
x := group.p
@@ -368,7 +368,7 @@ PermutationGroup(S:SetCategory): public == private where
group2 := nil()$(L V NNI)
words3 := nil()$(L L NNI)
j : I := 15
- while j > 0 repeat
+ while positive? j repeat
-- find generators for the stabilizer
ran := ranelt ( group , words , maxLoops )
str := strip ( ran.elt , ort , group , words )
@@ -520,7 +520,7 @@ PermutationGroup(S:SetCategory): public == private where
for j in (i-1)..1 by -1 while noresult repeat
s := gporb.j.svc
p := gporb.j.orb.1
- while ( degree > 0 ) and noresult repeat
+ while positive? degree and noresult repeat
entry := s.(z.p)
if negative? entry then
if entry = -1 then leave
@@ -567,7 +567,7 @@ PermutationGroup(S:SetCategory): public == private where
group2 := brace()$(FSET PERM S)
gp : L PERM S := group.gens
for gen in gp repeat
- if degree gen > 0 then insert!(gen, group2)
+ if positive? degree gen then insert!(gen, group2)
group2
knownGroup? (gp : %) : Void ==
@@ -659,7 +659,7 @@ PermutationGroup(S:SetCategory): public == private where
randomInteger : I := 1 + (random()$Integer rem numberOfGenerators)
randomElement := gp.randomInteger
numberOfLoops : I := 1 + (random()$Integer rem maximalNumberOfFactors)
- while numberOfLoops > 0 repeat
+ while positive? numberOfLoops repeat
randomInteger : I := 1 + (random()$Integer rem numberOfGenerators)
randomElement := gp.randomInteger * randomElement
numberOfLoops := numberOfLoops - 1
@@ -710,7 +710,7 @@ PermutationGroup(S:SetCategory): public == private where
orbits ( gp ) ==
spp := support gp
orbits := nil()$(L FSET S)
- while cardinality spp > 0 repeat
+ while positive? cardinality spp repeat
el := extract! spp
orbitSet := orbit ( gp , el )
orbits := cons ( orbitSet , orbits )
diff --git a/src/algebra/pfbr.spad.pamphlet b/src/algebra/pfbr.spad.pamphlet
index 5919c7ec..5fb79179 100644
--- a/src/algebra/pfbr.spad.pamphlet
+++ b/src/algebra/pfbr.spad.pamphlet
@@ -149,7 +149,7 @@ PolynomialFactorizationByRecursionUnivariate(R, S): public == private where
substns:= randomR()
zero? elt(leadingCoefficient pp,substns ) => "next"
ppR:=map( elt(#1,substns),pp)
- degree gcd(ppR,differentiate ppR)>0 => "next"
+ positive? degree gcd(ppR,differentiate ppR) => "next"
leave
[substns,ppR]
raise(supR) == map(#1:R::S,supR)
@@ -160,7 +160,7 @@ PolynomialFactorizationByRecursionUnivariate(R, S): public == private where
-- returns "failed" if the substitution is bad, else a factorization
ppR:=map(elt(#1,r),pp)
degree ppR < degree pp => "failed"
- degree gcd(ppR,differentiate ppR) >0 => "failed"
+ positive? degree gcd(ppR,differentiate ppR) => "failed"
factors:=
fDown:=factorSquareFreePolynomial ppR
[raise (unit fDown * factorList(fDown).first.fctr),
@@ -384,7 +384,7 @@ PolynomialFactorizationByRecursion(R,E, VarSet:OrderedSet, S): public ==
-- returns "failed" if the substitution is bad, else a factorization
ppR:=map(eval(#1,first lvpp,r),pp)
degree ppR < degree pp => "failed"
- degree gcd(ppR,differentiate ppR) >0 => "failed"
+ positive? degree gcd(ppR,differentiate ppR) => "failed"
factors:=
empty? rest lvpp =>
fDown:=factorSquareFreePolynomial map(retract(#1)::R,ppR)
@@ -434,7 +434,7 @@ PolynomialFactorizationByRecursion(R,E, VarSet:OrderedSet, S): public ==
substns:= [randomR() for v in lvpp]
zero? eval(leadingCoefficient pp,lvpp,substns ) => "next"
ppR:=map((retract eval(#1,lvpp,substns))::R,pp)
- degree gcd(ppR,differentiate ppR)>0 => "next"
+ positive? degree gcd(ppR,differentiate ppR) => "next"
leave
[substns,ppR]
chooseSLPEViableSubstitutions(lvpolys,lpolys,pp) ==
@@ -450,7 +450,7 @@ PolynomialFactorizationByRecursion(R,E, VarSet:OrderedSet, S): public ==
for u in lpolys]
uu:=lpolysR
while not empty? uu repeat
- "or"/[ degree(gcd(uu.first,v))>0 for v in uu.rest] => leave
+ "or"/[positive? degree(gcd(uu.first,v)) for v in uu.rest] => leave
uu:=rest uu
not empty? uu => "next"
leave
diff --git a/src/algebra/plot.spad.pamphlet b/src/algebra/plot.spad.pamphlet
index fdeeafed..d03da277 100644
--- a/src/algebra/plot.spad.pamphlet
+++ b/src/algebra/plot.spad.pamphlet
@@ -387,7 +387,7 @@ Plot(): Exports == Implementation where
todo1 := rest todo1
todo2 := rest todo2
if not null todo1 then (t := first(todo1); p := first(todo2))
- n > 0 =>
+ positive? n =>
NUMFUNEVALS := NUMFUNEVALS + n
t := curve.knots; p := curve.points
xRange := select(p,xCoord,min) .. select(p,xCoord,max)
diff --git a/src/algebra/plot3d.spad.pamphlet b/src/algebra/plot3d.spad.pamphlet
index 44429031..aa98d794 100644
--- a/src/algebra/plot3d.spad.pamphlet
+++ b/src/algebra/plot3d.spad.pamphlet
@@ -343,7 +343,7 @@ Plot3D(): Exports == Implementation where
todo2 := concat!(todo2, p)
todo1 := rest todo1; todo2 := rest todo2
if not null todo1 then (t := first(todo1); p := first(todo2))
- if n > 0 then
+ if positive? n then
NUMFUNEVALS := NUMFUNEVALS + n
t := curve.knots; p := curve.points
xRg := select(p,xCoord,min) .. select(p,xCoord,max)
diff --git a/src/algebra/poly.spad.pamphlet b/src/algebra/poly.spad.pamphlet
index 42c1eab2..d055f03d 100644
--- a/src/algebra/poly.spad.pamphlet
+++ b/src/algebra/poly.spad.pamphlet
@@ -142,7 +142,7 @@ PolynomialRing(R:Ring,E:OrderedAbelianMonoid): T == C
0$R
recip(p) ==
null p => "failed"
- p.first.k > 0$E => "failed"
+ positive? p.first.k => "failed"
(u:=recip(p.first.c)) case "failed" => "failed"
(u::R)::%
@@ -499,7 +499,7 @@ SparseUnivariatePolynomial(R:Ring): UnivariatePolynomialCategory(R) with
multivariate(supp:SparseUnivariatePolynomial(%),v:SingletonAsOrderedSet) ==
zero? supp => 0
lc:=leadingCoefficient supp
- degree lc > 0 => error "bad form polynomial"
+ positive? degree lc => error "bad form polynomial"
monomial(leadingCoefficient lc,degree supp) +
multivariate(reductum supp,v)
if R has FiniteFieldCategory and R has PolynomialFactorizationExplicit then
@@ -907,7 +907,7 @@ UnivariatePolynomialSquareFree(RC:IntegralDomain,P):C == T
di:=(di exquo pi)::P - differentiate(ci)
pi:=gcd(ci,di)
i:=i+1
- degree(pi) > 0 =>
+ positive? degree(pi) =>
lcp:=(lcp exquo (leadingCoefficient(pi)**i))::RC
lffe:=[["sqfr",pi,i],:lffe]
makeFR(lcp::P,lffe)
diff --git a/src/algebra/polycat.spad.pamphlet b/src/algebra/polycat.spad.pamphlet
index 140fc069..d3107611 100644
--- a/src/algebra/polycat.spad.pamphlet
+++ b/src/algebra/polycat.spad.pamphlet
@@ -538,7 +538,7 @@ PolynomialCategory(R:Ring, E:OrderedAbelianMonoidSup, VarSet:OrderedSet):
vars:=rest vars
d:=degree(p,v)
ans:% := 0
- while (d>0) repeat
+ while positive? d repeat
(dd:=(d::Integer exquo ch::Integer)) case "failed" =>
return nothing
cp:=coefficient(p,v,d)
@@ -880,7 +880,7 @@ UnivariatePolynomialCategory(R:Ring): Category ==
if R has CommutativeRing then
differentiate(x:%, deriv:R -> R, x':%) ==
d:% := 0
- while (dg := degree x) > 0 repeat
+ while positive?(dg := degree x) repeat
lc := leadingCoefficient x
d := d + x' * monomial(dg * lc, (dg - 1)::NonNegativeInteger)
+ monomial(deriv lc, dg)
@@ -896,7 +896,7 @@ UnivariatePolynomialCategory(R:Ring): Category ==
differentiate(x:%, deriv:R -> R, x':%) ==
d:% := 0
- while (dg := degree x) > 0 repeat
+ while positive?(dg := degree x) repeat
lc := leadingCoefficient x
d := d + monomial(deriv lc, dg) + lc * ncdiff(dg, x')
x := reductum x
@@ -904,7 +904,7 @@ UnivariatePolynomialCategory(R:Ring): Category ==
differentiate(x:%, deriv:R -> R) == differentiate(x, deriv, 1$%)$%
differentiate(x:%) ==
d:% := 0
- while (dg := degree x) > 0 repeat
+ while positive?(dg := degree x) repeat
d := d + monomial(dg * leadingCoefficient x, (dg - 1)::NonNegativeInteger)
x := reductum x
d
diff --git a/src/algebra/primelt.spad.pamphlet b/src/algebra/primelt.spad.pamphlet
index 1f18de1d..c72e09f6 100644
--- a/src/algebra/primelt.spad.pamphlet
+++ b/src/algebra/primelt.spad.pamphlet
@@ -83,7 +83,7 @@ PrimitiveElement(F): Exports == Implementation where
findUniv(l, v, opt) ==
for p in l repeat
- degree(p, v) > 0 and incl?(variables p, [v, opt]) => return p
+ positive? degree(p, v) and incl?(variables p, [v, opt]) => return p
"failed"
triangularLinearIfCan(l, lv, w) ==
diff --git a/src/algebra/prs.spad.pamphlet b/src/algebra/prs.spad.pamphlet
index 7804b4fb..1155ee6d 100644
--- a/src/algebra/prs.spad.pamphlet
+++ b/src/algebra/prs.spad.pamphlet
@@ -889,7 +889,7 @@ PseudoRemainderSequence(R, polR) : Specification == Implementation where
resultantReduit(P : polR, Q : polR) : R ==
UV := subResultantGcdEuclidean(P, Q)
UVs : polR := UV.gcd
- degree(UVs) > 0 => 0
+ positive? degree(UVs) => 0
l : List(R) := concat(coefficients(UV.coef1), coefficients(UV.coef2))
return (LC(UVs) exquo gcd(l))::R
@@ -897,7 +897,7 @@ PseudoRemainderSequence(R, polR) : Specification == Implementation where
Record(coef1 : polR, coef2 : polR, resultantReduit : R) ==
UV := subResultantGcdEuclidean(P, Q)
UVs : polR := UV.gcd
- degree(UVs) > 0 => construct(0::polR, 0::polR, 0::R)
+ positive? degree(UVs) => construct(0::polR, 0::polR, 0::R)
l : List(R) := concat(coefficients(UV.coef1), coefficients(UV.coef2))
gl : R := gcd(l)
c1 : polR := (UV.coef1 exquo gl)::polR
@@ -909,7 +909,7 @@ PseudoRemainderSequence(R, polR) : Specification == Implementation where
Record(coef2 : polR, resultantReduit : R) ==
UV := subResultantGcdEuclidean(P, Q)
UVs : polR := UV.gcd
- degree(UVs) > 0 => construct(0::polR, 0::R)
+ positive? degree(UVs) => construct(0::polR, 0::R)
l : List(R) := concat(coefficients(UV.coef1), coefficients(UV.coef2))
gl : R := gcd(l)
c2 : polR := (UV.coef2 exquo gl)::polR
diff --git a/src/algebra/random.spad.pamphlet b/src/algebra/random.spad.pamphlet
index 0a650ee2..dc47310e 100644
--- a/src/algebra/random.spad.pamphlet
+++ b/src/algebra/random.spad.pamphlet
@@ -198,7 +198,7 @@ RandomIntegerDistributions(): with
n := 0
mq := m -- m quo w**n
- while (mqnext := mq quo w) > 0 repeat
+ while positive?(mqnext := mq quo w) repeat
n := n + 1
mq := mqnext
ridHack1(mq, n, w, l)
diff --git a/src/algebra/rdeef.spad.pamphlet b/src/algebra/rdeef.spad.pamphlet
index c7d5e368..b028efda 100644
--- a/src/algebra/rdeef.spad.pamphlet
+++ b/src/algebra/rdeef.spad.pamphlet
@@ -272,7 +272,7 @@ ElementaryRischDE(R, F): Exports == Implementation where
else data := data1::Data
f' := nfprime := n * differentiate(f, x)
p:P := 1
- for v in data | (m := n * v.coeff) > 0 repeat
+ for v in data | positive?(m := n * v.coeff) repeat
p := p * v.argument ** (m::N)
f' := f' - m * differentiate(v.argument::F, x) / (v.argument::F)
rec := baseRDE(univariate(f', k), univariate(p::F * g, k))
@@ -286,7 +286,7 @@ ElementaryRischDE(R, F): Exports == Implementation where
tab.f := data := makeData(f, x, k)
else data := data1::Data
p:P := 1
- for v in data | (m := n * v.coeff) > 0 repeat
+ for v in data | positive?(m := n * v.coeff) repeat
p := p * v.argument ** (m::N)
f := f - v.coeff * log(v.argument::F)
nfp := nfp - m * differentiate(v.argument::F, x) / (v.argument::F)
@@ -318,9 +318,9 @@ ElementaryRischDE(R, F): Exports == Implementation where
one?(degree(num := univariate(fnum, u))) then
cf := (leadingCoefficient num) / fden
if (n := retractIfCan(cf)@Union(Z, "failed")) case Z then
- if degree(numer logand, k) > 0 then
+ if positive? degree(numer logand, k) then
disasters := concat([n::Z, numer logand], disasters)
- if degree(denom logand, k) > 0 then
+ if positive? degree(denom logand, k) then
disasters := concat([-(n::Z), denom logand], disasters)
disasters
@@ -343,7 +343,7 @@ ElementaryRischDE(R, F): Exports == Implementation where
(u := cc exquo aa) case "failed" => "failed"
primintfldpoly(u::UP, extint(#1, t'), t')
n := degree(cc)::Z - (db := degree(bb)::Z)
- if ((da := degree(aa)::Z) = db) and (da > 0) then
+ if ((da := degree(aa)::Z) = db) and positive? da then
lk0 := tower(f0 :=
- (leadingCoefficient bb) / (leadingCoefficient aa))
lk1 := logdiff(twr, lk0)
diff --git a/src/algebra/rderf.spad.pamphlet b/src/algebra/rderf.spad.pamphlet
index 1cd6563d..dbf1eddf 100644
--- a/src/algebra/rderf.spad.pamphlet
+++ b/src/algebra/rderf.spad.pamphlet
@@ -73,7 +73,7 @@ TranscendentalRischDE(F, UP): Exports == Implementation where
(~b0?) and (baseCase? or degree(u.b) > max(0, n)) =>
answ := SPDEnocancel1(u.b, u.c, u.m, derivation)
[[u.alpha * answ.ans + u.beta, answ.nosol]]
- (n > 0) and (b0? or degree(u.b) < n) =>
+ positive? n and (b0? or degree(u.b) < n) =>
uansw := SPDEnocancel2(u.b,u.c,u.m,n,leadingCoefficient dt,derivation)
uansw case ans=> [[u.alpha * uansw.ans.ans + u.beta, uansw.ans.nosol]]
[[uansw.eq.b, uansw.eq.c, uansw.eq.m,
@@ -131,7 +131,7 @@ TranscendentalRischDE(F, UP): Exports == Implementation where
q:UP := 0
while cc ~= 0 repeat
negative? d or negative?(n := (degree cc)::Z - dtm1) or n > d => return [[q, true]]
- if n > 0 then
+ if positive? n then
r := monomial((leadingCoefficient cc) / (n * lt), n::N)
cc := cc - bb * r - derivation r
d := n - 1
diff --git a/src/algebra/rdesys.spad.pamphlet b/src/algebra/rdesys.spad.pamphlet
index 6b62280d..b50f2b3f 100644
--- a/src/algebra/rdesys.spad.pamphlet
+++ b/src/algebra/rdesys.spad.pamphlet
@@ -111,7 +111,7 @@ TranscendentalRischDESystem(F, UP): Exports == Implementation where
h := (h exquo g)::UP
c1 := u1::UP
c2 := u2::UP
- (da := degree a) > 0 =>
+ positive?(da := degree a) =>
(u := diophant(a, h, b, c1, c2)) case "failed" => "failed"
rec := u::REC
v := SPDEsys(a, b, h + derivation a, rec.z1 - derivation(rec.r1),
diff --git a/src/algebra/realzero.spad.pamphlet b/src/algebra/realzero.spad.pamphlet
index cee4a98e..5a049438 100644
--- a/src/algebra/realzero.spad.pamphlet
+++ b/src/algebra/realzero.spad.pamphlet
@@ -112,7 +112,7 @@ RealZeroPackage(Pol): T == C where
F = 0 => error "ReZeroSqfr: zero polynomial"
L : isoList := []
degree(F) = 0 => L
- if (r := minimumDegree(F)) > 0 then
+ if positive?(r := minimumDegree(F)) then
L := [[0,0]$Interval]
tempF := F exquo monomial(1, r)
if not (tempF case "failed") then
@@ -140,7 +140,7 @@ RealZeroPackage(Pol): T == C where
v = 1 => L := [[0,1]$Interval]
G : Pol := transMultInv(2, F)
H : Pol := transAdd1(G)
- if minimumDegree H > 0 then
+ if positive? minimumDegree H then
-- H has a root at 0 => F has one at 1/2, and G at 1
L := [[1/2,1/2]$Interval]
Q : Pol := monomial(1, 1)
@@ -277,7 +277,7 @@ RealZeroPackage(Pol): T == C where
F := (F exquo (monomial(bd,1)-monomial(bn,0)))::Pol
v:=elt(transMultInv(bd, F), bn)
u:=elt(transMultInv(ad, F), an)
- if u > 0 then (F:=-F;v:=-v)
+ if positive? u then (F:=-F;v:=-v)
if negative? v then
error [int, "is not a valid isolation interval for", F]
if eps <= 0 then error "precision must be positive"
@@ -289,7 +289,7 @@ RealZeroPackage(Pol): T == C where
a := mid
an := midn
ad := midd
- v > 0 =>
+ positive? v =>
b := mid
bn := midn
bd := midd
diff --git a/src/algebra/reclos.spad.pamphlet b/src/algebra/reclos.spad.pamphlet
index c1359c1b..9c7e2ae7 100644
--- a/src/algebra/reclos.spad.pamphlet
+++ b/src/algebra/reclos.spad.pamphlet
@@ -118,7 +118,7 @@ RealPolynomialUtilitiesPackage(TheField,ThePols) : PUB == PRIV where
while (p2 ~= 0) repeat
res := cons(p2 , res)
(p1 , p2) := (p2 , -(p1 rem p2))
- if degree(p1) > 0
+ if positive? degree(p1)
then
p1 := unitCanonical(p1)
res := [ term quo p1 for term in res ]
@@ -247,7 +247,7 @@ RealRootCharacterizationCategory(TheField, ThePols ) : Category == PUB where
negative? sign(toTest, rootChar)
positive?(toTest, rootChar) ==
- sign(toTest, rootChar) > 0
+ positive? sign(toTest, rootChar)
rootOf(pol,n) ==
liste:List($):= allRootsOf(pol)
@@ -633,7 +633,7 @@ RightOpenIntervalRootCharacterization(TheField,ThePolDom) : PUB == PRIV where
lt := cons(t.int , lt)
vi := sturmVariationsOf(reverse! lt)$UTIL
o :Z := n - vl + vi
- if o > 0
+ if positive? o
then
sturmNthRoot(lp,int,r,vi,vr,o::N)
else
@@ -815,7 +815,7 @@ RightOpenIntervalRootCharacterization(TheField,ThePolDom) : PUB == PRIV where
inv(leadingCoefficient(toTest))*reductum(toTest)
delta := gcd(toTest,rootChar.defPol)
newChar := [rootChar.low,rootChar.high,rootChar.defPol]$Rep
- if degree(delta) > 0
+ if positive? degree(delta)
then
if sign(delta.(rootChar.low) * delta.(rootChar.high)) <= 0
then
diff --git a/src/algebra/regset.spad.pamphlet b/src/algebra/regset.spad.pamphlet
index 3bb55e90..262a9789 100644
--- a/src/algebra/regset.spad.pamphlet
+++ b/src/algebra/regset.spad.pamphlet
@@ -977,7 +977,7 @@ RegularTriangularSetGcdPackage(R,E,V,P,TS): Exports == Implementation where
ts := lpwt.tower
lbwt := toseInvertible?(leadingCoefficient(p2,v),ts)@(List BWT)
for bwt in lbwt repeat
- (bwt.val = true) and (degree(p2,v) > 0) =>
+ (bwt.val = true) and positive? degree(p2,v) =>
p3 := prem(p1, -p2)
s: P := init(p2)**(mdeg(p1) - mdeg(p2))::N
toSave := cons([[p2,p3,s],bwt.tower]$LpWT,toSave)
diff --git a/src/algebra/riccati.spad.pamphlet b/src/algebra/riccati.spad.pamphlet
index e581b129..a331e45e 100644
--- a/src/algebra/riccati.spad.pamphlet
+++ b/src/algebra/riccati.spad.pamphlet
@@ -228,7 +228,7 @@ PrimitiveRatRicDE(F, UP, L, LQ): Exports == Implementation where
for i in 0..n | (li := coefficient(l, i)) ~= 0 repeat
for j in i+1..n | (lj := coefficient(l, j)) ~= 0 repeat
u := (nu li - nu lj) exquo (i-j)
- if (u case Z) and ((b := u::Z) > 0) then
+ if (u case Z) and positive?(b := u::Z) then
lb := concat([[i, j], b::N], lb)
lb
diff --git a/src/algebra/seg.spad.pamphlet b/src/algebra/seg.spad.pamphlet
index 19a475a4..c0795e9e 100644
--- a/src/algebra/seg.spad.pamphlet
+++ b/src/algebra/seg.spad.pamphlet
@@ -153,7 +153,7 @@ Segment(S:Type): SegmentCategory(S) with
h := hi s
inc := (incr s)::S
zero? inc => error "Cannot expand a segment with an increment of zero"
- if inc > 0 then
+ if positive? inc then
while l <= h repeat
lr := concat(l, lr)
l := l + inc
@@ -169,7 +169,7 @@ Segment(S:Type): SegmentCategory(S) with
l := lo s
h := hi s
inc := (incr s)::S
- if inc > 0 then
+ if positive? inc then
while l <= h repeat
lr := concat(f l, lr)
l := l + inc
@@ -225,7 +225,7 @@ SegmentFunctions2(R:Type, S:Type): public == private where
l := lo r
h := hi r
inc := (incr r)::R
- if inc > 0 then
+ if positive? inc then
while l <= h repeat
lr := concat(f(l), lr)
l := l + inc
diff --git a/src/algebra/sf.spad.pamphlet b/src/algebra/sf.spad.pamphlet
index 1faaffe7..54dc881a 100644
--- a/src/algebra/sf.spad.pamphlet
+++ b/src/algebra/sf.spad.pamphlet
@@ -448,7 +448,7 @@ DoubleFloat(): Join(FloatingPointSystem, DifferentialRing, OpenMath,
atan(x,y) ==
zero? x =>
- y > 0 => pi()/2
+ positive? y => pi()/2
negative? y => -pi()/2
0
-- Only count on first quadrant being on principal branch.
diff --git a/src/algebra/sgcf.spad.pamphlet b/src/algebra/sgcf.spad.pamphlet
index fda88648..c6eb2ffd 100644
--- a/src/algebra/sgcf.spad.pamphlet
+++ b/src/algebra/sgcf.spad.pamphlet
@@ -186,7 +186,7 @@ SymmetricGroupCombinatoricFunctions(): public == private where
numberOfImproperPartitionsInternal(n,m,cm) ==
n = 0 => binomial(m,cm)$ICF
- cm = 0 and n > 0 => 0
+ cm = 0 and positive? n => 0
s := 0
for i in 0..n-1 repeat
s := s + numberOfImproperPartitionsInternal(i,m,cm-1)
diff --git a/src/algebra/si.spad.pamphlet b/src/algebra/si.spad.pamphlet
index bc77952c..888a40f3 100644
--- a/src/algebra/si.spad.pamphlet
+++ b/src/algebra/si.spad.pamphlet
@@ -110,7 +110,7 @@ IntegerNumberSystem(): Category ==
-- iterates in order 0,1,-1,2,-2,3,-3,...
nextItem n ==
zero? n => just 1
- n > 0 => just(-n)
+ positive? n => just(-n)
just(1-n)
patternMatch(x, p, l) ==
@@ -126,7 +126,7 @@ IntegerNumberSystem(): Category ==
r := x rem n
r = 0 => r
if negative? n then n:=-n
- r > 0 =>
+ positive? r =>
2 * r > n => r - n
r
2*r + n <= 0 => r + n
diff --git a/src/algebra/sign.spad.pamphlet b/src/algebra/sign.spad.pamphlet
index b96e13a3..3101d04c 100644
--- a/src/algebra/sign.spad.pamphlet
+++ b/src/algebra/sign.spad.pamphlet
@@ -100,7 +100,7 @@ InnerPolySign(R, UP): Exports == Implementation where
signAround(p:UP, dir:Integer, rsign:R -> U) ==
zero? p => 0
(u := rsign leadingCoefficient p) case "failed" => "failed"
- (dir > 0) or (even? degree p) => u::Integer
+ positive? dir or (even? degree p) => u::Integer
- (u::Integer)
@
diff --git a/src/algebra/solvedio.spad.pamphlet b/src/algebra/solvedio.spad.pamphlet
index 54a9330e..f83c9cb6 100644
--- a/src/algebra/solvedio.spad.pamphlet
+++ b/src/algebra/solvedio.spad.pamphlet
@@ -119,10 +119,10 @@ DiophantineSolutionPackage(): Cat == Capsule where
-- create vertices from node ind to other nodes
v := zero(k)$VI
for i in 1..k repeat
- ind > 0 =>
+ positive? ind =>
negative? coeffs.i =>
v.i := zeroNode + ind + coeffs.i
- coeffs.i > 0 =>
+ positive? coeffs.i =>
v.i := zeroNode + ind + coeffs.i
[v, true]
@@ -136,7 +136,7 @@ DiophantineSolutionPackage(): Cat == Capsule where
k := if ind < graph.zeroNode then m else n
for i in k..graph.dim repeat
x := sol.i
- v.i > 0 => -- vertex exists to other node
+ positive? v.i => -- vertex exists to other node
sol.i := x + 1
v.i = graph.zeroNode => -- solution found
verifyMinimality(sol, graph, flag) =>
@@ -174,7 +174,7 @@ DiophantineSolutionPackage(): Cat == Capsule where
k := if ind < graph.zeroNode then m else n
for i in k..graph.dim while flag repeat
x := sol.i
- x > 0 and v.i > 0 => -- vertex exists to other node
+ positive? x and positive? v.i => -- vertex exists to other node
sol.i := (x - 1) :: NI
v.i = graph.zeroNode => -- solution found
flag := false
diff --git a/src/algebra/sregset.spad.pamphlet b/src/algebra/sregset.spad.pamphlet
index 0598921f..dc961607 100644
--- a/src/algebra/sregset.spad.pamphlet
+++ b/src/algebra/sregset.spad.pamphlet
@@ -564,7 +564,7 @@ SquareFreeRegularTriangularSetGcdPackage(R,E,V,P,TS): Exports == Implementation
ts := lpwt.tower
lbwt := stoseInvertible?(leadingCoefficient(p2,v),ts)@(List BWT)
for bwt in lbwt repeat
- (bwt.val = true) and (degree(p2,v) > 0) =>
+ (bwt.val = true) and positive? degree(p2,v) =>
p3 := prem(p1, -p2)
s: P := init(p2)**(mdeg(p1) - mdeg(p2))::N
toSave := cons([[p2,p3,s],bwt.tower]$LpWT,toSave)
diff --git a/src/algebra/stream.spad.pamphlet b/src/algebra/stream.spad.pamphlet
index a51a1c51..8be08ff7 100644
--- a/src/algebra/stream.spad.pamphlet
+++ b/src/algebra/stream.spad.pamphlet
@@ -698,12 +698,12 @@ Stream(S): Exports == Implementation where
getm(x,le,n) ==
explicitlyEmpty? x => le
lazy? x =>
- n > 0 =>
+ positive? n =>
empty? x => le
getm(rst x,concat(frst(x) :: OUT,le),n - 1)
concat(message("..."),le)
eq?(x,rst x) => concat(overbar(frst(x) :: OUT),le)
- n > 0 => getm(rst x,concat(frst(x) :: OUT,le),n - 1)
+ positive? n => getm(rst x,concat(frst(x) :: OUT,le),n - 1)
concat(message("..."),le)
streamCountCoerce x ==
@@ -731,7 +731,7 @@ Stream(S): Exports == Implementation where
listm(x,le,n) ==
explicitlyEmpty? x => le
lazy? x =>
- n > 0 =>
+ positive? n =>
empty? x => le
listm(rst x, concat(frst(x) :: OUT,le),n-1)
concat(message("..."),le)
@@ -1082,7 +1082,7 @@ Stream(S): Exports == Implementation where
if S has SetCategory then
output(n,x) ==
- (not(n>0))or empty? x => void()
+ (not(positive? n)) or empty? x => void()
mathPrint(frst(x)::OUT)$Lisp
output(n-1, rst x)
diff --git a/src/algebra/sttaylor.spad.pamphlet b/src/algebra/sttaylor.spad.pamphlet
index ed89b75d..2de808ad 100644
--- a/src/algebra/sttaylor.spad.pamphlet
+++ b/src/algebra/sttaylor.spad.pamphlet
@@ -498,7 +498,7 @@ Remarks:
integer, we won't get a Taylor expansion and thus raise an error.
<<package STTAYLOR StreamTaylorSeriesOperations>>=
- if ord > 0 and negative? rn then
+ if positive? ord and negative? rn then
error "**: negative power does not exist"
@
diff --git a/src/algebra/sturm.spad.pamphlet b/src/algebra/sturm.spad.pamphlet
index d1a5b484..30c438a1 100644
--- a/src/algebra/sturm.spad.pamphlet
+++ b/src/algebra/sturm.spad.pamphlet
@@ -290,8 +290,8 @@ SturmHabichtPackage(R,x): T == C where
epsil(int1:NNI,elt1:R,elt2:R):INT ==
int1 = 0 => 0
odd? int1 => 0
- ct1:INT:=if elt1 > 0 then 1 else -1
- ct2:INT:=if elt2 > 0 then 1 else -1
+ ct1:INT:=if positive? elt1 then 1 else -1
+ ct2:INT:=if positive? elt2 then 1 else -1
ct3:NNI:=(int1 exquo 2)::NNI
ct4:INT:=(ct1*ct2)::INT
((-1)**(ct3::NNI))*ct4
diff --git a/src/algebra/syssolp.spad.pamphlet b/src/algebra/syssolp.spad.pamphlet
index 1561a89a..82218fa6 100644
--- a/src/algebra/syssolp.spad.pamphlet
+++ b/src/algebra/syssolp.spad.pamphlet
@@ -130,7 +130,7 @@ SystemSolvePackage(R): Cat == Cap where
newInF(n: Integer):F==varInF new()$SE
testDegree(f :P R , lv :L SE) : Boolean ==
- "or"/[degree(f,vv)>0 for vv in lv]
+ "or"/[positive? degree(f,vv) for vv in lv]
---- Exported Functions ----
-- solve a system of rational functions
diff --git a/src/algebra/taylor.spad.pamphlet b/src/algebra/taylor.spad.pamphlet
index e3e01da9..5c113a19 100644
--- a/src/algebra/taylor.spad.pamphlet
+++ b/src/algebra/taylor.spad.pamphlet
@@ -317,7 +317,7 @@ UnivariateTaylorSeries(Coef,var,cen): Exports == Implementation where
coefficient(x,n) ==
-- Cannot use elt! Should return 0 if stream doesn't have it.
u := stream x
- while not empty? u and n > 0 repeat
+ while not empty? u and positive? n repeat
u := rst u
n := (n - 1) :: NNI
empty? u or n ~= 0 => 0
diff --git a/src/algebra/tex.spad.pamphlet b/src/algebra/tex.spad.pamphlet
index 3b296d57..99314dff 100644
--- a/src/algebra/tex.spad.pamphlet
+++ b/src/algebra/tex.spad.pamphlet
@@ -301,7 +301,7 @@ TexFormat(): public == private where
lineConcat( line : S, lines: L S ) : L S ==
length := #line
- if ( length > 0 ) then
+ if positive? length then
-- If the last character is a backslash then split at "\ ".
-- Reinstate the blank.
@@ -367,7 +367,7 @@ TexFormat(): public == private where
ls := ls + lss + 1
s := concat(s,concat(ss," ")$S)$S
- if ls > 0 then l := lineConcat( s, l )
+ if positive? ls then l := lineConcat( s, l )
reverse l
@@ -606,14 +606,14 @@ TexFormat(): public == private where
len > 1 and str.1 = char "%" and str.2 = char "%" =>
u : US := segment(3,len)$US
concat(" \%\%",str.u)
- len > 0 and str.1 = char "%" => concat(" \",str)
+ positive? len and str.1 = char "%" => concat(" \",str)
len > 1 and digit? str.1 => group str -- should handle floats
- len > 0 and str.1 = char "_"" =>
+ positive? len and str.1 = char "_"" =>
concat(concat(" \mbox{\tt ",str),"} ")
len = 1 and str.1 = char " " => "{\ }"
- (i := position(str,specialStrings)) > 0 =>
+ positive?(i := position(str,specialStrings)) =>
specialStringsInTeX.i
- (i := position(char " ",str)) > 0 =>
+ positive?(i := position(char " ",str)) =>
-- We want to preserve spacing, so use a roman font.
concat(concat(" \mbox{\rm ",str),"} ")
str
diff --git a/src/algebra/tree.spad.pamphlet b/src/algebra/tree.spad.pamphlet
index a4249665..9dbae5b9 100644
--- a/src/algebra/tree.spad.pamphlet
+++ b/src/algebra/tree.spad.pamphlet
@@ -103,7 +103,7 @@ Tree(S: SetCategory): T==C where
t1 = t2 => 0
t2 case empty => -1
u := [n for t in children t2 | (n := distance1(t1,t)) >= 0]
- #u > 0 => 1 + "min"/u
+ positive?(#u) => 1 + "min"/u
-1
distance(t1,t2) ==
n := distance1(t1, t2)
@@ -199,7 +199,7 @@ Tree(S: SetCategory): T==C where
multipleOverbar((".")::OutputForm,eqMemberIndex(t, pl,0),pl)
empty? children t => value t::OutputForm
nodeForm := (value t)::OutputForm
- if (k := eqMemberIndex(t, pl, 0)) > 0 then
+ if positive?(k := eqMemberIndex(t, pl, 0)) then
nodeForm := multipleOverbar(nodeForm, k, pl)
prefix(nodeForm,
[coerce1(br,cons(t,parents),pl) for br in children t])
diff --git a/src/algebra/twofact.spad.pamphlet b/src/algebra/twofact.spad.pamphlet
index eb0bad93..2161c9a2 100644
--- a/src/algebra/twofact.spad.pamphlet
+++ b/src/algebra/twofact.spad.pamphlet
@@ -176,7 +176,7 @@ TwoFactorize(F) : C == T
ll:=[]
unitPart:P
cont:=content m
- if degree(cont)>0 then
+ if positive? degree(cont) then
m1:=m exquo cont
m1 case "failed" => error "content doesn't divide"
m:=m1
diff --git a/src/algebra/unifact.spad.pamphlet b/src/algebra/unifact.spad.pamphlet
index 4d5d874b..ab5a3e8e 100644
--- a/src/algebra/unifact.spad.pamphlet
+++ b/src/algebra/unifact.spad.pamphlet
@@ -253,7 +253,7 @@ UnivariateFactorize(ZP) : public == private where
m := -m
-- is x**d factor of m?
- if (d := minimumDegree m) >0 then
+ if positive?(d := minimumDegree m) then
m := (monicDivide(m,monomial(1,d))).quotient
factorlist := [[monomial(1,1),d]$ParFact]