Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Maxima to Lisp translation

22 views
Skip to first unread message

Franck Ditter

unread,
Mar 14, 2012, 12:59:20 PM3/14/12
to
Is there any way to get a (usual) Lisp sexp from
a Maxima output. I know I can use to_lisp() to get the
Lisp internal representation, but it is clumsy to read,
I would like usual Lisp : (sin (+ (sqrt x) (log y)))

Thanks,

franck

Richard Fateman

unread,
Mar 14, 2012, 5:51:23 PM3/14/12
to
Mockmma has code you can look at that does such things.
It is written in lisp.

Franck Ditter

unread,
Mar 15, 2012, 2:01:58 PM3/15/12
to
I saw MockMma but I find there a parser from Mma to Lisp
and a formatter from Lisp to 2d-display, but my
problem is to be able from within Lisp to get something
like :

? (integrate '(log x) 'x)
(- (* x (log x)) x)

It seems strange that Maxima has not such a thing...
What do I miss ?

franck



In article <jjr3sm$2rd$2...@speranza.aioe.org>,

Richard Fateman

unread,
Mar 15, 2012, 5:55:14 PM3/15/12
to
On 3/15/12 11:01 AM, Franck Ditter wrote:
> I saw MockMma but I find there a parser from Mma to Lisp
> and a formatter from Lisp to 2d-display, but my
> problem is to be able from within Lisp to get something
> like :
>
> ? (integrate '(log x) 'x)
> (- (* x (log x)) x)
>
> It seems strange that Maxima has not such a thing...
> What do I miss ?
>
> franck
maybe that it is easy to do... you want to write a program P
such that (P '((f stuff) x y z)) is rewritten as (f (P x) (P y) (P z))
recursively. There is some translation of atoms like f,
e.g. mplus --> + , mtimes--> *, %sin --> sin, etc. An association
list of these translations should be around somewhere in MockMMA's
files. As for why Maxima does not have such a thing built in -- it
is not especially useful unless you want to try to execute some code.
There is a command translate, and a command compile. However they are
more elaborate most likely.

0 new messages