An axiomatic approach to code optimization for expressions

An axiomatic approach is proposed as a means of specifying precisely what liberties are permitted in evaluating expressions. Specific axiom systems are introduced for arithmetic expressions, which permit free grouping of terms within parentheses, in the spirit of American National Standard Fortran. Using these axiom systems, two algorithms are given for finding optimal equivalent forms of an expression not having multiple references to any variable. The first algorithm is intended for highly parallel computers and is a slight generalization of that of Baer and Bovet. The concept of delay is introduced as a measure of the serial dependency of a computation and the algorithm is shown to minimize delay. This provides, as a special case, a proof of the level minimality claimed by Baer and Bovet. The second algorithm is shown to produce an equivalent expression which can be evaluated with a minimal number of instructions on a computer of the IBM System/360 type. I t is an extension of a result of Sethi and Ullman, which relates only to commutative and associative operations. KEY WOR D S A N D P H R A S E S : arithmetic expression, associativity, code generation, compilers, commutativity, language processing, object-code optimization, parallel processors, parsing, programming languages, semantics, trees CR C A T E G O R I E S : 4.12, 4.22, 5.19, 5.29, 5.39, 5.49