Hello Waldek,
during compilation of a package of mine, I get a warning. I think that
this should not appear since I believe that everything is fine.
Warnings:
[1] findIdentity: not known that (QEtaAlgebra C) is of mode
(CATEGORY domain (SIGNATURE * ($ C $)) (IF (has (Finite0Series C (QUOTE
q) (Zero)) (QEtaGradedAlgebra C)) (ATTRIBUTE (QEtaGradedAlgebra C))
noBranch) (IF (has (Finite0Series C (QUOTE q) (Zero)) (XEtaGradedAlgebra
C)) (ATTRIBUTE (XEtaGradedAlgebra C)) noBranch))
Clearly, it is hard for you to figure out where it comes from, but the
actual code is too big to post it here. Let me give more details. I
actually would like to know whether you think that it is worth it to
investigate further.
A1 C ==> Finite0Series(C, 'q, 0)
CA1 C ==> QEtaAlgebraCachedPower(C, A1 C)
CPol C ==> QEtaAlgebraCachedPower(C, Pol C)
X1 C ==> QEtaExtendedAlgebra(C, CA1 C, CPol C)
toX1(C, a, b) ==> embed(a::CA1(C), b::CPol(C))$X1(C)
The warning starts to appear when I use/compile toX1(f, pol) in another
package.
Since the QEtaAlgebraCachedPower it only a wrapper domain, I can also
compile without it.
X1 C ==> QEtaExtendedAlgebra(C, A1 C, Pol C)
toX1(C, a, b) ==> embed(a, b)$X1(C)
In that case no warnig appears.
So let's look at
QEtaAlgebraCachedPower(C, A): Exports == Implementation where
C: CommutativeRing
A: Join(Monoid, AbelianGroup) with
_*: (C, %) -> %
Exports ==> Join(Monoid, AbelianGroup, CoercibleFrom A, CoercibleTo A)
with
_*: (C, %) -> %
if A has QEtaGradedAlgebra C then QEtaGradedAlgebra C
if A has XEtaGradedAlgebra C then XEtaGradedAlgebra C
Implementation ==> CachedPower A add ...
Finit0Series is definitely of category QEtaGradedAlgebra (which is an
extension of QEtaAlgebra by a few functions connected to grading).
So compiler knows that QEtaExtendedAlgebra is to be compiled with
arguments that are of type QEtaGradedAlgebra.
It seems that the compiler is unable to figure out during compilation of
embed(a::CA1(C), b::CPol(C))$X1(C) that the arguments for
QEtaExtendedAlgebra are perfectly fine of type QEtaGradedAlgebra. All
information is there.
My guess is that the compiler is a bit weak to conclude from the fact
that A in QEtaAlgebraCachedPower(C, A) is of type QEtaGradedAlgebra,
also QEtaAlgebraCachedPower(C, A) is of type QEtaGradedAlgebra and
therefore throws the warning at me.
Well, it is only a warning, but if warings appear when they shouldn't
that is irritating.
BTW, so far I detected no problem at runtime.
Ralf
--
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/3fdc57f7-867b-f9ff-8179-a272a64176c7%40hemmecke.org.