First of all, thanks Waldek!
I cannot yet say whether I can fix ax.boot easily, but at least your
hints sound better than I thought.
AFAICS the relevant code in ax.boot is triggered by '$pretendFlag'.
You may try to see what happens when '$pretendFlag' is always false.
I am affraid this code is necessary: it looks that pretends try
tu say that arguments have expected types.
Well, that is something I don't actually believe. IIUC, the .ap format
is basically aldor synax in a lisp-like form. Since Aldor itself does
not need a "pretend" in the body of an "if dom has cat then ..."
construction, I don't think the |PretendTo| would be necessary in the
.ap file. I'll report back after checking.
Maybe, I should also contact Peter Broadbery. Perhaps, he knows why this
code got into ax.boot in the first place.
Assumung that Spad
compiler already checked arument types it is reasonable strategy.
I don't quite understand. Let's make an artificial example.
CatA(T: SemiRng): Category == with
foo: % -> %
if T has Ring then
bar: % -> %
CatB(X: AbelianMonoid): Category == with
if X has Ring then CatA(X)
Should Cat(Integer) be exporting bar or not? I think, it should, if CatB
is translated as you say then it would mean
if Integer has Ring then CatA(Integer pretend SemiRng)
I already had difficulties understanding how "has" works and probably
the "pretend SemiRng" will not prevent "T has Ring" to return true for
T=Integer. Still, it looks a bit confusing to me.
====================================
from PFO.ap
====================================
(|If| (|Test| (|Has| |#1| |CharacteristicZero|))
(|If| (|Test| (|Has| |#2| |AlgebraicallyClosedField|))
(|Declare| |simplifyCoeffs|
(|Apply| ->
(|Comma|
(|Apply| |FiniteDivisor| (|PretendTo| |#2| |Field|)
(|PretendTo| |#3|
(|Apply| |UnivariatePolynomialCategory|
(|PretendTo| |#1| |Ring|)))
^^^^^^^^^^^^^^^^^^^^^^^^
This is wrong, insted we should have (|PretendTo| |#2| |Field|).
Aha, that's a good catch. I also wanted to see |Field| there, but that
also the |#1| is wrong, I didin't see. Thanks a lot.
Ralf
--
You received this message because you are subscribed to the Google Groups "FriCAS -
computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/fricas-devel?hl=en.