On Mon, Aug 25, 2008 at 3:08 PM, David Philp <[EMAIL PROTECTED]> wrote:
> On 26/08/2008, at 2:50 AM, William Stein wrote:
> > Burcin -- I did actually mostly implement pattern matching in Pynac.
>
> Is there documentation?  A bit of google turned up nothing.

(1) Let me clarify -- I *wrapped* the pattern matching already in Pynac.
(2) I made up the name pynac about 3 days ago, and released the first version
15 hours ago.     This is code that will be included in Sage.  There was
a long sage-devel post about this last night.  So I doubt Google will
find anything.    Incidentally, Pynac = Ginac + Python - CLN, and you
can read about Ginac at the Ginac website: http://www.ginac.de/

>
>            sage: sin(1+sin(x)).subs(sin(w0)==cos(w0))
>            cos(cos(x) + 1)
>
> In Mathematica, the result would be cos(sin(x) + 1), since having matched
> the outer expression, the replacement algorithm moves on rather than in.
> One would obtain cos(cos(x) + 1) by making the substitution rule sin==cos.
>  Can you do that?  Can you evaluate code during the matching of your
> patterns?  Can you nest patterns?  I think these are highly desirable, even
> if they are suitably carefully hidden from the casual user.

I didn't implement the pattern matching. I wrapped the pattern matching
that is provided by GiNaC.  It is certainly not identical to the pattern
matching in Mathematica, at present.  I'm glad you're pointing out some
of the differences between what is in Mathematica and what is in Ginac.
Thanks!

> We already have a pretty good "symbolic engine" in Sage, maxima does
> quite a good job of solving integrals, limits, etc. The main problem
> with Maxima is that we cannot extend it.
>
> Is "not extending of Maxima" a concrete policy?

Maxima is definitely not the future of symbolic manipulation *in Sage*:

   (1) Maxima cannot manipulate native Python objects (e.g., real interval
field elements, number field elements, finite field elements); both
Pynac and sympy can.

   (2) Maxima is written in Lisp.  This is a total show stopper for most
Sage developers, including me.

Both apply to Axiom, too, by the way.

> I understand that maxima
> sucks in some circumstances, but it seems quite the beast here.
> I am quite confused about a lot of the pattern matching discussion.  AFAICT,
> that is the problem for which lisp rocks, and the best way to do it is
> probably to write maxima code for it.  And the best way to make it
> accessible from python is to provide pretty python methods to call lisp.
> Any other suitably general form of pattern mathematical matching will
> involve the proverbial reimplementation of lisp.

That would be a waste of time for Sage.  No matter how good Maxima
is or its pattern matching is, Maxima is still working in it's own
world of objects
and data types, which have nothing much to do with Python's.  Maxima/Axiom
live on a totally different planet than Python/C/C++.   This is just a fact
we have to deal with.

 -- William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to