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?
source share