aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@axiomatics.org>2016-02-04 19:59:45 -0800
committerGabriel Dos Reis <gdr@axiomatics.org>2016-02-04 19:59:45 -0800
commitde24fd0cab54a21333221f0678f33787d74a5355 (patch)
tree3a2cf07e12cd09a4a91f8e74b760426f40e2691f /src
parent9193f9852190e4b72e094fac1e18994a940cd1d0 (diff)
downloadopen-axiom-de24fd0cab54a21333221f0678f33787d74a5355.tar.gz
Add leadingTerm to IndexedDirectProductCategory
Diffstat (limited to 'src')
-rw-r--r--src/algebra/indexedp.spad.pamphlet15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/algebra/indexedp.spad.pamphlet b/src/algebra/indexedp.spad.pamphlet
index c6ce02a1..6e131135 100644
--- a/src/algebra/indexedp.spad.pamphlet
+++ b/src/algebra/indexedp.spad.pamphlet
@@ -40,6 +40,8 @@ IndexedDirectProductCategory(A:BasicType,S:OrderedType): Category ==
++ leadingSupport(z) returns the index of leading
++ (with respect to the ordering on the indexing set) monomial of z.
++ Error: if z has no support.
+ leadingTerm : % -> IndexedProductTerm(A,S)
+ ++ The leading term of an indexed product.
reductum: % -> %
++ reductum(z) returns a new element created by removing the
++ leading coefficient/support pair from the element z.
@@ -106,15 +108,12 @@ IndexedDirectProductObject(A,S): Public == Private where
x = y == rep x = rep y
monomial(r,s) == per [term(s,r)]
map(f,x) == per [term(index tm,f coefficient tm) for tm in rep x]
+ leadingTerm x ==
+ null terms x => error "Cannot take the leadingTerm of an empty product"
+ first terms x
reductum x == per rest rep x
- leadingCoefficient x ==
- null rep x =>
- error "Can't take leadingCoefficient of empty product element"
- coefficient first rep x
- leadingSupport x ==
- null rep x =>
- error "Can't take leadingCoefficient of empty product element"
- index first rep x
+ leadingCoefficient x == coefficient leadingTerm x
+ leadingSupport x == index leadingTerm x
terms x == rep x
convert l == per l
combineWithIf(u, v, f, p) ==