Sunday, July 1, 2012

Cleaner name bindings

Adam has continued working on the symbolic differentiation implementation. The main change is the way in which unique names are bound to expressions. Previously, this was done during hash-consing. This was helpful for debugging, as the toString methods of the expression types could use the names from the expression binding context to output reduced expressions. However, this caused gaps in the indices of the names when printing the expression binding context for a given expression (showing only those bindings which are used in the expression). The solution was to move the process of binding names to expressions to the pretty-printing phase. Aside from resolving the problem of gaps in the expression names, this also gave a better separation of the differentiation algorithm from the pretty-printing logic.