Skip to main content

A Linear First-Order Functional Intermediate Language for Verified Compilers

  • Conference paper
  • First Online:

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

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.

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

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.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

Learn about institutional subscriptions

Notes

  1. 1.

    http://www.ps.uni-saarland.de/~sdschn/publications/lvc15.

References

  1. Appel, A.W.: Compiling with Continuations. Cambridge University Press, Cambridge (1992)

    Google Scholar 

  2. Appel, A.W.: SSA is functional programming. In: SIGPLAN Notices, vol. 33, no. 4 (1998)

    Google Scholar 

  3. 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)

    Chapter  Google Scholar 

  4. Beringer, L., MacKenzie, K., Stark, I.: Grail: a functional form for imperative mobile code. In: ENTCS, vol. 85, no. 1 (2003)

    Google Scholar 

  5. 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)

    Chapter  Google Scholar 

  6. Chakravarty, M.M.T., Keller, G., Zadarnowski, P.: A functional perspective on SSA optimisation algorithms. In: ENTCS, vol. 82, no. 2 (2003)

    Google Scholar 

  7. Chlipala, A.: A verified compiler for an impure functional language. In: POPL (2010)

    Google Scholar 

  8. 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)

    Google Scholar 

  9. Hack, S., Grund, D., Goos, G.: Register allocation for programs in SSA-Form. In: CC (2006)

    Google Scholar 

  10. Kelsey, R.A.: A correspondence between continuation passing style and static single assignment form. In: SIGPLAN Notices, vol. 30, no. 3 (1995)

    Google Scholar 

  11. Landin, P.J.: Correspondence between ALGOL 60 and Church’s Lambda-notation: part I. In: CACM, vol. 8, no. 2 (1965)

    Google Scholar 

  12. Lattner, C., Adve, V.S.: LLVM: a Compilation framework for lifelong program analysis and transformation. In: CGO (2004)

    Google Scholar 

  13. Leroy, X.: Formal verification of a realistic compiler. In: CACM, vol. 52, no. 7 (2009)

    Google Scholar 

  14. Nipkow, T., Klein, G.: Concrete Semantics: With Isabelle/HOL. Springer Publishing Company, Incorporated, Switzerland (2014)

    Book  Google Scholar 

  15. Reynolds, J.C.: The discoveries of continuations. LSC 6(3–4), 23–247 (1993)

    MATH  Google Scholar 

  16. Sabry, A., Felleisen, M.: Reasoning about programs in continuation-passing style. In: LSC, vol. 6, no. (3-4) (1993)

    Google Scholar 

  17. Zhao, J., Nagarakatte, S., Martin, M.M.K., Zdancewic, S.: Formal verification of SSA-based Optimizations for LLVM. In: PLDI (2013)

    Google Scholar 

  18. Zhao, J., Nagarakatte, S., Martin, M.M.K., Zdancewic, S.: Formalizing LLVM intermediate representation for verified program transformations. In: POPL (2012)

    Google Scholar 

  19. Schneider, S., Smolka, G., Hack, S.: A first-order functional intermediate language for verified compilers. CoRR (2015). 1503.08665

Download references

Acknowledgments

This research has been supported in part by a Google European Doctoral Fellowship granted to the first author.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Sigurd Schneider .

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics