Advertisement

A Framework for Formal Verification of Compiler Optimizations

  • William Mansky
  • Elsa Gunter
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6172)

Abstract

In this article, we describe a framework for formally verifying the correctness of compiler optimizations. We begin by giving formal semantics to a variation of the TRANS language [6], which is designed to express optimizations as transformations on control-flow graphs using temporal logic side conditions. We then formalize the idea of correctness of a TRANS optimization, and prove general lemmas about correctness that can form the basis of a proof of correctness for a particular optimization. We present an implementation of the framework in Isabelle, and as a proof of concept, demonstrate a proof of correctness of an algorithm for converting programs into static single assignment form.

Keywords

optimizing compilers theorem proving program transformations temporal logic 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Alpern, B., Wegman, M.N., Zadeck, F.K.: Detecting equality of variables in programs. In: POPL ’88: Proceedings of the 15th ACM SIGPLAN-SIGACT symposium on Principles of Programming Languages, pp. 1–11. ACM, New York (1988)CrossRefGoogle Scholar
  2. 2.
    Alur, R., Henzinger, T.A., Kupferman, O.: Alternating-time temporal logic. J. ACM 49(5), 672–713 (2002)CrossRefMathSciNetGoogle Scholar
  3. 3.
    Appel, A.W.: Modern Compiler Implementation in ML. Cambridge University Press, New York (2004)Google Scholar
  4. 4.
    Ben-Ari, M., Manna, Z., Pnueli, A.: The temporal logic of branching time. In: POPL ’81: Proceedings of the 8th ACM SIGPLAN-SIGACT symposium on Principles of Programming Languages, pp. 164–176. ACM, New York (1981)CrossRefGoogle Scholar
  5. 5.
    Blech, J.O., Glesner, S.: A formal correctness proof for code generation from ssa form in isabelle/hol. In: Proceedings der 3. Arbeitstagung Programmiersprachen (ATPS) auf der 34. Jahrestagung der Gesellschaft für Informatik, September 2004. Lecture Notes in Informatics (2004), http://www.info.uni-karlsruhe.de/papers/Blech-Glesner-ATPS-2004.pdf
  6. 6.
    Kalvala, S., Warburton, R., Lacey, D.: Program transformations using temporal logic side conditions. ACM Trans. Program. Lang. Syst. 31(4), 1–48 (2009)CrossRefGoogle Scholar
  7. 7.
    Lacey, D., Jones, N.D., Van Wyk, E., Frederiksen, C.C.: Proving correctness of compiler optimizations by temporal logic. In: POPL ’02: Proceedings of the 29th ACM SIGPLAN-SIGACT symposium on Principles of Programming Languages, pp. 283–294. ACM, New York (2002)CrossRefGoogle Scholar
  8. 8.
    Leroy, X.: Formal certification of a compiler back-end or: programming a compiler with a proof assistant. In: POPL ’06: Conference record of the 33rd ACM SIGPLAN-SIGACT symposium on Principles of Programming Languages, pp. 42–54. ACM, New York (2006)CrossRefGoogle Scholar
  9. 9.
    Leroy, X.: A formally verified compiler back-end. J. Autom. Reason. 43(4), 363–446 (2009)zbMATHCrossRefMathSciNetGoogle Scholar
  10. 10.
    Mansky, W.: TRANS in Isabelle, http://www.cs.illinois.edu/homes/mansky1
  11. 11.
    McKeeman, W.M.: A formally verified compiler backend. Digital Technical Journal 10(1), 100–107 (1998)Google Scholar
  12. 12.
    Moore, J.S.: A mechanically verified language implementation. J. Autom. Reason. 5(4), 461–492 (1989)Google Scholar
  13. 13.
    Pnueli, A., Siegel, M., Singerman, E.: Translation validation. In: Steffen, B. (ed.) TACAS 1998. LNCS, vol. 1384, pp. 151–166. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  14. 14.
    Sarkar, V.: Analysis and optimization of explicitly parallel programs using the parallel program graph representation. In: Huang, C.-H., Sadayappan, P., Sehr, D. (eds.) LCPC 1997. LNCS, vol. 1366, pp. 94–113. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  15. 15.
    Tristan, J.B., Leroy, X.: Formal verification of translation validators: a case study on instruction scheduling optimizations. In: POPL ’08: Proceedings of the 35th annual ACM SIGPLAN-SIGACT symposium on Principles of Programming Languages, pp. 17–27. ACM, New York (2008)CrossRefGoogle Scholar
  16. 16.
    Visser, E., Benaissa, Z.e.A., Tolmach, A.: Building program optimizers with rewriting strategies. SIGPLAN Not. 34(1), 13–26 (1999)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2010

Authors and Affiliations

  • William Mansky
    • 1
  • Elsa Gunter
    • 1
  1. 1.Department of Computer ScienceUniversity of Illinois at Urbana-ChampaignUrbana

Personalised recommendations