Re[2]: Zero version of mathematica evaluator for MAXIMA
Subject: Re[2]: Zero version of mathematica evaluator for MAXIMA
From: Richard Fateman
Date: Thu, 16 Mar 2006 08:43:22 -0800
I haven't looked at the code, but I think there is a choice to
be made, when you define a function in Mma space, at what point
do you want it to use Maxima functionality. For instance, Mma
doesn't really call functions, it matches patterns. It may look like
f[x_,y_]:= x+y
is the same as
f(x,y):=x+y in Maxima
but f[Sin[x_],Cos[y_]] := x+y is also legal Mma, and has no
parallel in Maxima.
One choice is to only allow f[x_,y_]:=.... which gives you
a small subset of Mma syntax and allows you to use
Maxima semantics.
The other choice is to make the internal representation
of f[x_,y_] := ....
something like putting on the property list of $f.. the property
'MMA_object
with value
((pattern x)(pattern y)) ....
and when you try to invoke $f from Maxima, the meval
program notices that $f is defined only in MMA, and uses a pattern matcher
to "apply" $f's MMA_object to its arguments, or it evaluates using
MMA's "infeval" idea.
This second approach would allow you to load in and run a much larger
percentage of Mma programs, though of course for them to really
operate the same way, it would be necessary to provide Mma versions
of various control structures as well as hundreds (thousands?) of commands.
I'm naturally pleased that someone made use of my MockMMA to
link it to Maxima. I don't know how many (more) packages I
have that would be of interest, but I think I have arbitrary precision
floats, intervals, which may not be in the distribution package.
Other pieces are in there .. a rational simplifier that might be
faster than Maxima (or Mathematica!) and
a simple integration program.
RJF
----- Original Message -----
From: "Siver Andrey" <siver at Sirius.ihep.su>
To: <maxima at math.utexas.edu>
Sent: Thursday, March 16, 2006 8:13 AM
Subject: Re: [Maxima] Re[2]: Zero version of mathematica evaluator for
MAXIMA
> Dear Robert Dodier,
>
> ----- Original Message -----
> From: "Robert Dodier" <robert.dodier at gmail.com>
> To: "Siver Andrey" <siver at sirius.ihep.su>
> Cc: <maxima at math.utexas.edu>
> Sent: Thursday, March 16, 2006 6:02 PM
> Subject: Re: [Maxima] Re[2]: Zero version of mathematica evaluator for
> MAXIMA
>
>
>> hello andrey,
>>
>> > It's needed to add the following rule for the usage of Mma
>> > constructions in MAXIMA: to use them always in
>> > ev(..., infeval) form.
>>
>> if you really want a program which acts like Mma,
>> you might consider hacking MEVAL so that it observes
>> the $INFEVAL flag. see $EV in src/mlisp.lisp, where
>> constructs of the form foo, infeval; are handled --
>> MEVAL doesn't know about $INFEVAL.
>
> It's seems to me, I know the more simple solution - to call ev function
> directly:
>
> For example:
>
> (mfuncall '$ev #$f(a+1)$)
>
>> hope this helps,
>> robert dodier
>>
>
> Regards,
>
> Andrey
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>