Skip to main content

Proving Correctness of Compilers Using Structured Graphs

  • Conference paper
Functional and Logic Programming (FLOPS 2014)

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

Included in the following conference series:

Abstract

We present an approach to compiler implementation using Oliveira and Cook’s structured graphs that avoids the use of explicit jumps in the generated code. The advantage of our method is that it takes the implementation of a compiler using a tree type along with its correctness proof and turns it into a compiler implementation using a graph type along with a correctness proof. The implementation and correctness proof of a compiler using a tree type without explicit jumps is simple, but yields code duplication. Our method provides a convenient way of improving such a compiler without giving up the benefits of simple reasoning.

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 39.99
Price excludes VAT (USA)
  • Available as 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

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Ager, M.S., Biernacki, D., Danvy, O., Midtgaard, J.: From interpreter to compiler and virtual machine: A functional derivation. Tech. Rep. RS-03-14, BRICS, Department of Computer Science, University of Aarhus (2003)

    Google Scholar 

  2. Bahr, P.: Proving correctness of compilers using structured graphs (extended version). Tech. rep., University of Copenhagen (2014)

    Google Scholar 

  3. Bahr, P., Hutton, G.: Calculating correct compilers (2014) (unpublished manuscript)

    Google Scholar 

  4. Bernardy, J.P., Pouillard, N.: Names for free: polymorphic views of names and binders. In: Proceedings of the 2013 ACM SIGPLAN Symposium on Haskell, pp. 13–24. ACM (2013)

    Google Scholar 

  5. Chlipala, A.: Parametric higher-order abstract syntax for mechanized semantics. In: Proceeding of the 13th ACM SIGPLAN International Conference on Functional Programming, pp. 143–156. ACM (2008)

    Google Scholar 

  6. Chlipala, A.: A verified compiler for an impure functional language. In: Proceedings of the 37th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 93–106. ACM (2010)

    Google Scholar 

  7. Dave, M.A.: Compiler verification: a bibliography. SIGSOFT Softw. Eng. Notes 28(6), 2 (2003)

    Article  Google Scholar 

  8. Gill, A., Launchbury, J., Peyton Jones, S.L.: A short cut to deforestation. In: Proceedings of the Conference on Functional Programming Languages and Computer Architecture, pp. 223–232. ACM (1993)

    Google Scholar 

  9. Hutton, G.: Programming in Haskell, vol. 2. Cambridge University Press, Cambridge (2007)

    Book  MATH  Google Scholar 

  10. Hutton, G., Wright, J.: Compiling exceptions correctly. In: Kozen, D. (ed.) MPC 2004. LNCS, vol. 3125, pp. 211–227. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  11. Hutton, G., Wright, J.: What is the meaning of these constant interruptions? J. Funct. Program. 17(6), 777–792 (2007)

    MATH  MathSciNet  Google Scholar 

  12. Johann, P.: A generalization of short-cut fusion and its correctness proof. Higher Order Symbol. Comput. 15(4), 273–300 (2002)

    Article  MATH  Google Scholar 

  13. Leroy, X.: Formal certification of a compiler back-end or: programming a compiler with a proof assistant. In: Conference record of the 33rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 42–54. ACM (2006)

    Google Scholar 

  14. Marlow, S.: Haskell 2010 language report (2010)

    Google Scholar 

  15. Matsuda, K., Inaba, K., Nakano, K.: Polynomial-time inverse computation for accumulative functions with multiple data traversals. In: Proceedings of the ACM SIGPLAN 2012 Workshop on Partial Evaluation and Program Manipulation, pp. 5–14. ACM (2012)

    Google Scholar 

  16. Meijer, E.: Calculating Compilers. Ph.D. thesis, Katholieke Universiteit Nijmegen (1992)

    Google Scholar 

  17. Oliveira, B.C.D.S., Löh, A.: Abstract syntax graphs for domain specific languages. In: Proceedings of the ACM SIGPLAN 2013 Workshop on Partial Evaluation and Program Manipulation, pp. 87–96. ACM (2013)

    Google Scholar 

  18. Oliveira, B.C., Cook, W.R.: Functional programming with structured graphs. In: Proceedings of the 17th ACM SIGPLAN International Conference on Functional Programming, pp. 77–88. ACM (2012)

    Google Scholar 

  19. Ramsey, N., Dias, J.A., Peyton Jones, S.: Hoopl: a modular, reusable library for dataflow analysis and transformation. In: Proceedings of the Third ACM Haskell Symposium on Haskell, pp. 121–134. ACM (2010)

    Google Scholar 

  20. Ramsey, N., Dias, J.: An applicative control-flow graph based on huet’s zipper. In: Proceedings of the ACM-SIGPLAN Workshop on ML, pp. 105–126 (2006)

    Google Scholar 

  21. Wand, M.: Deriving target code as a representation of continuation semantics. ACM Trans. Program. Lang. Syst. 4(3), 496–517 (1982)

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this paper

Cite this paper

Bahr, P. (2014). Proving Correctness of Compilers Using Structured Graphs. In: Codish, M., Sumii, E. (eds) Functional and Logic Programming. FLOPS 2014. Lecture Notes in Computer Science, vol 8475. Springer, Cham. https://doi.org/10.1007/978-3-319-07151-0_14

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-07151-0_14

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-07150-3

  • Online ISBN: 978-3-319-07151-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics