Re: [Axiom-mail] A little simplification problem

2008-08-04 Thread Themos Tsikas
Why? I didn't write the code but my best guess is that such rules would slow 
things down dramatically if they had to be applied everytime there's a + 
or - or * in Expression. You could experiment with your own Expression 
domain, adding more simplification rules and attaching them to the basic 
arithmetic ops. The current Expression implementation relies on the use 
of normalize  for when you want to eliminate algebraically redundant 
kernels (informally, subexpressions). There's still the question of why 
does simplify not call normalize. I don't know the answer.

Themos Tsikas


On Saturday 02 August 2008, Alasdair McAndrew wrote:
 Thank you!  In fact the rule

 expandPowers := rule x^(n+k) == x*x^(n+k-1)

 also seems to work well.  But why does Axiom not automatically apply this
 rule for simplification of expressions involving powers, as other CAS's
 (Maple, Maxima, Mathematica) do?

 Thanks again,
 Alasdair

 On Sat, Aug 2, 2008 at 12:41 AM, Themos Tsikas [EMAIL PROTECTED] wrote:
  On Friday 01 August 2008, Alasdair McAndrew wrote:
   f(n)==7^n
   f(n+1)-7*f(n)
   simplify(%)
 
  normalize %


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


[Axiom-mail] A little simplification problem

2008-08-01 Thread Alasdair McAndrew
f(n)==7^n
f(n+1)-7*f(n)
simplify(%)

What do I need to do to enable the final statement to produce 0?

Thanks,
Alasdair

-- 
Blog: http://amca01.wordpress.com
___
Axiom-mail mailing list
Axiom-mail@nongnu.org
http://lists.nongnu.org/mailman/listinfo/axiom-mail


Re: [Axiom-mail] A little simplification problem

2008-08-01 Thread Ralf Hemmecke

On 08/01/2008 04:18 PM, Alasdair McAndrew wrote:

f(n)==7^n
f(n+1)-7*f(n)
simplify(%)

What do I need to do to enable the final statement to produce 0?


Does that help?

(1) - f(n)==7^n
Type: Void

(2) - a := f(n+1)-f(n)*7

 n + 1  n
   (2)  7  - 7 7
   Type: Expression Integer

(3) - r := rule x^(y+1)==x*x^y

 y + 1   y
   (3)  x  == x x
   Type: RewriteRule(Integer,Integer,Expression Integer)

(4) - r a
   (4)  0
   Type: Expression Integer


___
Axiom-mail mailing list
Axiom-mail@nongnu.org
http://lists.nongnu.org/mailman/listinfo/axiom-mail


Re: [Axiom-mail] A little simplification problem

2008-08-01 Thread Bill Page
On Fri, Aug 1, 2008 at 10:18 AM, Alasdair McAndrew wrote:

 f(n)==7^n
 f(n+1)-7*f(n)
 simplify(%)

 What do I need to do to enable the final statement to produce 0?


You might use a pattern like this:

(1) - f(n)==7^n
Type: Void
(2) - f(n+1)-7*f(n)

 n + 1  n
   (2)  7  - 7 7
 Type: Expression Integer

(3) - expandPowers := rule x^(n+1) == x*x^n

 n + 1   n
   (3)  x  == x x
Type: RewriteRule(Integer,Integer,Expression Integer)

(4) - expandPowers( %% 2)

   (4)  0
 Type: Expression Integer

-

Regards,
Bill Page.


___
Axiom-mail mailing list
Axiom-mail@nongnu.org
http://lists.nongnu.org/mailman/listinfo/axiom-mail


Re: [Axiom-mail] A little simplification problem

2008-08-01 Thread Alasdair McAndrew
Thank you!  In fact the rule

expandPowers := rule x^(n+k) == x*x^(n+k-1)

also seems to work well.  But why does Axiom not automatically apply this
rule for simplification of expressions involving powers, as other CAS's
(Maple, Maxima, Mathematica) do?

Thanks again,
Alasdair

On Sat, Aug 2, 2008 at 12:41 AM, Themos Tsikas [EMAIL PROTECTED] wrote:

 On Friday 01 August 2008, Alasdair McAndrew wrote:
  f(n)==7^n
  f(n+1)-7*f(n)
  simplify(%)

 normalize %


 
 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




-- 
Blog: http://amca01.wordpress.com
___
Axiom-mail mailing list
Axiom-mail@nongnu.org
http://lists.nongnu.org/mailman/listinfo/axiom-mail


Re: [Axiom-mail] A little simplification problem

2008-08-01 Thread Ralf Hemmecke

expandPowers := rule x^(n+k) == x*x^(n+k-1)


also seems to work well.  But why does Axiom not automatically apply 
this rule for simplification of expressions involving powers, as other 
CAS's (Maple, Maxima, Mathematica) do?


Maybe some people like to apply it in the other direction...

contractPowers := rule x*x^n == x^(n+1)

or even

combinePowers := rule x^a*x^b == x^(a+b)

Have you ever tried to apply the above rule as follows?

expandPowers(x^(n+k))

Be sure to be close to Ctrl-C, since that seems to run forever.

Ralf


___
Axiom-mail mailing list
Axiom-mail@nongnu.org
http://lists.nongnu.org/mailman/listinfo/axiom-mail