I was not careful enough when I prepared the report, because I actually
wanted to show this one.
After applying the patch, the errors disappear.
Obviously, the compiler delays instantiation if the type arguments are
not constant and then forgets to instantiate the default implementation
of the category UnivariateLaurentSeriesConstructorCategory.
https://github.com/fricas/fricas/blob/master/src/algebra/laurent.spad#L71
As the patch shows that can easily be resolved, but I think it is the
wrong patch since such a construction might also happen with other
categories.
Waldek, would it be easy to fix the compiler?
Ralf
(1) -> Q ==> Fraction Integer
Type:
Void
(2) -> SUPQ ==> SUP(Q)
Type:
Void
(3) -> mp: SUPQ := monomial(1, 2)$SUPQ + 1
2
(3) ? + 1
Type:
SparseUnivariatePolynomial(Fraction(Integer))
(4) -> C ==> SimpleAlgebraicExtension(Q, SUPQ, mp)
Type:
Void
(5) -> f0()$Bar(C)
Type:
Void
(6) -> f1()$Bar(C)
Function: laurent : (Integer,
UnivariateTaylorSeries(SimpleAlgebraicExtension(Fraction(Integer),SparseUnivariatePolynomial(Fraction(Integer)),?^2+1),q,0))
-> % is missing from domain:
UnivariateLaurentSeries(SimpleAlgebraicExtension(Fraction(Integer),SparseUnivariatePolynomial(Fraction(Integer)),?^2+1),q,0)
Internal Error
The function laurent with signature $(Integer)
(UnivariateTaylorSeries (SimpleAlgebraicExtension (Fraction
(Integer)) (SparseUnivariatePolynomial (Fraction (Integer))) ((2 1 . 1)
(0 1 . 1))) q 0)
is missing from domain UnivariateLaurentSeries
(SimpleAlgebraicExtension (Fraction (Integer))
(SparseUnivariatePolynomial (Fraction (Integer))) ((2 1 . 1) (0 1 . 1)))
(QUOTE q)0
(6) -> f0()$Bar(Q)
Type:
Void
(7) -> f1()$Bar(Q)
>> System error:
The value
0
is not of type
CONS
--
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/cc6ab64d-da6b-5c2e-9f94-87c8789ec50a%40hemmecke.org.
)abbrev domain FOO Foo
Foo(C: IntegralDomain, L: UnivariateLaurentSeriesCategory C, xi: C): with
px: () -> Void
== add
px(): Void == laurent(0, [1,1,1,1]$List(C)::Stream(C))$L
)abbrev package BAR Bar
Bar(C: IntegralDomain): with
f0: () -> Void
f1: () -> Void
== add
f0(): Void ==
px()$Foo(C, UnivariateLaurentSeries(C, 'q, 0), 1$C)
f1(): Void ==
xi: C := 1
px()$Foo(C, UnivariateLaurentSeries(C, 'q, 0), xi)
-------------------------------------------------------------------
)fin
-------------------------------------------------------------------
)clear complete
)co foo.spad
Q ==> Fraction Integer
SUPQ ==> SUP(Q)
mp: SUPQ := monomial(1, 2)$SUPQ + 1
C ==> SimpleAlgebraicExtension(Q, SUPQ, mp)
f0()$Bar(C)
f1()$Bar(C)
f0()$Bar(Q)
f1()$Bar(Q)
From f5c61e7a75fe9dccf7da4056ee19a67c4f871426 Mon Sep 17 00:00:00 2001
From: Ralf Hemmecke <[email protected]>
Date: Tue, 3 Nov 2020 00:17:26 +0100
Subject: fix category-default problem
---
src/algebra/laurent.spad | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/algebra/laurent.spad b/src/algebra/laurent.spad
index 3f5dc7c3..f055863c 100644
--- a/src/algebra/laurent.spad
+++ b/src/algebra/laurent.spad
@@ -555,6 +555,7 @@ UnivariateLaurentSeries(Coef, var, cen) : Exports == Implementation where
variable x == var
center x == cen
+ laurent(n: I, s: Stream Coef): % == laurent(n, series(s)$UTS)
coerce(v : Variable(var)) ==
zero? cen => monomial(1, 1)
--
2.17.1