skip to main content
research-article
Open Access

The next 700 compiler correctness theorems (functional pearl)

Published:26 July 2019Publication History
Skip Abstract Section

Abstract

Compiler correctness is an old problem, with results stretching back beyond the last half-century. Founding the field, John McCarthy and James Painter set out to build a "completely trustworthy compiler". And yet, until quite recently, even despite truly impressive verification efforts, the theorems being proved were only about the compilation of whole programs, a theoretically quite appealing but practically unrealistic simplification. For a compiler correctness theorem to assure complete trust, the theorem must reflect the reality of how the compiler will be used.

There has been much recent work on more realistic "compositional" compiler correctness aimed at proving correct compilation of components while supporting linking with components compiled from different languages using different compilers. However, the variety of theorems, stated in remarkably different ways, raises questions about what researchers even mean by a "compiler is correct." In this pearl, we develop a new framework with which to understand compiler correctness theorems in the presence of linking, and apply it to understanding and comparing this diversity of results. In doing so, not only are we better able to assess their relative strengths and weaknesses, but gain insight into what we as a community should expect from compiler correctness theorems of the future.

Skip Supplemental Material Section

Supplemental Material

a85-patterson.webm

References

  1. Amal Ahmed. 2006. Step-Indexed Syntactic Logical Relations for Recursive and Quantified Types. In European Symposium on Programming (ESOP). 69–83. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Amal Ahmed. 2015. Verified Compilers for a Multi-Language World. In 1st Summit on Advances in Programming Languages (SNAPL 2015) (Leibniz International Proceedings in Informatics (LIPIcs)), Thomas Ball, Rastislav Bodik, Shriram Krishnamurthi, Benjamin S. Lerner, and Greg Morrisett (Eds.), Vol. 32. 15–31.Google ScholarGoogle Scholar
  3. Amal Ahmed and Matthias Blume. 2008. Typed Closure Conversion Preserves Observational Equivalence. In International Conference on Functional Programming (ICFP), Victoria, British Columbia, Canada. 157–168. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Amal Ahmed and Matthias Blume. 2011. An Equivalence-Preserving CPS Translation via Multi-Language Semantics. In International Conference on Functional Programming (ICFP), Tokyo, Japan. 431–444. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Amal Ahmed, Derek Dreyer, and Andreas Rossberg. 2009. State-Dependent Representation Independence. In ACM Symposium on Principles of Programming Languages (POPL), Savannah, Georgia. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Nick Benton and Chung-Kil Hur. 2009. Biorthogonality, Step-Indexing and Compiler Correctness. In International Conference on Functional Programming (ICFP), Edinburgh, Scotland. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Lennart Beringer, Gordon Stewart, Robert Dockins, and Andrew W. Appel. 2014. Verified Compilation for Shared-Memory C. In European Symposium on Programming (ESOP). Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. William J. Bowman and Amal Ahmed. 2015. Noninterference for Free. In International Conference on Functional Programming (ICFP), Vancouver, British Columbia, Canada. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Adam Chlipala. 2007. A Certified Type-Preserving Compiler from Lambda Calculus to Assembly Language. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), San Diego, California. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Matthias Felleisen. 1990. On the Expressive Power of Programming Languages. In Science of Computer Programming. Springer-Verlag, 134–151.Google ScholarGoogle Scholar
  11. Ronghui Gu, Jérémie Koenig, Tahina Ramananandro, Zhong Shao, Xiongnan (Newman) Wu, Shu-Chun Weng, Haozhong Zhang, and Yu Guo. 2015. Deep Specifications and Certified Abstraction Layers. In ACM Symposium on Principles of Programming Languages (POPL), Mumbai, India. 595–608. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Chung-Kil Hur and Derek Dreyer. 2011. A Kripke logical relation between ML and assembly. In ACM Symposium on Principles of Programming Languages (POPL), Austin, Texas. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Hanru Jiang, Hongjin Liang, Siyang Xiao, Junpeng Zha, and Xinyu Feng. 2019. Towards certified separate compilation for concurrent programs. In Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation. ACM, 111–125. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Jeehoon Kang, Yoonseung Kim, Chung-Kil Hur, Derek Dreyer, and Viktor Vafeiadis. 2016. Lightweight Verification of Separate Compilation. In ACM Symposium on Principles of Programming Languages (POPL), St. Petersburg, Florida. ACM, 178–190. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Xavier Leroy. 2006. Formal certification of a compiler back-end or: programming a compiler with a proof assistant. In ACM Symposium on Principles of Programming Languages (POPL), Charleston, South Carolina. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Xavier Leroy. 2009. A formally verified compiler back-end. Journal of Automated Reasoning 43, 4 (2009), 363–446. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Phillip Mates, Jamie Perconti, and Amal Ahmed. 2019. Under Control: Compositionally Correct Closure Conversion with Mutable State. In ACM Conference on Principles and Practice of Declarative Programming (PPDP).Google ScholarGoogle Scholar
  18. Jacob Matthews and Robert Bruce Findler. 2007. Operational Semantics for Multi-Language Programs. In ACM Symposium on Principles of Programming Languages (POPL), Nice, France. 3–10. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. John McCarthy. 1959. A Basis for a Mathematical Theory of Computation. Studies in Logic and the Foundations of Mathematics, 33–70. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. John McCarthy and James Painter. 1967. Correctness of a compiler for arithmetic expressions. American Mathematical Society, 33–41.Google ScholarGoogle Scholar
  21. Yasuhiko Minamide, Greg Morrisett, and Robert Harper. 1996. Typed Closure Conversion. In ACM Symposium on Principles of Programming Languages (POPL), St. Petersburg Beach, Florida. 271–283. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. F Lockwood Morris. 1973. Advice on structuring compilers and proving them correct. In Proceedings of the 1st annual ACM SIGACT-SIGPLAN symposium on Principles of programming languages. ACM, 144–152. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Georg Neis, Chung-Kil Hur, Jan-Oliver Kaiser, Craig McLaughlin, Derek Dreyer, and Viktor Vafeiadis. 2015. Pilsner: A Compositionally Verified Compiler for a Higher-Order Imperative Language. In International Conference on Functional Programming (ICFP), Vancouver, British Columbia, Canada. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Max S. New, William J. Bowman, and Amal Ahmed. 2016. Fully Abstract Compilation via Universal Embedding. In International Conference on Functional Programming (ICFP), Nara, Japan. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Liam O’Connor, Zilin Chen, Christine Rizkallah, Sidney Amani, Japheth Lim, Toby Murray, Yutaka Nagashima, Thomas Sewell, and Gerwin Klein. 2016. Refinement through restraint: Bringing down the cost of verification. In ACM SIGPLAN Notices, Vol. 51. ACM, 89–102. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Marco Patrignani, Pieter Agten, Raoul Strackx, Bart Jacobs, Dave Clarke, and Frank Piessens. 2015. Secure Compilation to Protected Module Architectures. ACM Transactions on Programming Languages and Systems 37, 2, Article 6 (April 2015), 50 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Marco Patrignani, Amal Ahmed, and Dave Clarke. 2019. Formal Approaches to Secure Compilation: A Survey of Fully Abstract Compilation and Related Work. Comput. Surveys 51, 6, Article 125 (Feb. 2019), 36 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Daniel Patterson and Amal Ahmed. 2017. Linking Types for Multi-Language Software: Have Your Cake and Eat It Too. In 2nd Summit on Advances in Programming Languages (SNAPL 2017) (Leibniz International Proceedings in Informatics (LIPIcs)), Benjamin S. Lerner, Rastislav Bodík, and Shriram Krishnamurthi (Eds.), Vol. 71. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany, 12:1–12:15.Google ScholarGoogle Scholar
  29. Daniel Patterson and Amal Ahmed. 2019. CCC: Supplementary Materials. https://dbp.io/pubs/2019/ccc/Google ScholarGoogle Scholar
  30. Daniel Patterson, Jamie Perconti, Christos Dimoulas, and Amal Ahmed. 2017. FunTAL: Reasonably Mixing a Functional Language with Assembly. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), Barcelona, Spain. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. James T. Perconti and Amal Ahmed. 2014. Verifying an Open Compiler Using Multi-Language Semantics. In European Symposium on Programming (ESOP). Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Tahina Ramananandro, Zhong Shao, Shu-Chun Weng, Jérémie Koenig, and Yuchen Fu. 2015. A Compositional Semantics for Verified Separate Compilation and Linking. In Proceedings of the 2015 Conference on Certified Programs and Proofs (CPP ’15). ACM, New York, NY, USA, 3–14. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Jerome H. Saltzer and Michael D. Schroeder. 1975. The Protection of Information in Computer Systems. Proc. IEEE 63, 9 (September 1975), 1278–1308. http://web.mit.edu/Saltzer/www/publications/protection/index.htmlGoogle ScholarGoogle ScholarCross RefCross Ref
  34. Jaroslav ˆ Sevčik, Viktor Vafeiadis, Francesco Zappa Nardelli, Suresh Jagannathan, and Peter Sewell. 2011. Relaxed-memory concurrency and verified compilation. ACM SIGPLAN Notices 46, 1 (2011), 43–54. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Gordon Stewart, Lennart Beringer, Santiago Cuellar, and Andrew W. Appel. 2015. Compositional CompCert. In ACM Symposium on Principles of Programming Languages (POPL), Mumbai, India. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. James Gordon Stewart. 2015. Verified Separate Compilation for C. Ph.D. Dissertation. Princeton University.Google ScholarGoogle Scholar
  37. Peng Wang, Santiago Cuellar, and Adam Chlipala. 2014. Compiler Verification Meets Cross-Language Linking via Data Abstraction. In ACM Symposium on Object Oriented Programming: Systems, Languages, and Applications (OOPSLA). Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Yuting Wang, Pierre Wilke, and Zhong Shao. 2019. An abstract stack based approach to verified compositional compilation to machine code. Proceedings of the ACM on Programming Languages 3, POPL (2019), 62. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Xuejun Yang, Yang Chen, Eric Eide, and John Regehr. 2011. Finding and Understanding Bugs in C Compilers. In ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), San Jose, California. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. The next 700 compiler correctness theorems (functional pearl)

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image Proceedings of the ACM on Programming Languages
      Proceedings of the ACM on Programming Languages  Volume 3, Issue ICFP
      August 2019
      1054 pages
      EISSN:2475-1421
      DOI:10.1145/3352468
      Issue’s Table of Contents

      Copyright © 2019 Owner/Author

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 26 July 2019
      Published in pacmpl Volume 3, Issue ICFP

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!