axiom-mail
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-mail] Type of Expression Problem


From: Hans Peter Würmli
Subject: Re: [Axiom-mail] Type of Expression Problem
Date: Wed, 16 Nov 2005 22:36:28 +0100
User-agent: KMail/1.7.2

Hi Martin

>
> this follows the documentation: binomial(n-1,k)/binomial(n,k) is not a
> rational function, but normalize(e2) is:
>
>         n - k
>    (3)  -----
>           n
>                                                      Type: Expression
> Integer
>
> Note the type information: it is still EXPR INT. After retraction it
> becomes Fraction Integer!

I chose the example, because I knew it would work. The issue I have with it is 
the dependence on a particular representation. 1/2=2/4=...=k/k*2 all 
represent the same rational number, but you wouldn't like to depend on a 
particular representation of 1/2 to operate on it. In the example above the 
coercion / retraction / conversion is no mapping from Expression Integer to 
Fraction Polynomial Integer, but from a particular Expression Integer to 
Fraction Polynomial Integer.

> > I manage now, but then my naive approach was to take a polynomial, say,
> > p[n], and substitute n for N: subst(p,n=N) or eval(p,n=N), something that
> > fails miserably. Nevertheless, the idea of substitution is so general
> > that one would expect that Axiom would allow it.
>
> I hope you use HyperDoc:
>
> browse POLY
> select operations
> notice that there is no subst, but there is eval
> select eval
> select descriptions...

Yes, of course, but my question would be: is that the behaviour that a user 
should expect. (The other is choice of language: what is called eval to me 
rather is subst, but I guess there must have been a good reason for the 
founders' choice.)

Say, to take another example, you have a polynomial (in standard math 
notation) k in K[x], e.g. k=k0+k1 x +...+kn x^n. Would you regard h=k0+k1 
y+...+kn y^n the same or a different Polynomial? Axiom would regard these as 
different.

Substitution (or evaluation, if you like) in my view is very natural, so it is 
not crazy to expect Axiom to allow it to the greatest extent possible. For 
example, let K[x] operate on, say, operators on a linear space {L:A->B} by 

k (L) :=k0 + k1 L + ... + kn L^n

which is as much as "substitute x by L".

> So what you want is eval(p,n,N) where N has to be of Type Poly. For
> example, it could be N::POLY INT

Yes, eval wants it this way, but I had defined N to be the forward difference 
operator.

> (In the interpreter you don't have to specify anything, it does all the
> type coercions for you)

My claim would be that more often than not, the Interpreter can't find the 
proper coercion. E.g. tt seems to me that every coercion A->C where the 
Interpreter would have to find coercion A->B and coercion B->C the 
Interpreter seems to require support.

> > my primary goal would not be to have some representation, but to be able
> > to represent the recurrences as naturally as possibly, natural meaning as
> > close to standard math language as possible.
>
> This is a different matter. I think that you should decide what you want to
> implement: Zeilbergers algorithm or coercion of holonomic functions to
> expressions. The latter might be more tricky, but I don't know.

The decision might be to try both -:)

I am not desperate to implement anything. My primary goal is to learn and 
enjoy the beauty of mathematics and programming (in the little spare time I 
have). Tastes are different, of course, but an algorithm that is clean, 
natural and easy to understand is preferable to me (and easiest to generalise 
or to make more efficient). 

Somehow I have the dream that a CAS supports you the way you are used to 
sketch your examples and allows you later to be rigorous. Of the systems I 
know Axiom certainly comes closest to this ideal, but there is not only a 
steep learning curve to take (and I am at the beginning), but also room to 
improve on.

Thanks and cheers, H.P.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]