Skip to main content

A Semantic Account of Type-Directed Partial Evaluation

  • Conference paper
Principles and Practice of Declarative Programming (PPDP 1999)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1702))

Abstract

We formally characterize partial evaluation of functional programs as a normalization problem in an equational theory, and derive a type-based normalization-by-evaluation algorithm for computing normal forms in this setting. We then establish the correctness of this algorithm using a semantic argument based on Kripke logical relations. For simplicity, the results are stated for a non-strict, purely functional language; but the methods are directly applicable to stating and proving correctness of type-directed partial evaluation in ML-like languages as well.

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. Berger, U.: Program extraction from normalization proofs. In: Bezem, M., Groote, J.F. (eds.) TLCA 1993. LNCS, vol. 664, pp. 91–106. Springer, Heidelberg (1993)

    Chapter  Google Scholar 

  2. Berger, U., Schwichtenberg, H.: An inverse of the evaluation functional for typed λ-calculus. In: Proceedings of the Sixth Annual IEEE Symposium on Logic in Computer Science, Amsterdam, The Netherlands, July 1991, pp. 203–211 (1991)

    Google Scholar 

  3. Coquand, T., Dybjer, P.: Intuitionistic model constructions and nor- malization proofs. Mathematical Structures in Computer Science 7, 75–94 (1997)

    Article  MATH  MathSciNet  Google Scholar 

  4. Danvy, O.: Type-directed partial evaluation. In: 23rd ACM Symposium on Principles of Programming Languages, St. Petersburg Beach, Florida, January 1996, pp. 242–257 (1996)

    Google Scholar 

  5. Danvy, O.: Online type-directed partial evaluation. In: Sato, M., Toyama, Y. (eds.) Proceedings of the Third Fuji International Symposium on Functional and Logic Programming, Kyoto, Japan, April 1998, pp. 271–295 (1998)

    Google Scholar 

  6. Danvy, O.: Type-directed partial evaluation. Lecture Notes BRICS LN-98-3, Department of Computer Science, University of Aarhus, Aarhus, Denmark (December 1998); To appear in LNCS

    Google Scholar 

  7. Danvy, O., Dybjer, P. (eds.): Preliminary Proceedings of the APPSEM Workshop on Normalization by Evaluation, Chalmers, Sweeden (May 1998) BRICS Note NS-98-1

    Google Scholar 

  8. Danvy, O., Vestergaard, R.: Semantics-based compiling: A case study in type-directed partial evaluation. In: Kuchen, H., Swierstra, S.D. (eds.) PLILP 1996. LNCS, vol. 1140, pp. 182–197. Springer, Heidelberg (1996)

    Google Scholar 

  9. Davies, R., Pfenning, F.: A modal analysis of staged computation. In: 23rd ACM Symposium on Principles of Programming Languages, St. Petersburg Beach, Florida, January 1996, pp. 258–270 (1996)

    Google Scholar 

  10. Filinski, A.: Representing monads. In: Proceedings of the 21st ACM SIGPLAN- SIGACT Symposium on Principles of Programming Languages, Portland, Oregon, January 1994, pp. 446–457 (1994)

    Google Scholar 

  11. William, L.: Modular compilers based on monad transformers. In: Proceedings of the IEEE International Conference on Computer Languages, Chicago, Illinois, pp. 122–131. IEEE Computer Society, Los Alamitos (1998)

    Google Scholar 

  12. Helsen, S., Thiemann, P.: Two flavors of offline partial evaluation. In: Hsiang, J., Ohori, A. (eds.) ASIAN 1998. LNCS, vol. 1538, pp. 188–205. Springer, Heidelberg (1998)

    Chapter  Google Scholar 

  13. Holst, C.K., Launchbury, J.: Handwriting cogen to avoid problems with static typing. In: Draft Proceedings, Fourth Annual Glasgow Workshop on Functional Programming, Skye, Scotland, pp. 210–218 (1991)

    Google Scholar 

  14. Jones, N.D., Gomard, C.K., Sestoft, P.: Partial Evaluation and Automatic Program Generation. In: Prentice Hall International Series in Computer Science, Prentice-Hall, Englewood Cliffs (1993)

    Google Scholar 

  15. Moggi, E.: Computational lambda-calculus and monads. In: Proceedings of the Fourth Annual Symposium on Logic in Computer Science, Pacific Grove, California, pp. 14–23. IEEE, Los Alamitos (1989)

    Chapter  Google Scholar 

  16. Moggi, E., Taha, W., Benaissa, Z.E.-A., Sheard, T.: An idealized MetaML: Simpler and more expressive. In: Swierstra, S.D. (ed.) ESOP 1999. LNCS, vol. 1576, pp. 193–207. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  17. Plotkin, G.D.: LCF considered as a programming language. Theoretical Computer Science 5(3), 223–255 (1977)

    Article  MathSciNet  Google Scholar 

  18. Yang, Z.: Encoding types in ML-like languages. In: International Conference on Functional Programming, Baltimore, Maryland, September 1998, pp. 289–300 (1998)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1999 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Filinski, A. (1999). A Semantic Account of Type-Directed Partial Evaluation. In: Nadathur, G. (eds) Principles and Practice of Declarative Programming. PPDP 1999. Lecture Notes in Computer Science, vol 1702. Springer, Berlin, Heidelberg. https://doi.org/10.1007/10704567_23

Download citation

  • DOI: https://doi.org/10.1007/10704567_23

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-66540-3

  • Online ISBN: 978-3-540-48164-5

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics