XML package and MathML



OK, I copy from the previous message a mathematical object that can
presumably be expressed in MathML.

sin(pi/6)=1/2

What does this mean?  What is the mathematical object?

Here are a few of the many possibilities, some of them available in Maxima.

1. Establish a rule so that sin(pi/6) is always replaced by 1/2.
2. Establish a rule so that 1/2 is replaced by sin(pi/6)  [presumably in
unusual circumstances]
3. Ask a question: is this true?  (that is, evaluate it as a boolean
equality)
4. Simplify it, e.g.  to 1/2 = 1/2
5. evaluate it numerically, e.g.  to 0.500000 = 0.500000
6. solve for pi  (the simplifier must be turned off) to pi=6*arcsin(1/2)
7. (maybe if you confuse =  with assignment) assign a value to sin(pi/6).
8. Assert, in the "assume" database, that sin(pi/6)=1/2.

So when you say "exchange mathematical object" you are probably overstating
the case.

What I suspect you are doing is producing a data structure that is some
version of a tree,
with perhaps some annotation. But probably no annotation, since you don't
really know what is meant by it.

What is this data structure? If you were just using Lisp, you might write:

'(= (sin (/ pi 6)) 1/2)

which can be read by any Common Lisp system.  
This leaves almost everything uninterpreted as symbols. 6 and 1/2 are read
as Lisp numbers, so they are interpreted.  There is a symbol for sin and one
for pi. While there is, in Lisp, a value for pi and a function sin, they are
not necessarily being referenced here.  Just the symbol-table entry for sin
and for pi are referenced, and there is no indication that the "sin"
functions is ever going to be called, or that the value for pi is going to
be used.  This is a quoted list.

So if the objective of MathML is to exchange algebraic trees of structures,
the simple way of doing this would be to have a program that reads MathML
and produces Lisp. And a program (in whatever language) that reads Lisp into
its favorite way of making trees.  And another program that prints out those
trees in the syntax of MathML. This equivalence of Lisp to MathML is, as I
recall, explicit in the MathML documentation.

Why use MathML at all?  

Because some people have gone to the trouble of writing display programs and
editors in this terrible language.
Does it facilitate transmission from one program to another? Well, the idea
is that if you have a common interchange language
for N systems, you need to have only 2*N translators and they can
communicate.  Otherwise you need 2*N^2 translators. But you need N^2
SEMANTIC translators.  E.g. Maple must know what Maxima believes to be the
meaning of sine. And visa versa.

(By the way, the need for N^2 translators is bogus. If every locution of
MathML could be translated into some system M,
then all translations could be done with reference to M.  (Think: M could be
Maxima, or Common Lisp). Once you have done this, MathML becomes redundant.
On the other hand, if some system K cannot encode every locution of MathML,
it will fail to be able to participate in this mutual translation and
exchange. So count it out.

I think that mathml_sin()  etc is the right thing to do, unless a Maxima
(etc) user further specifies that mathml_sin == Maxima's sin function
object.

)

RJF


 

> -----Original Message-----
> From: maxima-bounces at math.utexas.edu 
> [mailto:maxima-bounces at math.utexas.edu] On Behalf Of Fr?d?ric WANG
> Sent: Friday, June 06, 2008 9:08 AM
> To: fateman at EECS.Berkeley.EDU; maxima at math.utexas.edu
> Subject: Re: [Maxima] XML package and MathML
> 
> Richard,
> 
>     I've never said that I want to use MathML (or any other XML 
> languages for mathematics) as an alternative input syntax 
> (anyway MathML 
> is too verbose for humans). I want to use it nor as a format to save 
> Maxima sessions neither as an internal representation of objects. I 
> simply want to allow people, even casual users of Maxima, to re-use 
> mathematical objects. Basically, the purpose is to build a bridge 
> between the internal world of Maxima (where the user applies 
> algorithms 
> and functions to several kinds of objects, changes 
> configuration, sets 
> variables values etc) and the external world (XHTML pages & ODT 
> documents, results from Mathematica or Maple, etc).
>    
>     For instance, suppose you read a Web article where a 
> matrix of size 
> 5x5 appears and the author directly gives the characteristic 
> polynomial 
> without detail. Then there is several possibilities if you 
> want to check 
> the result:
>     - Using Maxima. Enter the matrix and execute the function 
> to get the 
> characteristic polynomial. But if you do not know the Maxima 
> syntax, you 
> have to search the function in the help etc
>     - Using Maxima+GUI (for instance WXmaxima). Use the menu to enter 
> the matrix and get the characteristic polynomial. Here, the more 
> difficult is to enter the 25 coefficients...
>     - Using Maxima+GUI+(MathML package) Copy the matrix from your 
> browser and paste it in Maxima. Then use the menu to apply 
> function that 
> returns the characteristic polynomial.
>     
> (Similarly, you can imagine that the author has copy and paste the 
> characteristic polynomial from Maxima to its Web page editor)
> 
> Fr?d?ric
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>