nouns of infix operators



I've been away from my computer on vacation, so I'm only now getting back to
this.

The simplifying package can in fact handle the case mentioned if the string
operator is explicitly converted to a verb:

    load(simplifying)$
    simpfunmake(verbify("*"),[2,3,p,q])  => 2*3*p*q

But I've created an updated version of simplifying.lisp (attached) which
takes care of converting operators like this and also does some additional
checking to make it harder to create invalid expressions.

As Fateman points out, expressions like this which are *marked* as
simplified but are in fact not simplified may give unsimplified, peculiar,
and occasionally even incorrect results when operated on, since from
Maxima's perspective they are malformed.  For example:

   t: simpfunmake(verbify("*"),[2,p,q,p,3])$
   t/3 => 2*p*q*p*3/3                    -- unsimplified
   t/t => (p*3)/(3*p)                    -- unsimplified
   coeff(t,p,1) => 6*p*q                 -- wrong?

But that is presumably unsurprising.  To force simplification of one of
these expressions, use expand(...,0,0).

What may be more surprising is that sometimes things are resimplified even
when they're marked as simplified, e.g.

   part(factor(120),1,1) => 2   -- as expected
 part(factor(120),1) => 8     -- not 2^3, as you might expect

I noticed also that there is a small bug in Maxima's display routines in a
particular case of unsimplified expressions (reported in
SourceForge<http://sourceforge.net/tracker/?func=detail&aid=3213380&group_id=4933&atid=104933>;
):

    ex: simpfunmake("-",[a,b,c]) displays as -a, but expand(ex) correctly =>
-c-b+a

Please let me know of any additional issues around simplifying.lisp.

             -s

-------------------------------------------------------

On Thu, Mar 3, 2011 at 12:52, Barton Willis <willisb at unk.edu> wrote:

> maxima-bounces at math.utexas.edu wrote on 03/03/2011 10:34:18 AM:
>
> > The simplifying package has a function which allows you to construct
> > expressions tagged as simplified.
>
> I didn't try all that hard, but I wasn't able to do this using the
> simplifying package.
> Maybe something like the following will work:
>
>  (%i26) :lisp(defun $mult_nosimp (&rest l) (cons '(mtimes simp) (sort l
> '$orderlessp)))
>  $MULT_NOSIMP
>
>  (%i26) mult_nosimp(2,3,p,q);
>  (%o26) 2*3*p*q
>
> Don't expect Maxima to work correctly with the output of
> mult_nosimp--subverting
> simplification has bad consequences; example:
>
> (%i33) mult_nosimp(2,3,p,rat(x));
> (%o33)/R/ 2*3*p*x
>
> (%i34) %/x;
> Maxima encountered a Lisp error:  value #:X3118 is not of the expected
> type LIST.
>
> --Barton
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: simplifying.lisp
Type: application/octet-stream
Size: 5100 bytes
Desc: not available
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20110315/c0a9cdc8/attachment-0001.obj>;