Theoretical Foundations of Programming Methodology