________________________________________________________________________________
This was really interesting to read. It seems almost like a kind of magic to be able to reduce your program to a small replication.
I suppose if you can get to an AST then you are pruning trees/leaves which seems more within reach, but it still seems magical.
Nice writeup - thank you!