aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ChangeLog5
-rw-r--r--src/algebra/indexedp.spad.pamphlet25
2 files changed, 19 insertions, 11 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index ac33f792..4534563d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,10 @@
2013-05-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
+ * algebra/indexedp.spad.pamphlet
+ (IndexedDirectProductOrderedAbelianMonoid) [<]: Rewrite iteratively.
+
+2013-05-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
* algebra/catdef.spad.pamphlet (AbelianMonoid) [opposite?]: New.
(Rng)[annihilate?]: New.
(EntireRing) [annihilate?]: Implement.
diff --git a/src/algebra/indexedp.spad.pamphlet b/src/algebra/indexedp.spad.pamphlet
index c296f271..ad4ae9c8 100644
--- a/src/algebra/indexedp.spad.pamphlet
+++ b/src/algebra/indexedp.spad.pamphlet
@@ -249,18 +249,21 @@ IndexedDirectProductAbelianMonoid(A:AbelianMonoid,S:OrderedType):
IndexedDirectProductOrderedAbelianMonoid(A:OrderedAbelianMonoid,S:OrderedType):
Join(OrderedAbelianMonoid,IndexedDirectProductCategory(A,S))
== IndexedDirectProductAbelianMonoid(A,S) add
- --representations
- Term:= Record(k:S,c:A)
- Rep:= List Term
- x,y: %
x<y ==
- empty? y => false
- empty? x => true -- note careful order of these two lines
- y.first.k > x.first.k => true
- y.first.k < x.first.k => false
- y.first.c > x.first.c => true
- y.first.c < x.first.c => false
- x.rest < y.rest
+ u := terms x
+ v := terms y
+ repeat
+ -- note careful order of next two lines
+ empty? v => return false
+ empty? u => return true
+ xt := first u
+ yt := first v
+ index xt < index yt => return true
+ index yt < index xt => return false
+ coefficient xt < coefficient yt => return true
+ coefficient yt < coefficient xt => return false
+ u := rest u
+ v := rest v
@
\section{domain IDPOAMS IndexedDirectProductOrderedAbelianMonoidSup}