Hello,
FriCAS does not have LaurentPolynomial. However, one can easily create
(a simple approximation of) them as
(1) -> PolynomialRing(Fraction(Integer),DirectProduct(3,Integer))
PolynomialRing(Fraction(Integer),DirectProduct(3,Integer)) is not a
valid type.
Ooops... why doesn't that work?
The reason is the line
https://github.com/hemmecke/fricas/blob/master-hemmecke/src/algebra/vector.spad#L295
if R has OrderedAbelianMonoidSup then OrderedAbelianMonoidSup
in DirectProductCategory. Although only OrderedAbelianMonoid would be
required for the above creation via PolynomialRing, it cannot yet be done.
Easiest way to solve that problem, is to add
if R has OrderedAbelianMonoid then OrderedAbelianMonoid
to DirectProductCategory.
Easy patch, but I do not propose it right now, because there is more and
I want to hear opinions.
DirectProduct(n,R) only exports OrderedAbelianMonoidSup, if R is of type
OrderedAbelianMonoidSup. Clearly, this sup function
http://fricas.github.io/api/OrderedAbelianMonoidSup.html#l-ordered-abelian-monoid-sup-sup
sup: (%, %) -> %
sup(x, y) returns the least element from which both x and y can be
subtracted.
is mainly used for reductions. But the specification is a bit vague.
Why doesn't have Integer such a function? Yes, there would be no "least"
element. But what does "least" in this specification mean anyway? Is it
the smallest with respect to the < order of the domain?
Then clearly, Integer cannot have this.
However, the idea of this function is to achieve "positiveness", i.e.,
if c = sup(a, b) then c-a>=0 and c-b>=0. Right? Wouldn't it make sense
to add this condition to the "sup" specification. Then also Integer and
Fraction Integer can be of type OrderedAbelianMonoidSup.
Furthermore, I don't see a good reason why OrderedDirectProduct,
HomogeneousDirectProduct and SplitHomogeneousDirectProduct require
their argument to be of type OrderedAbelianMonoidSup. Without the "Sup"
would be sufficient.
What is your opinion?
Ralf
=====================================================================
diff --git a/src/algebra/gdirprod.spad b/src/algebra/gdirprod.spad
index e6133360..c89b3209 100644
--- a/src/algebra/gdirprod.spad
+++ b/src/algebra/gdirprod.spad
@@ -83,7 +83,7 @@ OrderingFunctions(dim, S) : T == C where
++ \spadtype{GeneralDistributedMultivariatePolynomial}.
OrderedDirectProduct(dim : NonNegativeInteger,
- S : OrderedAbelianMonoidSup,
+ S : OrderedAbelianMonoid,
f : (Vector(S), Vector(S))->Boolean) : T
== C where
T == DirectProductCategory(dim, S)
@@ -108,7 +108,7 @@ OrderedDirectProduct(dim : NonNegativeInteger,
HomogeneousDirectProduct(dim, S) : T == C where
dim : NonNegativeInteger
- S : OrderedAbelianMonoidSup
+ S : OrderedAbelianMonoid
T == DirectProductCategory(dim, S)
C == DirectProduct(dim, S) add
@@ -147,7 +147,7 @@ HomogeneousDirectProduct(dim, S) : T == C where
SplitHomogeneousDirectProduct(dimtot, dim1, S) : T == C where
NNI ==> NonNegativeInteger
dim1, dimtot : NNI
- S : OrderedAbelianMonoidSup
+ S : OrderedAbelianMonoid
T == DirectProductCategory(dimtot, S)
C == DirectProduct(dimtot, S) add
diff --git a/src/algebra/vector.spad b/src/algebra/vector.spad
index 8c9c5aa7..dd9eb665 100644
--- a/src/algebra/vector.spad
+++ b/src/algebra/vector.spad
@@ -292,6 +292,7 @@ DirectProductCategory(dim : NonNegativeInteger, R :
Type) : Category ==
CommutativeRing
if R has unitsKnown then unitsKnown
if R has OrderedSet then OrderedSet
+ if R has OrderedAbelianMonoid then OrderedAbelianMonoid
if R has OrderedAbelianMonoidSup then OrderedAbelianMonoidSup
if R has Field then VectorSpace R
add
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/a3650c89-8e1f-fb24-29a5-f4c0aff3ffea%40hemmecke.org.