[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Axiom-mail] A pattern matching question
From: |
Martin Rubey |
Subject: |
Re: [Axiom-mail] A pattern matching question |
Date: |
01 Jun 2007 22:39:36 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 |
Themos Tsikas <address@hidden> 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