A parser for the maxima language is not only easier to write,
it is available in source form. It is also based on a well known
technique which is also used by Reduce. The real difficulty is
to implement a Mathematica language parser, since the language
fails to fit the standard expectations for computer languages.
For example, the lexical analysis cannot be done by a finite
state machine, and is not LALR(1), a category of grammar sufficient
for almost any reasonable language. But they already have that.
(Oh, there is one of those, free in MockMMA...)

Writing a "sloppy" parser that provides many parses for an alleged
sentence has an attraction, too (I used it in TILU). It's fine
for short utterances, even if it is exponentially expensive.
It's also very easy to write.  You can even allow things like
integrate sinxdx, where the segmentation into tokens is done
heuristically.

You have some
kind of after-the-fact sorting to pick out the intended meaning.
This can be done by computer or with the help of the human.

While I assume that some people at WRI may be observing the Sage
activity, I doubt that they feel Sage breathing down their necks.


On Feb 21, 10:13 am, Robert Bradshaw <rober...@math.washington.edu>
wrote:
> On Mon, Feb 21, 2011 at 8:37 AM, kcrisman <kcris...@gmail.com> wrote:
>
> > On Feb 21, 2:00 am, Eviatar <eviatarb...@gmail.com> wrote:
> >> I've noticed this too. I wonder if they purposely implemented Sage
> >> syntax or if it's just a very comprehensive parser.
>
> > I think the goal is to understand any natural syntax for many
> > questions, and certainly this syntax is relatively unambiguous, and
> > pretty much the Maxima (i.e. old and well-known) syntax in the first
> > case.    It tries to also understand much more 'natural' things like
> > "the integral of ... with respect to x" etc. so I don't see any need
> > to impute any extra thought on this.
>
> Yes, I'd say this is *much* more natural than, e.g., using square
> brackets for function calls and capitalizing log/trig functions.
>
> - Robert

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to