I'm wondering whether its possible to construct a group where the elements are all possible valid programs, with a small or simple generator set. That way you could have a series of operations you can apply to a program to move it from one valid state to another valid state without going through an invalid state (since we are using these operations).
I know this should be possible if syntax is how validity is defined, but I'm more interested in what happens when types get involved, especially when you can make abstractions with them (structs/classes/enums).
I say simple/small, since a set of simple generators that are infinitely or very large should be ok, as long as they are fairly comprehensible to a programmer and follow a pattern. On the other hand, a few complex generators may also be ok, as the programmer could just learn them.
I also think Scratch or other block based languages could be a simple example, because the operation could be adding a block and the generator set could be the set of all blocks (maybe). However, I'm not sure how types (especially compound ones) would fit in here.
Which programming languages have the best generator sets, and what characteristics do they have?
If I've made any mistakes in my assumptions or research (or maybe my question is flawed), please feel free to correct me :).
Clarification As for which binary operation, I'm not completely sure. I was thinking of defining it based on the generators themselves. An example of this kind of construction is with the Rubik’s Cube group, which uses composition of its underlying generators. In this sense, the group operation kind of depends on the generator set, which makes this harder.