Advertisement

Tactic-Based Optimized Compilation of Functional Programs

  • Thomas Meyer
  • Burkhart Wolff
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3839)

Abstract

Within a framework of correct code-generation from HOL-specifications, we present a particular instance concerned with the optimized compilation of a lazy language (called MiniHaskell) to a strict language (called MiniML).

Both languages are defined as shallow embeddings into denotational semantics based on Scott’s cpo’s, leading to a derivation of the corresponding operational semantics in order to cross-check the basic definitions.

On this basis, translation rules from one language to the other were formally derived in Isabelle/HOL. Particular emphasis is put on the optimized compilation of function applications leading to the side-calculi inferring e.g. strictness of functions.

The derived rules were grouped and set-up as an instance of our generic, tactic-based translator for specifications to code.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Boulton, R., Gordon, A., Gordon, M., Harrison, J., Herbert, J., Tassel, J.V.: Experience with embedding hardware description languages in HOL. In: Stavridou, V., Melham, T.F., Boute, R.T. (eds.) Proceedings of the IFIP TC10/WG 10.2 International Conference on Theorem Provers in Circuit Design: Theory, Practice and Experience. IFIP Transactions, vol. A-10, Nijmegen, The Netherlands, pp. 129–156. North-Holland/Elsevier, Amsterdam (1992)Google Scholar
  2. 2.
    Danvy, O., Filinski, A.: Representing control: a study of the CPS transformation. Mathematical Structures in Computer Science 2(4), 361–391 (1992)zbMATHCrossRefMathSciNetGoogle Scholar
  3. 3.
    Glesner, S.: Using program checking to ensure the correctness of compiler implementations. JUCS 9(3) (2003)Google Scholar
  4. 4.
    Klein, G., Nipkow, T.: A machine-checked model for a java-like language, virtual machine and compiler. Technical report, TUM (March 2003)Google Scholar
  5. 5.
    Meyer, T., Wolff, B.: Correct code-generation in a generic framework. In: Aargaard, M., Harrison, J., Schubert, T. (eds.) TPHOLs 2000. LNCS, vol. 1869, pp. 213–230. Springer, Heidelberg (2000)Google Scholar
  6. 6.
    Milner, R., Tofte, M., Harper, R. (eds.): The Definition of Standard ML (revised). MIT Press, Cambridge (1997)Google Scholar
  7. 7.
    Müller, O., Nipkow, T., Oheimb, D.v., Slotosch, O.: HOLCF = HOL + LCF. Journal of Functional Programming 9, 191–223 (1999)zbMATHCrossRefMathSciNetGoogle Scholar
  8. 8.
    Nipkow, T.: Winskel is (almost) right: Towards a mechanized semantics textbook. Formal Aspects of Computing 10, 171–186 (1998)zbMATHCrossRefGoogle Scholar
  9. 9.
    Nipkow, T., Paulson, L.C., Wenzel, M.: Isabelle/HOL — A Proof Assistant for Higher-Order Logic. LNCS, vol. 2283. Springer, Heidelberg (2002)zbMATHGoogle Scholar
  10. 10.
    Tej, H., Wolff, B.: A corrected failure-divergence model for csp in isabelle/hol. In: Fitzgerald, J., Jones, C., Lucas, P. (eds.) FME 1997. LNCS, vol. 1313, pp. 318–337. Springer, Heidelberg (1997)Google Scholar
  11. 11.
    Winskel, G.: The Formal Semantics of Programming Languages. MIT Press, Cambridge (1993)zbMATHGoogle Scholar
  12. 12.
    Zuck, L., Pnueli, A., Fang, Y., Goldberg, B.: A methodology for the translation validation of optimizingcompilers. JUCS 9(3) (2003)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Thomas Meyer
    • 1
  • Burkhart Wolff
    • 2
  1. 1.Universität BremenGermany
  2. 2.ETH ZürichSwitzerland

Personalised recommendations