Automatic Program Improvement: Variable Usage Transformations

Abstract
The design objective of the Leeds Transformation System is to transform existing programs, written in a variety of languages, into "tidier" programs. The total system was conceived of as having three phases: syntactic transformations, variable usage transformations, and synthesizing features. Because programmers vary greatly in what they consider to be a more acceptable form, we have aimed to make the system as data driven as possible. (That also enables us to deal with a variety of programming languages.) The paper reviews the first two phases, reports the second in some detail, and illustrates the use of the system on an ALGOL 60 program. Redundant assignments, redundant variables, and loop-invariant statements are discovered by means of a novel approach which represents variable usage within a program as a correspondence matrix. Potential enhancements of the system are also discussed.