Skip to main content

A Framework for Formal Verification of Compiler Optimizations

  • Conference paper
Interactive Theorem Proving (ITP 2010)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 6172))

Included in the following conference series:

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  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)

    Chapter  Google Scholar 

  2. Alur, R., Henzinger, T.A., Kupferman, O.: Alternating-time temporal logic. J. ACM 49(5), 672–713 (2002)

    Article  MathSciNet  Google Scholar 

  3. Appel, A.W.: Modern Compiler Implementation in ML. Cambridge University Press, New York (2004)

    Google Scholar 

  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)

    Chapter  Google Scholar 

  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. Kalvala, S., Warburton, R., Lacey, D.: Program transformations using temporal logic side conditions. ACM Trans. Program. Lang. Syst. 31(4), 1–48 (2009)

    Article  Google Scholar 

  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)

    Chapter  Google Scholar 

  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)

    Chapter  Google Scholar 

  9. Leroy, X.: A formally verified compiler back-end. J. Autom. Reason. 43(4), 363–446 (2009)

    Article  MATH  MathSciNet  Google Scholar 

  10. Mansky, W.: TRANS in Isabelle, http://www.cs.illinois.edu/homes/mansky1

  11. McKeeman, W.M.: A formally verified compiler backend. Digital Technical Journal 10(1), 100–107 (1998)

    Google Scholar 

  12. Moore, J.S.: A mechanically verified language implementation. J. Autom. Reason. 5(4), 461–492 (1989)

    Google Scholar 

  13. Pnueli, A., Siegel, M., Singerman, E.: Translation validation. In: Steffen, B. (ed.) TACAS 1998. LNCS, vol. 1384, pp. 151–166. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  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)

    Chapter  Google Scholar 

  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)

    Chapter  Google Scholar 

  16. Visser, E., Benaissa, Z.e.A., Tolmach, A.: Building program optimizers with rewriting strategies. SIGPLAN Not. 34(1), 13–26 (1999)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2010 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Mansky, W., Gunter, E. (2010). A Framework for Formal Verification of Compiler Optimizations. In: Kaufmann, M., Paulson, L.C. (eds) Interactive Theorem Proving. ITP 2010. Lecture Notes in Computer Science, vol 6172. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-14052-5_26

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-14052-5_26

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-14051-8

  • Online ISBN: 978-3-642-14052-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics