Controlling simplification of type a*a^k -> a^(k+1)
Subject: Controlling simplification of type a*a^k -> a^(k+1)
From: Yasuaki Honda
Date: Sun, 5 Aug 2007 02:23:02 +0900
Dear all,
I would like to introduce a flag to control the following
simplification:
a*a^k -> a^(k+1).
In general this simplification is good (thanks to Raymond). However,
when dealing with a series such as
sum(a[n]/b^n, n, 0, k)
in which some a[n] happen to have value b, such
terms are simplified to b^(1-n) while other terms remain a[n]/b^n.
So, in such case, I would like to suppress the this simplification so
that all the terms look similar.
For this purpose, I want to introduce a control variable $exposimp.
If the value is nil the a*a^k->a^(k+1) will be suppressed.
The modification to simp.lisp is pretty simple:
diff -r1.41 simp.lisp
72a73,76
> (defmvar $exposimp t
> "If t, a*a^k to be simplified to a^k+1, otherwise such
> simplification is suppressed. The default is t.")
>
1781c1785
< ((setf expo (exponent-of (car fm) (car x)))
---
> ((and $exposimp (setf expo (exponent-of (car fm) (car x))))
If no one opposes, I would like to commit this.
Yasuaki Honda, Chiba, Japan