Mathematical formulas: analysis and canonical * programming * form

Is there any common format for representing a mathematical formula that can be read by a computer?

I am working on some math problems and I have some kind of TDD approach. Every time I get stuck in a proof (or I just don’t have proof, but have some kind of intuition as to what the result should be), I tend to write a small program to check that everything still behaves like this, as I think, I usually write a Haskell function for some intermediate result in my proof, play with it through GHCi until I convince myself that I'm still going in the right direction.

My absolute ideal would be to have some kind of canonical form for mathematical formulas that I could use with some kind of tool, both outputs in LaTeX and Haskell. I could run QuickTest on it, and if the step is wrong, it will tell me. LaTeX's mathematical notations are actually pretty close to canonical, although the reader reads a lot (you don't want to explicitly write parentheses each ).

This perfect tool seems too good to be true; rather, what would be the right way to set out a mathematical formula for a computer, perhaps its parsing? Looking around, I saw a lot for simple formulas, using only * , + , - , / and the like. Nothing covers such things as sums (for example, over sets), derivatives, all "cool" things. Moreover, the output of such parsers is mainly used to calculate the result giving some values ​​for variables; not for translating it into other languages ​​(I think the language is agnostic). It seems that something like this should either already exist, or should be a good reason why not. Who did I miss?

+5
source share
1 answer

Standard computer representation of mathematical notation MathML . Note that it includes both Presentation MathML , which is a way of writing mathematical expressions and can be converted to LaTeX and Content MathML , which is designed to represent the meaning of expressions and is what you need to translate into Haskell or another programming language (but I do not know any tool that makes such a translation).

Of course, you would not want to write (any taste) MathML manually; There are some editors who produce it, but I cannot recommend it.

Otherwise, there may be an OpenMath option. It seems to be targeted specifically at people who "work with math on a computer."

+4
source

All Articles