On Tue, Apr 30, 2024 at 04:12:59PM +0200, Ralf Hemmecke wrote:
> I must be doing something wrong, but I do not see what.
>
> Attached you can find a minimal example that does not compile
> if line (*1) is uncommented. The compiler has no problem to compile
> the cases (*2) and (3).
>
> I thought that the Join with two categories might be a problem, but no such
> things appear in the FriCAS algebra sources, for example, in rec.spad.
Thanks for the testcase. There was missing transformation, before
main compile in effect your program was transformed into a wrong
form (not handled by the rest of compiler). The following worked:
)abbrev package Q1PI QEtaOneOverPi
QEtaOneOverPi(C): Exports == Implementation where
C: IntegralDomain
NN ==> NonNegativeInteger
Exports ==> with
if C has OrderedRing and C has Field then -- OK
-- if C has Join(OrderedRing,Field) then -- mistransformed
kleinJInterval: (NN, C, C, C) -> Segment C
Implementation ==> add
foo(): Integer == 1
Early transformation was supposed to transform your Join into
'and' above. However, the 'and' was supposed to be transformed
in turn into:
)abbrev package Q1PI QEtaOneOverPi
QEtaOneOverPi(C): Exports == Implementation where
C: IntegralDomain
NN ==> NonNegativeInteger
Exports ==> with
if C has OrderedRing then
if C has Field then -- OK
kleinJInterval: (NN, C, C, C) -> Segment C
Implementation ==> add
foo(): Integer == 1
and this transformation happended when 'and' was explicit in the
source, but did not happen with generated 'and'. Fixed now.
BTW: Those transformations are applicable only to 'Join' within 'has'.
Existing 'Join'-s withing 'has' in the algebra where inside 'and', which
masked the problem (needed transformation happended as part of
processing of 'and' and 'if').
--
Waldek Hebisch
--
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/ZjGEa2oLU8wgPmm5%40fricas.org.