A proposal for a computer readable mathematical object notation

As we’ve previously discussed, a notation to exchange mathematical expressions between computer programs could facilitate the assembly of software components. 

Consider for example the following category of components:
- an equation editor
- a numerical computation package
- a symbolic algebra package
- a graphing package

While formats exist to represent what should be displayed to the user in the end (LaTeX, MathML, CSS+HTML), the situation is less encouraging when it comes to representing semantically a mathematical notation so that it can be acted upon by computer programs. As a result it is difficult to impossible to connect software components together.

I’m proposing MASTON (Math Abstract Syntax Tree Object Notation), a lightweight, computer readable, notation for math based on JSON. I’ve put together a first draft https://github.com/arnog/mathlive/blob/master/docs/MASTON.md and I am seeking feedback. Feel free to discuss on this mailing list or on github.

Here’s Euler’s identity:

 e^{\imaginaryI \pi }+1=0

 {"lhs":{"lhs":{"sym":"e","sup":{"lhs":"ⅈ","op":"*","rhs":"π"}},"op":"+","rhs":1},"op":"=","rhs":0}

Here’s a formula to convert degrees Fahrenheit to Celsius:

 \frac {5}{9}(T_F−32)=T_C

 {"lhs":{"lhs":{"num":"5/9"},"op":"*","rhs":{"lhs":{"sym":"T","sub":"F"},"op":"-","rhs":32}},"op":"=","rhs":{"sym":"T","sub":"C"}}


To test out the idea, I’ve also implemented MASTON support in MathLive and hooked it up to math.js to perform simple numeric calculations. On mathlive.io, click the </> icon to get a live output of what you type in MASTON, LaTeX and MathML. It’s a good way to get a sense of how it works.


Best,
Arno.

Received on Monday, 19 March 2018 19:15:31 UTC