Ralf Hemmecke <[email protected]> writes:
>>> gusesADE: List(K) -> (SUP(K), INI(K))
>
>>> Why not simply returning a polynomial as described in (7)?
>
>> well, apart that it's not univariate, that's of course one possibility.
>> However, I wanted that
>>
>> res := guessADE [n^n/factorial n for n in 0..12]
>> eval(first res, 'n=30)
>>
>> works.
>
> OK, that is your design decision.
>
> Mine would be different. I would have all you guess* functions
> returning very specific types and then have wrapper functions that
> turn the specific type into expression integer. A user could then
> choose what is best for him.
That's certainly a reasonable idea. However, what should be the type of
the example (1) below?
>> (1) -> res := guess([product(1+factorial k, k=0..n-1) for n in 0..6],
>> [guessPRec], [guessProduct])
>>
>> n - 1
>> ++-++
>> (1) [ | | [f(p ): f(p + 1) + (- p - 1)f(p ) + p = 0,f(0)= 2]]
>> | | 7 7 7 7 7
>> p = 0
>> 7
>
> You believe that I understand that output?
given what I tried to clarify so far, I was hoping so. It is
\prod_{p=0}^{n-1} f(p)
where f(p) is given by the recurrence
f(n+1) = (n + 1) f(n) - n; f(0) = 2
(as it turns out, f(n) = n! + 1)
> And by the way, if you use Expression(Integer) only because you can
> have nice output,
no, that's not the reason at all. I know well how to use OutputForm.
> Since in mantepse.spad I don't actually see Expression(...) as an
> input, can you (apart from you design decision above) say why you
> actually need the Expression domain at all? My suspicion is that like
> with the (multivariate) polynomial that could be used as the return
> type for guessADE, you might have more specific types for all the
> other functions, too.
I cannot find a reasonable type for guess (for guessing products and
sums), guessBinRat and guessExpRat , and I'm not sure what types I
should introduce at all. Eg., should guessPade, guessAlg, guessHolo,
guessADE, guessFE return different types or not? (certainly we have
guessPade < guessAlg < guessHolo < guessADE
where x < y means that every x is also an y.) That's certainly a nice
hierarchy, and I'd really like to have such types. How about
guessHolo(q) and guessADE(q)
and
guessFE
(the latter class doesn't seem to enjoy any useful closure properties).
Concerning types for sequences: how should I deal with the problem, that
an equation returned by guessRec does not necessarily determine a formal
power series, eg:
(39) -> guessRec [1,1,1,0,0,1,0,0,1,0]
2
(39) [[f(n): - f(n) + f(n)= 0]]
Type: List(Expression(Integer))
> I agree that Expression(..) is nice if you want to program a
> prototype, but I would really think twice to use it in a library
> program.
As a matter of fact, the guessing package is really intended to be used
by the end user only, and will probably always be a prototype. Eg.,
currently I'm trying to add guessing in the Dirichlet ring. Quite
experimental...
All the best,
Martin
--
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.