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.
Supplemental Material
- Amal Ahmed. 2006. Step-Indexed Syntactic Logical Relations for Recursive and Quantified Types. In European Symposium on Programming (ESOP). 69–83. Google Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Amal Ahmed, Derek Dreyer, and Andreas Rossberg. 2009. State-Dependent Representation Independence. In ACM Symposium on Principles of Programming Languages (POPL), Savannah, Georgia. Google Scholar
Digital Library
- Nick Benton and Chung-Kil Hur. 2009. Biorthogonality, Step-Indexing and Compiler Correctness. In International Conference on Functional Programming (ICFP), Edinburgh, Scotland. Google Scholar
Digital Library
- Lennart Beringer, Gordon Stewart, Robert Dockins, and Andrew W. Appel. 2014. Verified Compilation for Shared-Memory C. In European Symposium on Programming (ESOP). Google Scholar
Digital Library
- William J. Bowman and Amal Ahmed. 2015. Noninterference for Free. In International Conference on Functional Programming (ICFP), Vancouver, British Columbia, Canada. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- Matthias Felleisen. 1990. On the Expressive Power of Programming Languages. In Science of Computer Programming. Springer-Verlag, 134–151.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Xavier Leroy. 2009. A formally verified compiler back-end. Journal of Automated Reasoning 43, 4 (2009), 363–446. Google Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- John McCarthy. 1959. A Basis for a Mathematical Theory of Computation. Studies in Logic and the Foundations of Mathematics, 33–70. Google Scholar
Digital Library
- John McCarthy and James Painter. 1967. Correctness of a compiler for arithmetic expressions. American Mathematical Society, 33–41.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- Daniel Patterson and Amal Ahmed. 2019. CCC: Supplementary Materials. https://dbp.io/pubs/2019/ccc/Google Scholar
- 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 Scholar
Digital Library
- James T. Perconti and Amal Ahmed. 2014. Verifying an Open Compiler Using Multi-Language Semantics. In European Symposium on Programming (ESOP). Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- James Gordon Stewart. 2015. Verified Separate Compilation for C. Ph.D. Dissertation. Princeton University.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
Index Terms
The next 700 compiler correctness theorems (functional pearl)
Recommendations
DimSum: A Decentralized Approach to Multi-language Semantics and Verification
Prior work on multi-language program verification has achieved impressive results, including the compositional verification of complex compilers. But the existing approaches to this problem impose a variety of restrictions on the overall structure of ...
Verified peephole optimizations for CompCert
PLDI '16Transformations over assembly code are common in many compilers. These transformations are also some of the most bug-dense compiler components. Such bugs could be elim- inated by formally verifying the compiler, but state-of-the- art formally verified ...
A Surprisingly Simple Lua Compiler
SBLP '21: Proceedings of the 25th Brazilian Symposium on Programming LanguagesDynamically-typed programming languages are often implemented using interpreters, which offer several advantages in terms of portability and flexibility of the implementation. However, as a language matures and its programs get bigger, programmers may ...






Comments