aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/gbeuclid.spad.pamphlet
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@axiomatics.org>2016-01-17 22:53:01 -0800
committerGabriel Dos Reis <gdr@axiomatics.org>2016-01-17 22:53:01 -0800
commitd07fc9735f40e545edda456e15dbab783c500f6a (patch)
tree4d9fab82a7085b73a4b00d23389935503fdfc90d /src/algebra/gbeuclid.spad.pamphlet
parent5437d438937eb25eb320fef6e4fd6ebc91ca6dc9 (diff)
downloadopen-axiom-d07fc9735f40e545edda456e15dbab783c500f6a.tar.gz
subtractIfCan$CancellationAbelianMonoid: return the more principled Maybe %
Diffstat (limited to 'src/algebra/gbeuclid.spad.pamphlet')
-rw-r--r--src/algebra/gbeuclid.spad.pamphlet10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/algebra/gbeuclid.spad.pamphlet b/src/algebra/gbeuclid.spad.pamphlet
index 963e210b..5b708afc 100644
--- a/src/algebra/gbeuclid.spad.pamphlet
+++ b/src/algebra/gbeuclid.spad.pamphlet
@@ -389,9 +389,8 @@ EuclideanGroebnerBasisPackage(Dom, Expon, VarSet, Dpol): T == C where
ds:= degree s
lf1:= leadingCoefficient(f1)
ls:= leadingCoefficient(s)
- e: Union(Expon, "failed")
- (((e:= subtractIfCan(ds, degree f1)) case "failed" ) or sizeLess?(ls, lf1) ) =>
- eRed(s, rest(H), Hh)
+ e := subtractIfCan(ds, degree f1)
+ ((e case nothing) or sizeLess?(ls, lf1) ) => eRed(s, rest(H), Hh)
sdf1:= divide(ls, lf1)
q1:= sdf1.quotient
sdf1.remainder = 0 =>
@@ -414,9 +413,8 @@ EuclideanGroebnerBasisPackage(Dom, Expon, VarSet, Dpol): T == C where
--- crit M - true, if lcm#2 multiple of lcm#1
ecritM(e1: Expon, c1: Dom, e2: Expon, c2: Dom) ==
- en: Union(Expon, "failed")
- ((en:=subtractIfCan(e2, e1)) case "failed") or
- ((c2 exquo c1) case "failed") => false
+ en := subtractIfCan(e2, e1)
+ (en case nothing) or ((c2 exquo c1) case "failed") => false
true
----------------------------