compiler bug (?)

18 views
Skip to first unread message

Ralf Hemmecke

unread,
Nov 1, 2020, 4:30:58 PM11/1/20
to fricas-devel
I struggle with a problem that I believe is due to a compiler bug.

With the attached program and

)co foo.spad
findIdentity()$QEtaRamanujanKolberg(Fraction Integer)

I get

(1) -> findIdentity()$QEtaRamanujanKolberg(Fraction Integer)
[:> , foo, 1]
Function: laurent : (Integer, Stream(Fraction(Integer))) -> % is
missing from domain:
UnivariateLaurentSeries(SimpleAlgebraicExtension(Fraction(Integer),SparseUnivariatePolynomial(Fraction(Integer)),?^2+1),q,0)
Internal Error
The function laurent with signature $(Integer)
(Stream (Fraction (Integer))) is missing from domain
UnivariateLaurentSeries
(SimpleAlgebraicExtension (Fraction (Integer))
(SparseUnivariatePolynomial (Fraction (Integer))) ((2 1 . 1) (0 1 . 1)))
q

When I uncooment the line

-- px()$SiftedEtaQuotientGamma(C, L1 CX)

The result is:

(1) -> findIdentity()$QEtaRamanujanKolberg(Fraction Integer)
Internal Error
The function px with signature () -> UnivariateLaurentSeries(
SimpleAlgebraicExtension(Fraction(Integer),
SparseUnivariatePolynomial(Fraction(Integer)),?^2+1),q,0) is
missing from domain SiftedEtaQuotientGamma(Fraction (Integer))
(UnivariateLaurentSeries (SimpleAlgebraicExtension (Fraction
(Integer)) (SparseUnivariatePolynomial (Fraction (Integer))) ((2 1 . 1)
(0 1 . 1))) (QUOTE q) 0)

I cannot explain the second problem, but the missing "laurent" signature
seems to come from the fact that laurent: (Integer, Stream Coef) -> % is
implemented here

laurent(n: I, st: Stream Coef): % == laurent(n, series(st)$UTS)

https://github.com/fricas/fricas/blob/master/src/algebra/laurent.spad#L71

ad a category default. And seemingly that category default does not apply.

Any idea what is the real problem?

Ralf
foo.spad

Kurt Pagani

unread,
Nov 1, 2020, 5:25:56 PM11/1/20
to fricas...@googlegroups.com
QETARKA -->
Warnings:
[1] findRelation: not known that (UnivariateLaurentSeriesCategory C) is of
mode (CATEGORY domain (SIGNATURE coerce ($ (Variable (QUOTE q)))) (SIGNATURE
differentiate ($ $ (Variable (QUOTE q)))) (IF (has CX (Algebra (Fraction
(Integer)))) (SIGNATURE integrate ($ $ (Variable (QUOTE q)))) noBranch))

Looks like a CAT error, or Join(Algebra Q, EuclideanDomain) is simply not enough?


On 01.11.2020 22:30, Ralf Hemmecke wrote:
> findIdentity()$QEtaRamanujanKolberg(Fraction Integer)

Ralf Hemmecke

unread,
Nov 3, 2020, 12:20:54 PM11/3/20
to fricas...@googlegroups.com
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
foo.spad
0001-fix-category-default-problem.patch
Reply all
Reply to author
Forward
0 new messages