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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
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)
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)
Coquand, T., Dybjer, P.: Intuitionistic model constructions and nor- malization proofs. Mathematical Structures in Computer Science 7, 75–94 (1997)
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)
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)
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
Danvy, O., Dybjer, P. (eds.): Preliminary Proceedings of the APPSEM Workshop on Normalization by Evaluation, Chalmers, Sweeden (May 1998) BRICS Note NS-98-1
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)
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)
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)
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)
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)
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)
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)
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)
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)
Plotkin, G.D.: LCF considered as a programming language. Theoretical Computer Science 5(3), 223–255 (1977)
Yang, Z.: Encoding types in ML-like languages. In: International Conference on Functional Programming, Baltimore, Maryland, September 1998, pp. 289–300 (1998)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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