Re: A pattern matching question

Martin Rubey <[email protected]>
Newsgroups gmane.comp.mathematics.axiom.user
Message-ID <[email protected]>
Themos Tsikas <[email protected]> writes:

> --try this in an input file
> 
> tt:=operator 'tt
> ttrules := rule
>   tt(n^(a | integer?(a))) == t/a
>   tt(n/(n-1)) == 1/t
>   tt(n/(n^a+(X | integer?(a) and (n-1)^a = n^a +X))) == 1/t^a
> 
> ttrules tt(n^6)
> ttrules tt(n/(n-1))
> ttrules tt(n/(n-1)^2)
> ttrules tt(n/(n-1)^30)

Ui, I like that.  Strange that it can apply such a complicated rule but stumble
over freeOf?

Alasdair, just to make it completely obvious:  

(3) -> ttrules tt(n/(n-1)^2)

                 n
   (3)   tt(-----------)
             2
            n  - 2n + 1

is because n^2-2n+1 is different from (n-1)^a.  As far as I can see, the match
itself is tried against the pattern without trying to "expand" or transform it
in some way.  (Although I must admit that I didn't check.)

Martin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.