We refactor code lots of times as developers. Metaphorically, our program space is an infinite-dimensional Rubik's cube. Things can be rearranged, preserving the code's action, so a "symmetry structure" is at play. You can do things in code that can be factored sort of like distributive law in a ring, but there are way more operations, so things are not that cut-and-dry.
If someone wanted to develop a next-generation IDE that is Refactoring-centered instead of having that as an auxillary feature added in later after centering things around an Editor and Debugger; then what theory should they study?
In other words what is the closest theory or topic in regards to the application of code refactoring? So the theory has to be taught but it also has to apply to real-world languages in a somewhat direct way, such as C++, Python, Java, etc.
Does such a theory exist already?