# Normalization and Partial Evaluation

Conference paper

First Online:

## Abstract

We give an introduction to normalization by evaluation and type-directed partial evaluation. We first present normalization by evaluation for a combinatory version of Gödel System T. Then we show normalization by evaluation for typed lambda calculus with *β* and *η* conversion. Finally, we introduce the notion of binding time, and explain the method of type-directed partial evaluation for a small PCF-style functional programming language. We give algorithms for both call-by-name and call-by-value versions of this language.

## Keywords

Normal Form Partial Evaluation Functional Programming Functional Language Denotational Semantic
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

## Preview

Unable to display preview. Download preview PDF.

## References

- [ADHS01]Thorsten Altenkirch, Peter Dybjer, Martin Hofmann, and Philip Scott. Normalization by evaluation for typed lambda calculus with coproducts. In
*Proceedings of the 16th Annual IEEE Symposium on Logic in Computer Science*, pages 303–310, Boston, Massachusetts, June 2001.Google Scholar - [AHS95]Thorsten Altenkirch, Martin Hofmann, and Thomas Streicher. Categorical reconstruction of a reduction free normalization proof. In D. Pitt, D. E. Rydeheard, and P. Johnstone, editors,
*Category Theory and Computer Science, 6th International Conference*, number 953 in Lecture Notes in Computer Science, Cambridge, UK, August 1995.Google Scholar - [AHS96]Thorsten Altenkirch, Martin Hofmann, and Thomas Streicher. Reduction-free normalization for a polymorphic system. In
*Proceedings of the 11th Annual IEEE Symposium on Logic in Computer Science*, pages 98–106, New Brunswick, New Jersey, July 1996.Google Scholar - [Asa02]Kenichi Asai. Binding-time analysis for both static and dynamic expressions.
*New Generation Computing*, 20(1):27–51, 2002. Preliminary version available in the proceedings of SAS 1999 (LNCS 1694).Google Scholar - [Aug98]Lennart Augustsson. Cayenne-a language with dependent types. In
*ACM SIGPLAN International Conference on Functional Programming*, pages 239–250, Baltimore, Maryland, September 1998.Google Scholar - [Bar77]Henk Barendregt. The type free lambda calculus. In
*Handbook of Mathematical Logic*, pages 1092–1132. North-Holland, 1977.Google Scholar - [Bar90]Henk Barendregt. Functional programming and lambda calculus. In
*Handbook of Theoretical Computer Science*, pages 323–363. Elsevier, 1990.Google Scholar - [Bar92]Henk P. Barendregt. Lambda calculi with types. In
*Handbook of Logic in Computer Science*, volume 2, pages 117–309. Oxford University Press, 1992.MathSciNetGoogle Scholar - [Ber93]Ulrich Berger. Program extraction from normalization proofs. In M. Bezem and J. F. Groote, editors,
*Typed Lambda Calculi and Applications*, number 664 in Lecture Notes in Computer Science, pages 91–106, Utrecht, The Netherlands, March 1993.CrossRefGoogle Scholar - [BS91]Ulrich Berger and Helmut Schwichtenberg. An inverse of the evaluation functional for typed λ-calculus. In
*Proceedings of the Sixth Annual IEEE Symposium on Logic in Computer Science*, pages 203–211, Amsterdam, The Netherlands, July 1991.Google Scholar - [CD93a]Charles Consel and Olivier Danvy. Tutorial notes on partial evaluation. In
*Proceedings of the Twentieth Annual ACM Symposium on Principles of Programming Languages*, pages 493–501, 1993.Google Scholar - [CD93b]Thierry Coquand and Peter Dybjer. Intuitionistic model constructions and normalization proofs. In H. Barendregt and T. Nipkow, editors,
*Types for Proofs and Programs, International Workshop TYPES’93*, number 806 in Lecture Notes in Computer Science, Nijmegen, The Netherlands, May 1993.Google Scholar - [CD97]Thierry Coquand and Peter Dybjer. Intuitionistic model constructions and normalization proofs.
*Mathematical Structures in Computer Science*, 7:75–94, 1997.zbMATHCrossRefMathSciNetGoogle Scholar - [ČDS98]Djordje Čubrić, Peter Dybjer, and Philip Scott. Normalization and the Yoneda embedding.
*Mathematical Structures in Computer Science*, 8:153–192, 1998.CrossRefzbMATHGoogle Scholar - [Dan96]Olivier Danvy. Pragmatics of type-directed partial evaluation. In O. Danvy, R. Glück, and P. Thiemann, editors,
*Partial Evaluation*, number 1110 in Lecture Notes in Computer Science, pages 73–94, Dagstuhl, Germany, February 1996. Springer-Verlag. Extended version available as the technical report BRICS RS-96-15.Google Scholar - [Dan98]Olivier Danvy. Type-directed partial evaluation. In J. Hatcliff, T. Æ. Mogensen, and P. Thieman, editors,
*Partial Evaluation-Practice and Theory; Proceedings of the 1998 DIKU Summer School*, number 1706 in Lecture Notes in Computer Science, pages 367–411. Springer-Verlag, Copenhagen, Denmark, July 1998.Google Scholar - [DD98]Olivier Danvy and Peter Dybjer, editors.
*Proceedings of the 1998 APPSEM Workshop on Normalization by Evaluation, NBE’ 98*, (Gothenburg, Sweden, May 8–9, 1998), number NS-98-8 in Note Series, Department of Computer Science, University of Aarhus, May 1998. BRICS.Google Scholar - [DF90]Olivier Danvy and Andrzej Filinski. Abstracting control. In
*Proceedings of the 1990 ACM Conference on Lisp and Functional Programming*, pages 151–160, Nice, France, June 1990.CrossRefGoogle Scholar - [DMP95]Olivier Danvy, Karoline Malmkjær, and Jens Palsberg. The essence of eta-expansion in partial evaluation.
*Lisp and Symbolic Computation*, 8(3):209–227, 1995.CrossRefGoogle Scholar - [DV96]Olivier Danvy and René Vestergaard. Semantics-based compiling: A case study in type-directed partial evaluation. In
*Eighth International Symposium on Programming Language Implementation and Logic Programming*, number 1140 in Lecture Notes in Computer Science, pages 182–197, Aachen, Germany, September 1996.Google Scholar - [Fil99a]Andrzej Filinski. Representing layered monads. In
*Proceedings of the 26th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages*, pages 175–188, San Antonio, Texas, January 1999.Google Scholar - [Fil99b]Andrzej Filinski. A semantic account of type-directed partial evaluation. In G. Nadathur, editor,
*International Conference on Principles and Practice of Declarative Programming*, number 1702 in Lecture Notes in Computer Science, pages 378–395, Paris, France, September 1999.CrossRefGoogle Scholar - [Fil01]Andrzej Filinski. Normalization by evaluation for the computational lambda-calculus. In S. Abramsky, editor,
*Typed Lambda Calculi and Applications*, number 2044 in Lecture Notes in Computer Science, pages 151–165, Krakow, Poland, May 2001.CrossRefGoogle Scholar - [Fut71]Yoshihiko Futamura. Partial evaluation of computation process-an approach to a compiler-compiler.
*Systems, Computers, Controls*, 2(5):721–728, 1971. Reprinted in*Higher-Order and Symbolic Computation*, 12(4):381-391, 1999.Google Scholar - [Fut99]Yoshihiko Futamura. Partial evaluation of computation process, revisited.
*Higher-Order and Symbolic Computation*, 12(4):377–380, 1999.CrossRefGoogle Scholar - [Gom91]Carsten K. Gomard. A self-applicable partial evaluator for the lambda calculus: Correctness and pragmatics.
*ACM Transactions on Programming Languages and Systems*, 12(4):147–172, April 1991.Google Scholar - [GP99]Murdoch Gabbay and Andrew Pitts. A new approach to abstract syntax involving binders. In
*Proceedings of the 14th Annual IEEE Symposium on Logic in Computer Science*, pages 214–224, Trento, Italy, July 1999.Google Scholar - [GY01]Bernd Grobauer and Zhe Yang. The second Futamura projection for type-directed partial evaluation.
*Higher-Order and Symbolic Computation*, 14(2/3):173–219, 2001.zbMATHCrossRefGoogle Scholar - [JGS93]Neil D. Jones, Carsten K. Gomard, and Peter Sestoft.
*Partial Evaluation and Automatic Program Generation*. Prentice Hall International Series in Computer Science. Prentice-Hall, 1993. Available electronically at http://www.dina.dk/~sestoft/pebook/. - [Laf88]Yves Lafont.
*Logiques, Catégories et Machines*. PhD thesis, Université de Paris VII, Paris, France, January 1988.Google Scholar - [Mit96]John C. Mitchell.
*Foundations for Programming Languages*. The MIT Press, 1996.Google Scholar - [ML75a]Per Martin-Löf. About models for intuitionistic type theories and the notion of definitional equality. In S. Kanger, editor,
*Proceedings of the 3rd Scandinavian Logic Symposium*, pages 81–109, 1975.Google Scholar - [ML75b]Per Martin-Löf. An intuitionistic theory of types: Predicative part. In H. E. Rose and J. C. Shepherdson, editors,
*Logic Colloquium’ 73*, pages 73–118. North-Holland, 1975.Google Scholar - [MN93]Lena Magnusson and Bengt Nordström. The ALF proof editor and its proof engine. In H. Barendregt and T. Nipkow, editors,
*Types for Proofs and Programs, International Workshop TYPES’93*, number 806 in Lecture Notes in Computer Science, pages 213–237, Nijmegen, The Netherlands, May 1993.Google Scholar - [Mog89]Eugenio Moggi. Computational lambda-calculus and monads. In
*Proceedings of the Fourth Annual Symposium on Logic in Computer Science*, pages 14–23, Pacific Grove, California, June 1989. IEEE.Google Scholar - [Mog92]Torben Æ. Mogensen. Efficient self-interpretation in lambda calculus.
*Journal of Functional Programming*, 2(3):345–364, July 1992.Google Scholar - [NN88]Flemming Nielson and Hanne Riis Nielson. Two-level semantics and code generation.
*Theoretical Computer Science*, 56(1):59–133, January 1988.Google Scholar - [Oho99]Atsushi Ohori. A Curry-Howard isomorphism for compilation and program execution. In J.-Y. Girard, editor,
*Typed Lambda Calculi and Applications*, number 1581 in Lecture Notes in Computer Science, pages 280–294, L’Aquila, Italy, April 1999.CrossRefGoogle Scholar - [Pau00]Lawrence C. Paulson. Foundations of functional programming. Notes from a course given at the Computer Laboratory of Cambridge University, available from http://www.cl.cam.ac.uk/users/lcp/papers/#Courses, 2000.
- [Plo75]Gordon D. Plotkin. Call-by-name, call-by-value and the λ-calculus.
*Theoretical Computer Science*, 1(2):125–159, December 1975.Google Scholar - [Plo77]Gordon D. Plotkin. LCF considered as a programming language.
*Theoretical Computer Science*, 5(3):223–255, December 1977.Google Scholar - [Rey72]John C. Reynolds. Definitional interpreters for higher-order programming languages. In
*Proceedings of 25th ACM National Conference*, pages 717–740, Boston, Massachusetts, August 1972. Reprinted in*Higher-Order and Symbolic Computation*, 11(4):363–397, 1998.Google Scholar - [Ruf93]Erik Ruf.
*Topics in Online Partial Evaluation*. PhD thesis, Stanford University, Stanford, California, February 1993. Technical report CSL-TR-93-563.Google Scholar - [SK01]Eijiro Sumii and Naoki Kobayashi. A hybrid approach to online and offline partial evaluation.
*Higher-Order and Symbolic Computation*, 14(2/3):101–142, 2001.zbMATHCrossRefGoogle Scholar - [SW74]Christopher Strachey and Christopher P. Wadsworth. Continuations: A mathematical semantics for handling full jumps. Technical Monograph PRG-11, Oxford University Computing Laboratory, Programming Research Group, Oxford, England, 1974. Reprinted in
*Higher-Order and Symbolic Computation*, 13(1/2):135–152, April 2000.Google Scholar - [Win93]Glynn Winskel.
*The Formal Semantics of Programming Languages: An Introduction*. The MIT Press, 1993.Google Scholar - [Yan98]Zhe Yang. Encoding types in ML-like languages. In
*ACM SIGPLAN International Conference on Functional Programming*, pages 289–300, Baltimore, Maryland, September 1998. Extended version to appear in TCS.Google Scholar

## Copyright information

© Springer-Verlag Berlin Heidelberg 2002