On Fri, Apr 02, 2021 at 02:35:56PM -0700, Tobias Neumann wrote:
> EI ==> Expression(Integer)
> ups := UnivariatePuiseuxSeries(EI,'t,0)
>
> leadingTerm(monomial(1, 1/2)$ups)$ups
>
> Internal Error
> The function leadingTerm with signature hashcode is missing from
> domain UnivariatePuiseuxSeries(Expression (Integer))t((0 . 0) 0 . 1)
>
> It seems like this is just missing implementation in the series expansion
> domains, just like `leadingSupport`, unless I'm overlooking something.
In general I try to implement all officially declared functions.
However, in case of series domains it is not clear if we should
add fake implementations (as done for several other functions)
or remove problematic signatures.
Basically tradeoffs are:
- "proper" algoritms dealing with series will use things
like two argument 'order' and only extract terms of
specified order
- nor-series algoritms sometimes work for series, but to use
them we need fakes (fake '=', one argument 'order', etc..).
It is tempting to add more fakes to series domains, to make
it easier to use series in naive way. OTOH, Boot code in
'src/interp' nicely shows mess that appears when naive
approach is continued too long. Missing signatures give
reasonably early warning about potential problems. Fakes
delay problem, which may be good enough for immediate
need (if algorthm using fakes finishes without trouble),
but are essebtially debt to be payed in the future:
moving forward we will have either to carefully validate
involved code or possibly discard it.
Important part in programming, particularly for series
is finding good patterns. Current series patterns do
not need 'leadingTerm'. So it is not clear for me
if we really need it.
BTW: Of course the fundamental problem is zero series. In
few rare cases we can recognize explicit zero series. But
otherwise code dealing with series must be aware of possibility
of zero series. Namely, a lot of classical (non-series)
algorithms produce zeros at various intermediate steps.
Such zeros need proper handling, otherwise algorithm
applied to series will fail from time to time.
BTW2: Alternatively to leaving them undefined we could
define them like this:
leadingTerm(s) == error "Do not use leadingTerm for series"
or maybe:
leadingTerm(s) == error "leadingTerm: not supported for series"
This is generic implementation that could be added to appropriate
category.
--
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/20210402233558.GA34724%40math.uni.wroc.pl.