tt:=operator 'tt

ttrules := rule

tt(n^(a | integer?(a))) == t/a

tt(n/(n-1)) == 1/t

tt(n/(n-1)^(a | integer?(a) and a>1)) == 1/t^a

And here's some experiments:

(1) -> ttrules tt(n^6)

t

(1) -

6

Type: Expression Integer

(1) -> ttrules tt(n/(n-1))

1

(1) -

t

Type: Expression Integer

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

n

(3) tt(-----------)

2

n - 2n + 1

Type: Expression Integer

Why is the last pattern not matched?

Thanks,

Alasdair

------=_Part_15928_23195352.1180706060820-- From MAILER-DAEMON Fri Jun 01 10:18:17 2007 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Hu7xJ-0005oz-Pf for mharc-axiom-mail@gnu.org; Fri, 01 Jun 2007 10:18:17 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hu7xH-0005oY-TI for axiom-mail@nongnu.org; Fri, 01 Jun 2007 10:18:15 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hu7xG-0005np-AU for axiom-mail@nongnu.org; Fri, 01 Jun 2007 10:18:15 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hu7xG-0005ni-2O for axiom-mail@nongnu.org; Fri, 01 Jun 2007 10:18:14 -0400 Received: from mail35.messagelabs.com ([62.231.131.195]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from

And Martin, I tried every imaginable combination of expand/factor, but nothing worked!

cheers,

Alasdair

On 6/2/07, **Themos Tsikas** <themos@nag.co.uk> wrote:

--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)

________________________________________________________________________

The Numerical Algorithms Group Ltd is a company registered in England

and Wales with company number 1249803. The registered office is:

Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is

powered by MessageLabs.

________________________________________________________________________

_______________________________________________

Axiom-mail mailing list

Axiom-mail@nongnu.org

http://lists.nongnu.org/mailman/listinfo/axiom-mail

------=_Part_17480_11418194.1180734294614-- From MAILER-DAEMON Fri Jun 01 20:11:02 2007 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1HuHCv-0005dX-R2 for mharc-axiom-mail@gnu.org; Fri, 01 Jun 2007 20:11:01 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HuHCt-0005cS-BX for axiom-mail@nongnu.org; Fri, 01 Jun 2007 20:10:59 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HuHCr-0005bl-O9 for axiom-mail@nongnu.org; Fri, 01 Jun 2007 20:10:59 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HuHCr-0005bY-Fh for axiom-mail@nongnu.org; Fri, 01 Jun 2007 20:10:57 -0400 Received: from smtp-vbr12.xs4all.nl ([194.109.24.32]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from

Maybe pattern matching is not as well supported in Axiom as I imagined, but if I can get it to work, it would be a very elegant way of implementing the z-transform.

cheers,

Alasdair

On 02 Jun 2007 08:34:23 +0200, **Martin Rubey** <martin.rubey@univie.ac.at> wrote:

"Alasdair McAndrew" <amca01@gmail.com> writes:

> Thank, you Themos, for your suggestion - works like a charm! Am I to infer

> from this that pattern matching works by parsing the input element by

> element?

That's what I believe, too.

> Or is there some other Deep Magic going on?

To be honest, I don't know really. After all, there is some support for

matching units...

> And Martin, I tried every imaginable combination of expand/factor, but

> nothing worked!

Oh sorry, I didn't mean to imply that you could tell axiom to expand or factor

a pattern.

By the way, could you file the freeOf? failure as a bug at IssueTracker,

including a minimal example - i.e., a single rule, and the workaround?

Thank you,

Martin

------=_Part_19077_20509134.1180766715688-- From MAILER-DAEMON Sat Jun 02 02:46:22 2007 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1HuNNW-00030C-SH for mharc-axiom-mail@gnu.org; Sat, 02 Jun 2007 02:46:22 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HuNNU-0002xO-Qi for axiom-mail@nongnu.org; Sat, 02 Jun 2007 02:46:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HuNNT-0002uy-FL for axiom-mail@nongnu.org; Sat, 02 Jun 2007 02:46:20 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HuNNR-0002qe-5C; Sat, 02 Jun 2007 02:46:17 -0400 Received: from grace.univie.ac.at ([131.130.3.115]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from

ex:=z/(z-1)+2*z/(z-3)

(Result is returned as a single polynomial fraction.)

Now, what I want to do is to break this single fraction up into its original components. The canonical way to do this (for my purposes), is to divide the fraction by z, form partial fractions, and multiply through by z. Here goes:

exf:=partialFraction(ex/z::FRAC POLY INT,z)$PFRPAC(INT)

Now, because the result is returned as a partial fraction,if I try

nthFractionalTerm(exf,1)*z

I don't get 2*z/(z-3), but 2+6/(z-3). So I need to remove this term from its partialFraction domain.

But none of nthFractionalTerm(exf,1)::FRAC POLY INT, nthFractionalTerm(exf,1)::EXPR INT seem to work.

Any ideas?

Thanks,

Alasdair

------=_Part_21700_17772371.1180822516480-- From MAILER-DAEMON Sat Jun 02 22:21:37 2007 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Hufir-0004rF-5R for mharc-axiom-mail@gnu.org; Sat, 02 Jun 2007 22:21:37 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Hufip-0004pC-Ug for axiom-mail@nongnu.org; Sat, 02 Jun 2007 22:21:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Hufio-0004nu-VA for axiom-mail@nongnu.org; Sat, 02 Jun 2007 22:21:35 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hufio-0004nj-PY for axiom-mail@nongnu.org; Sat, 02 Jun 2007 22:21:34 -0400 Received: from smtp-vbr12.xs4all.nl ([194.109.24.32]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from