Abstract
We present the linear first-order intermediate language IL for verified compilers. IL is a functional language with calls to a nondeterministic environment. We give IL terms a second, imperative semantic interpretation and obtain a register transfer language. For the imperative interpretation we establish a notion of live variables. Based on live variables, we formulate a decidable property called coherence ensuring that the functional and the imperative interpretation of a term coincide. We formulate a register assignment algorithm for IL and prove its correctness. The algorithm translates a functional IL program into an equivalent imperative IL program. Correctness follows from the fact that the algorithm reaches a coherent program after consistently renaming local variables. We prove that the maximal number of live variables in the initial program bounds the number of different variables in the final coherent program. The entire development is formalized in Coq.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
Appel, A.W.: Compiling with Continuations. Cambridge University Press, Cambridge (1992)
Appel, A.W.: SSA is functional programming. In: SIGPLAN Notices, vol. 33, no. 4 (1998)
Barthe, G., Demange, D., Pichardie, D.: A formally verified SSA-based middle-end. In: Seidl, H. (ed.) Programming Languages and Systems. LNCS, vol. 7211, pp. 47–66. Springer, Heidelberg (2012)
Beringer, L., MacKenzie, K., Stark, I.: Grail: a functional form for imperative mobile code. In: ENTCS, vol. 85, no. 1 (2003)
Blazy, S., Robillard, B., Appel, A.W.: Formal verification of coalescing graph-coloring register allocation. In: Gordon, A.D. (ed.) ESOP 2010. LNCS, vol. 6012, pp. 145–164. Springer, Heidelberg (2010)
Chakravarty, M.M.T., Keller, G., Zadarnowski, P.: A functional perspective on SSA optimisation algorithms. In: ENTCS, vol. 82, no. 2 (2003)
Chlipala, A.: A verified compiler for an impure functional language. In: POPL (2010)
Cytron, R., Ferrante, J., Rosen, B.K., Wegman, M.N., Zadeck, F.K.: Efficiently computing static single assignment form and the control dependence graph. In: TOPLAS, vol. 13, no. 4 (1991)
Hack, S., Grund, D., Goos, G.: Register allocation for programs in SSA-Form. In: CC (2006)
Kelsey, R.A.: A correspondence between continuation passing style and static single assignment form. In: SIGPLAN Notices, vol. 30, no. 3 (1995)
Landin, P.J.: Correspondence between ALGOL 60 and Church’s Lambda-notation: part I. In: CACM, vol. 8, no. 2 (1965)
Lattner, C., Adve, V.S.: LLVM: a Compilation framework for lifelong program analysis and transformation. In: CGO (2004)
Leroy, X.: Formal verification of a realistic compiler. In: CACM, vol. 52, no. 7 (2009)
Nipkow, T., Klein, G.: Concrete Semantics: With Isabelle/HOL. Springer Publishing Company, Incorporated, Switzerland (2014)
Reynolds, J.C.: The discoveries of continuations. LSC 6(3–4), 23–247 (1993)
Sabry, A., Felleisen, M.: Reasoning about programs in continuation-passing style. In: LSC, vol. 6, no. (3-4) (1993)
Zhao, J., Nagarakatte, S., Martin, M.M.K., Zdancewic, S.: Formal verification of SSA-based Optimizations for LLVM. In: PLDI (2013)
Zhao, J., Nagarakatte, S., Martin, M.M.K., Zdancewic, S.: Formalizing LLVM intermediate representation for verified program transformations. In: POPL (2012)
Schneider, S., Smolka, G., Hack, S.: A first-order functional intermediate language for verified compilers. CoRR (2015). 1503.08665
Acknowledgments
This research has been supported in part by a Google European Doctoral Fellowship granted to the first author.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2015 Springer International Publishing Switzerland
About this paper
Cite this paper
Schneider, S., Smolka, G., Hack, S. (2015). A Linear First-Order Functional Intermediate Language for Verified Compilers. In: Urban, C., Zhang, X. (eds) Interactive Theorem Proving. ITP 2015. Lecture Notes in Computer Science(), vol 9236. Springer, Cham. https://doi.org/10.1007/978-3-319-22102-1_23
Download citation
DOI: https://doi.org/10.1007/978-3-319-22102-1_23
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-22101-4
Online ISBN: 978-3-319-22102-1
eBook Packages: Computer ScienceComputer Science (R0)