After asking this question on stackoverflow, it has changed slightly. Is there a way to represent a grammar as a basis for a vector space and represent a program as an object that lives in that vector space?
I'm interested in the parallels between mathematical operators (like the Hamiltonian, ladder operators, momentum operators, etc) and programming languages. The operators that I'm talking about can be thought of as transformation matrices that act on (potentially) infinite vectors. It seems like a good place to start might be a tree algebra?
An alternative would be to force the program into some sort of allowed bitwise representation, and then perform transforms on it. Is such a thing possible?