Why are we doing this?
The initial idea was quite simple: Read the integral table by Gradshteyn and Rhyzik (G&R), as well as any other large tables we can find into a computer so that we can have a very good look-up program solve problems, including ones that challenge computer algebra system algorithms.
The need to scan the books seemed to dissolve when we encountered Academic Press’ electronic (Dynabook) version of G&R which seemed to have formulas equivalent to TeX.
All we needed to do was take the TeX and “parse” it into real mathematics-- in our case, a Lisp data structure suitable for storing in our database.
The unfortunate reality of this is that the TeX formulas in G&R do not abide by a simple grammar. They are ambiguous, at the very least. The Academic Press typists concentrated on the appearance only.
Had Academic Press started with a true grammar and valid mathematical input and macro-expanded it into TeX, this could have been a piece of cake.
Our program is “mostly” successful nevertheless, but uses heuristics based on the context.