Compiler Optimization Correctness by Temporal Logic

  • Authors:
  • David Lacey;Neil D. Jones;Eric Van Wyk;Carl Christian Frederiksen

  • Affiliations:
  • University of Warwick. david.lacey@dcs.warwick.ac.uk;University of Copenhagen. neil@diku.dk;University of Minnesota. evw@cs.umn.edu;University of Tokyo. carl@lyon.is.s.u-tokyo.ac.jp

  • Venue:
  • Higher-Order and Symbolic Computation
  • Year:
  • 2004

Quantified Score

Hi-index 0.00

Visualization

Abstract

Rewrite rules with side conditions can elegantly express many classical compiler optimizations for imperative programming languages. In this paper, programs are written in an intermediate language and transformation-enabling side conditions are specified in a temporal logic suitable for describing program data flow.The purpose of this paper is to show how such transformations may be proven correct. Our methodology is illustrated by three familiar optimizations: dead code elimination, constant folding, and code motion. A transformation is correct if whenever it can be applied to a program, the original and transformed programs are semantically equivalent, i.e., they compute the same input-output function. The proofs of semantic equivalence inductively show that a transformation-specific bisimulation relation holds between the original and transformed program computations.