CellML Discussion List

Text archives Help


[cellml-discussion] [Fwd: Re: Content MathML editing language: Binary => n-ary syntax]


Chronological Thread 
  • From: ak.miller at auckland.ac.nz (Andrew Miller)
  • Subject: [cellml-discussion] [Fwd: Re: Content MathML editing language: Binary => n-ary syntax]
  • Date: Mon, 20 Nov 2006 15:32:10 +1300



-------- Original Message --------
Subject: Re: Content MathML editing language: Binary => n-ary syntax
Date: Sun, 19 Nov 2006 18:27:50 -0800
From: Peter Jipsen <jipsen at chapman.edu>
To: Andrew Miller <ak.miller at auckland.ac.nz>
References: <4560E2D8.30202 at auckland.ac.nz>



Hi Andrew,

For an interesting comparison you could look at ASCIIMathML
http://www1.chapman.edu/~jipsen/mathml/asciimath.html and the syntax
that was chosen for the plain text to Presentation MathML translation.
Since this is done on the fly in JavaScript, it had to be very simple
and fast, so there are some compromises in the quality of the PMathML
that is generated, but the input syntax is very natural (even for
undergraduate students).

My experience with ease-of-use for typing math is to make the ascii look
as much as possible like the math that it represents. This is what users
would guess without reading a manual (and who does that nowadays?:-).

For Content MathML you are asking some important questions. I believe
the bracketing structure should be preserved, so a+b+c should not be
nested, but a+(b+c) should be nested in the CMathML. Not all
interpretations of + necessarily insist that these two formulas evaluate
to the same value (in fact in most programming languages with a maxint
limit they can differ because of overflow).

For differentiation, how about d/(dx)(f(x)) or d/dx(f(x)) and
del/delx(f(x)) for partial derivatives?

MS Word 2007 also uses an interesting linear syntax that is similar to
ASCIIMathML, see
http://blogs.msdn.com/murrays/archive/2006/09/06/742274.aspx
http://www.unicode.org/notes/tn28/UTN28-PlainTextMath-v2.pdf

This input syntax is likely to become quite familiar to many people in
the coming years.

Regards,
Peter

--
______________________________________________

Dr Peter Jipsen Associate Professor
Department of Mathematics and Computer Science
Chapman University Phone: (+1)(714)744-7918
One University Drive Fax: (+1)(714)628-7340
Orange, CA 92866 Email: jipsen at chapman.edu
USA http://www.chapman.edu/~jipsen
______________________________________________

For a simple way to put math notation and
interactive diagrams on webpages see
www.chapman.edu/~jipsen/asciimath.html

Andrew Miller wrote:
>
> Hi all,
>
> I have been developing a plain-text input language for the content
> MathML in CellML documents (so that it can be efficiently edited by
> users). Although CellML is a declarative language rather than a
> procedural one, much of the expression syntax from languages like MATLAB
> and C-like languages can be re-used, and is likely to be familiar to
> many users. I have therefore tried to make my input language similar to
> these languages, where possible (for example, I have in-order operators
> like +, -, *, and / for plus, minus, times, divide, and a pre-order
> syntax, e.g. sin(x), for other operators). Please ask off-list for my
> bison grammar (a work in progress) if you would like to see it (I
> haven't checked it in to the public Subversion yet). Any opinions or
> suggestions on the overall structure of the language would be welcome.
>
> I am also seeking opinions on the most intuitive way to deal with the
> conversion between binary in-order operators like +. For example, if,
> within the input language, you have
> x = a + b + c + d + e + f
> a naive parser might create MathML like...
>
> <apply><eq/>
> <ci>x</ci>
> <apply><plus/>
> <apply><plus/>
> <apply><plus/>
> <apply><plus/>
> <apply><plus/>
> <ci>a</ci>
> <ci>b</ci>
> </apply>
> <ci>c</ci>
> </apply>
> <ci>d</ci>
> </apply>
> <ci>e</ci>
> </apply>
> <ci>f</ci>
> </apply>
> </apply>
>
> A slightly more complex parser might instead produce:
> <apply><eq/>
> <ci>x</ci>
> <apply><plus/>
> <ci>a</ci>
> <ci>b</ci>
> <ci>c</ci>
> <ci>d</ci>
> <ci>e</ci>
> <ci>f</ci>
> </apply>
> </apply>
>
> I would be interested in opinions on whether you feel this automatic
> translation from multiple binary in-order operators to a single
> pre-order operation makes sense (note: all CellML tools available now
> work with real numbers only, but future work could allow it to be
> extended to support other mathematical constructs. Using a definitionURL
> on an operator is technically valid CellML, but no tools can do anything
> with this either).
>
> The issue is complicated by what to do with bracketed expressions(which
> I currently allow, to override ambiguity). For example, a user could
> enter...
> x = (((((a + b) + c) + d) + e) + f)
> I would be interested to know if you believe that the first content
> MathML encoding or the second is more appropriate.
>
> Best regards,
> Andrew Miller
>
>




  • [cellml-discussion] [Fwd: Re: Content MathML editing language: Binary => n-ary syntax], Andrew Miller, 11/20/2006

Archive powered by MHonArc 2.6.18.

Top of page