Get the latest tech news

Definite clause grammars and symbolic differentiation


Let's talk about calculus. It's an extremely important field for almost all branches of science, and you've probably seen at least some aspects of it during high school or possible further education.

A simpler approach based on pushdown automata would suffice in this specific case, but turns out to be not as easily extensible as the requirements for strings of interest change over time. There are a lot of logical simplifications, such as removing zeroes and ones where possible, identifying repeated sub-ASTs, moving around minus signs, actually evaluating ASTs whose leaves consist only of numbers, et cetera. Finally, Prolog's basic data structure, the compound term, can easily encode abstract syntax trees, and defining expression simplification rules is rather easy.

Get the Android app

Or read this on Hacker News