A Syntactic Approach to Program Transformations

Kid, a language for expressing compiler oPtirnizations for functional languages is introduced. The language is A-calculus based but treats let-blocks as first class objects. Let-blocks and associated rewrite rules provide the basis to capture the sharing of subexpressions precisely. The language goes beyond ,4-calcnlus by including I-structures which are essential to express efficient translations of list and array comprehensions. A calculus and a parallel interpreter for Kid are developed. Many commonly known program transformations are also presented. A partial evaluatoT for Kid is developed and a notion of comectness of Kid transformations based on the syntactic structure of terms and pTintable answeTs is presented.