axiom-mail
[Top][All Lists]
Advanced

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

Re: [Axiom-mail] Going mad with pattern matching


From: Martin Rubey
Subject: Re: [Axiom-mail] Going mad with pattern matching
Date: 29 May 2007 09:35:42 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

"Alasdair McAndrew" <address@hidden> writes:

> Thanks, Martin,
> 
> As always I am helped by you!  I have two questions; maybe you can answer
> them:
> 
> 1)  How do I include linearity in the pattern matching rules?  At present,
> the command
> 
> ztrans(2+3^n,nz)
> 
> which should return the result
> 
> 2z/(z-1)+z/(z-3)
> 
> produces
> 
> (2+3^n)z/(z-1).
> 
> That is, the pattern matcher incorrectly applies the rule
> 
> zt(a | freeOf?(a,n),n,z) == a*z/(z-1)
> 
> even though 2+3^n is not free of n!

I doubt this.  I'm a little short on time though.  Thus, please do me a favour:
replace all rules with little local functions -- as I have done with "help".
Then you can say

)trace help

(replace "help" with the name of the functions you want to trace)

and you should see which rule was invoked.  To see the arguments in a nicer
form, you can use

)trace help )mathprint

but this works only after help was invoked already once.


> 2)  How do I force answers to be returned in factored form?

Later...  Short answer: you need to coerce them to an appropriate domain.

Martin





reply via email to

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