Proving correctness of compiler optimizations by temporal logic

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

  • Affiliations:
  • University of Oxford;University of Copenhagen;University of Oxford;University of Copenhagen

  • Venue:
  • POPL '02 Proceedings of the 29th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
  • Year:
  • 2002

Quantified Score

Hi-index 0.00

Visualization

Abstract

Many classical compiler optimizations can be elegantly expressed using rewrite rules of form: I ⇒ I′ if &phis;, where I, I′ are intermediate language instructions and &phis; is a property expressed in a temporal logic suitable for describing program data flow. Its reading: If the current program π contains an instruction of form I at some control point p, and if flow condition &phis; is satisfied at p, then replace I by I′.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. The meaning of correctness is that for any program π, if Rewrite(π, π′, p,I ⇒ I′ if &phis;) then [[π]] = [[π′]], i.e. π and π′ have exactly the same semantics.