Dear FriCAS group,
thinking about writing in Aldor instead of SPAD (to have better error
messages and maybe less quirks) I came across a few issues. As an example I
want to (again) write a wrapper over Taylor series with a subsequent
'approximate' (see code below).
There seems to be an issue finding 'approximate' from
UnivariateTaylorSeries (available through UnivariatePowerSeriesCategory):
[L32 C62] #1 (Error) There are no suitable meanings for the operator
`approximate$UnivariateTaylorSeries(Expression(Integer), sym, x...'.
I was thinking that this might likely be the same issue as with SPAD, that
is I have to check whether Expression(Integer) has the approriate 'coerce'
and '^' operations. Unfortunately this does not seem solve the problem, and
with the additional conditions as below 'taytest' is also no longer exposed.
I'd be happy about any suggestions.
---- SNIP ----
#include "fricas"
EI ==> Expression(Integer);
-- in SPAD
-- if ECFI has coerce : Symbol -> ECFI and
-- ECFI has _^ : (ECFI, Fraction (Integer)) -> ECFI then
TaylorPackage: with {
if EI has with { coerce: Symbol -> EI } and EI has with { ^: (EI,
NonNegativeInteger) -> EI } then {
taytest: (EI,EI,Symbol) -> EI;
};
testfun : Integer -> Integer;
} == add {
testfun(x: Integer) : Integer == {
x
};
taytest(ex: EI, x0: EI, sym: Symbol) : Expression(Integer) == {
import from Integer;
import from NonNegativeInteger;
import from
ExpressionToUnivariatePowerSeries(Integer,Expression(Integer));
import from Equation(EI);
import from UnivariateTaylorSeries(EI,sym,x0);
local test : UnivariateTaylorSeries(EI,sym,x0) := retract(taylor(ex,
equation(sym::EI, x0)))$AnyFunctions1(UnivariateTaylorSeries(EI, sym, x0));
--local approx := approximate(test,3 ::
NonNegativeInteger)$UnivariateTaylorSeries(EI,sym,x0);
1
};
};
---- SNIP ----
Is there a way to completely erase a package from the interpreter
environment? For example, even after a ")clear completely", ")show
TaylorPackage" still shows that this domain is "available". Sometimes it
seems that I have to recompile/load packages twice or restart FriCAS,
especially after a type signature has changed (that is even after ")clear
completely").
Is there a noticeable performance difference between SPAD and Aldor
compiled programs? I'm surprised that for the small test code I have
written the generated Lisp code is several times smaller with SPAD. Maybe
there is a lot of "auxiliary" code generated with Aldor that isn't involved
or used, but if there is a real factor of ~5-10 overhead, it's something to
think about.
Thanks,
Tobias
--
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/d75a6183-49f3-49b5-87fc-599a7cfc7f26n%40googlegroups.com.