How to evaluate a noun expresion



On 1/31/08, jcano <jcano at agt.uva.es> wrote:

> I use a  modified version of the newdiff function found in the Maxima
> book section 7.11.
> This function output some noun form and after that I have problems to
> evaluate expresions.
>
> My problem can be described with the following function:
>
> F(x):=block([inflag:true],
>   if atom(x)=true then 'F(x)
>   else
>   if inpart(x,0)="+" then  map(F,x)
>   else 'F(x));

I see the "Maxima Book" encourages more than one weak practice.
The right way to make F an additive function is to use the simplifier.
The multiadditive declaration which Barton mentioned is exactly
the right thing. If there were no multiadditive package, you could make
a simplification rule via tellsimp or defrule.

Maxima is an algebra system to the extent that it can work out the
implications of declarations such as "F is additive". Users should
try to take advantage of that; it's not really necessary, nor desirable,
to clutter every function with generic algebraic stuff.

Maybe if you tell us what your goal is here, we can offer some more
specific advice.

best,

Robert Dodier