Loop Transformations for Restructuring Compilers: The Foundations