A mathematical spell check

As a dyslexic, I rely heavily on spellcheck to correct my writing and put it into a readable form.

I heavily rely on a similar checker when writing code, paying close attention to use before declaration errors that might indicate that I have misspelt something. I also have spellcheck on in vim, which checks snake case words individually!

I don’t however have the same thing for mathematics. Notation can be incredibly powerful. The best notation is that where it makes it clear when you have done something wrong. Or better still doesn’t allow you to do anything wrong.

When writing long equations I often miss a sign in one place or another, manipulate them wrong and generally propagate these errors until I find a result which doesn’t make sense. I wondered if there was something simple I could use, that would not be any more time consuming than writing the equations out by hand, that would act as a “spellcheck” for my manipulation of equations.

I use a lot of equations on this blog and to format them nicely I use latex, which allow my to type the equation using a standard keyboard but get a nice formatting closer to how I would write on paper. This does take longer than writing the equations down, so that on it’s own would only be useful to get past my handwriting. If the program could understand the terms in the equation it could perform simple operations on each side, and substitutions. If the program had an understanding of the equation then I could simply take the equation and say, take x from both sides.

I have been putting off going over the finial problem mentioned in the “Farmer outstanding in his field” post because the number of terms becomes prohibitive and I don’t want to make a fool of myself posting clearly mistaken equations on the blog.

In my imagination, the program would look something like a terminal, where I can type commands and equations in an entry box and view them in rendered form.

I have built a demo of the terminal here.

To get the program to understand the mathematics, however, the input will need to be parsed. Luckily I have found a parser in javascript which I think is perfect for the job.

Based on a stack overflow post , I have found it possible to get the output of a parse tree for the input. This is what the .jison file for a simple calculator would look like, giving its output as a JSON object. The next step is to build the full JISON file and create a program that can work on manipulating the output.


Popular posts from this blog

An exploration in number systems

Structural engineering with cardboard

The twelve fold way