Wed Feb 10 17:25:05 CET 2010
I'm looking at this in the wrong way. The rewriting systems I
mentioned before are too error-prone and low-level.
Maybe the trick is to use a proper number system?
I'm also looking at very specific optimizations: combining constants
using the commutative and associative laws.
Or how do you call numbers that look like: a + b x, where x is a
variable and a, b are numbers.
Such numbers allow similar bubble tricks.
What about nesting two kinds of number systems? (Zero, One, Lit l)
and (a + b x)?
Maybe the idea is to define operations on a certain abstract domain
and lift them into more detailed domains of which they are subsets
I'm starting to see the point: what you _really_ want is to make
compositions of, or otherwise interactions with different abstract
Anyway, it seems to be the case that you should use the abstract
domain that works for you. What I've had in the back of my head is
numbers + variables.
So, factorizating might work by building a number type that contains
multiple number types.