Dissertation Project Progress!
This morning I have worked on my dissertation project.
I’ve built a very simple reduction mechanism which works as such:
Take a rule:
a * (b + c) = (a * b) + (a * c)
Have an expression:
x * (3 + (b / 2))
Apply the rule, and generate variable mappings if appropriate:
{ a : x
b : 3
c : (b / 2) }
Apply a the variable map with rule to get the reduced expression:
(x * 3) + (x * (b / 2))
I’ve the written the expressions here in infix but really they work as s-expressions. I’m building a parser to translate infix to s-expression to make my reduction system usable with expressions as they are usually written in mathematics (in infix).
I’m anticipating that the next difficult parts may be: reduction cycle detection and termination, the whole infix-parser, and the infix printer (if necessary).