Abstract
According to conventional wisdom, a self-interpreter for a strongly normalizing lambda-calculus is impossible. We call this the normalization barrier. The normalization barrier stems from a theorem in computability theory that says that a total universal function for the total computable functions is impossible. In this paper we break through the normalization barrier and define a self-interpreter for System F_omega, a strongly normalizing lambda-calculus. After a careful analysis of the classical theorem, we show that static type checking in F_omega can exclude the proof's diagonalization gadget, leaving open the possibility for a self-interpreter. Along with the self-interpreter, we program four other operations in F_omega, including a continuation-passing style transformation. Our operations rely on a new approach to program representation that may be useful in theorem provers and compilers.
- H. Abelson and G.J. Sussman. Structure and Interpretation of Computer Programs. MIT electrical engineering and computer science series. MIT Press, 1987. Google Scholar
Digital Library
- Thorsten Altenkirch and Ambrus Kaposi. Type theory in type theory using quotient inductive types. In Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’16. ACM, 2016. Google Scholar
Digital Library
- Henk Barendregt. Self-interpretations in lambda calculus. J. Funct. Program, 1(2):229–233, 1991.Google Scholar
Cross Ref
- HP Barendregt. Handbook of Logic in Computer Science (vol. 2): Background: Computational Structures: Abramski, S. (ed), chapter Lambda Calculi with Types. Oxford University Press, Inc., New York, NY, 1993. Google Scholar
Digital Library
- Bruno Barras and Benjamin Werner. Coq in coq. Technical report, 1997.Google Scholar
- Alessandro Berarducci and Corrado Böhm. A self-interpreter of lambda calculus having a normal form. In CSL, pages 85–99, 1992. Google Scholar
Digital Library
- Matt Brown and Jens Palsberg. Self-Representation in Girard’s System U. In Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’15, pages 471– 484, New York, NY, USA, 2015. ACM. Google Scholar
Digital Library
- Jacques Carette, Oleg Kiselyov, and Chung-chieh Shan. Finally tagless, partially evaluated: Tagless staged interpreters for simpler typed languages. Journal of Functional Programming, 19(5):509–543, 2009. Google Scholar
Digital Library
- James Chapman. Type theory should eat itself. Electronic Notes in Theoretical Computer Science, 228:21–36, 2009. Google Scholar
Digital Library
- Chiyan Chen and Hongwei Xi. Meta-Programming through Typeful Code Representation. In Proceedings of the Eighth ACM SIGPLAN International Conference on Functional Programming, pages 275–286, Uppsala, Sweden, August 2003. Google Scholar
Digital Library
- Chiyan Chen and Hongwei Xi. Meta-Programming through Typeful Code Representation. Journal of Functional Programming, 15(6):797– 835, 2005. Google Scholar
Digital Library
- A. Chlipala. Certified Programming with Dependent Types: A Pragmatic Introduction to the Coq Proof Assistant. MIT Press, 2013. Google Scholar
Digital Library
- Adam Chlipala. Parametric higher-order abstract syntax for mechanized semantics. In Proceedings of the 13th ACM SIGPLAN International Conference on Functional Programming, ICFP ’08, pages 143– 156, New York, NY, USA, 2008. ACM. Google Scholar
Digital Library
- Julien Cretin and Didier Rémy. On the power of coercion abstraction. In Proceedings of the 39th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’12, pages 361–372, New York, NY, USA, 2012. ACM. Google Scholar
Digital Library
- Jeremy Gibbons and Nicolas Wu. Folding domain-specific languages: Deep and shallow embeddings (functional pearl). In Proceedings of the 19th ACM SIGPLAN International Conference on Functional Programming, ICFP ’14, pages 339–347, New York, NY, USA, 2014. ACM. Google Scholar
Digital Library
- Robert Harper and Daniel R. Licata. Mechanizing metatheory in a logical framework. J. Funct. Program., 17(4-5):613–673, July 2007. Google Scholar
Digital Library
- Barry Jay and Jens Palsberg. Typed self-interpretation by pattern matching. In Proceedings of ICFP’11, ACM SIGPLAN International Conference on Functional Programming, pages 247–258, Tokyo, September 2011. Google Scholar
Digital Library
- Oleg Kiselyov. Metatypechecking: Staged typed compilation into gadt using typeclasses. http://okmij.org/ftp/tagless-final/taglesstyped.html#tc-GADT-tc.Google Scholar
- Stephen C. Kleene. λ-definability and recursiveness. Duke Math. J., pages 340–353, 1936.Google Scholar
Cross Ref
- John McCarthy. Recursive functions of symbolic expressions and their computation by machine, part i. Commun. ACM, 3(4):184–195, April 1960. Google Scholar
Digital Library
- John C. Mitchell. Polymorphic type inference and containment. Inf. Comput., 76(2-3):211–249, February 1988. Google Scholar
Digital Library
- Torben Æ. Mogensen. Efficient self-interpretations in lambda calculus. Journal of Functional Programming, 2(3):345–363, 1992.Google Scholar
Cross Ref
- See also DIKU Report D–128, Sep 2, 1994.Google Scholar
- Greg Morrisett. F-omega – the workhorse of modern compilers. http://www.eecs.harvard.edu/ greg/cs256sp2005/lec16.txt, 2005.Google Scholar
- Matthew Naylor. Evaluating Haskell in Haskell. The Monad.Reader, 10:25–33, 2008.Google Scholar
- Frank Pfenning and Peter Lee. Metacircularity in the polymorphic λcalculus. Theoretical Computer Science, 89(1):137–159, 1991. Google Scholar
Digital Library
- Benjamin C. Pierce. Types and Programming Languages. MIT Press, 2002. Google Scholar
Digital Library
- Benjamin C. Pierce. Types and Programming Languages. MIT Press, Cambridge, MA, USA, 2002. Google Scholar
Digital Library
- Tillmann Rendel, Klaus Ostermann, and Christian Hofer. Typed selfrepresentation. In Proceedings of PLDI’09, ACM SIGPLAN Conference on Programming Language Design and Implementation, pages 293– 303, June 2009. Google Scholar
Digital Library
- John C. Reynolds. Definitional interpreters for higher-order programming languages. In Proceedings of 25th ACM National Conference, pages 717–740. ACM Press, 1972. The paper later appeared in Higher-Order and Symbolic Computation, 11, 363–397 (1998). Google Scholar
Digital Library
- Carsten Schürmann, Dachuan Yu, and Zhaozhong Ni. A representation of f ω in lf. Electronic Notes in Theoretical Computer Science, 58(1):79 – 96, 2001.Google Scholar
Cross Ref
- Tim Sheard and Simon Peyton Jones. Template meta-programming for haskell. SIGPLAN Not., 37(12):60–75, December 2002. Google Scholar
Digital Library
- T. Stuart. Understanding Computation: Impossible Code and the Meaning of Programs. Understanding Computation. O’Reilly Media, Incorporated, 2013.Google Scholar
- Aaron Stump. Directly reflective meta-programming. Higher Order Symbol. Comput., 22(2):115–144, June 2009. Google Scholar
Digital Library
- Walid Taha and Tim Sheard. Metaml and multi-stage programming with explicit annotations. In Theoretical Computer Science, pages 203–217. ACM Press, 1999. Google Scholar
Digital Library
- Valery Trifonov, Bratin Saha, and Zhong Shao. Fully reflexive intensional type analysis. SIGPLAN Not., 35(9):82–93, September 2000. Google Scholar
Digital Library
- David Turner. Total functional programming. Journal of Universal Computer Science, 10, 2004.Google Scholar
- Philip Wadler. Theorems for free! In Functional Programming Languages and Computer Architecture, pages 347–359. ACM Press, 1989. Google Scholar
Digital Library
- Geoffrey Washburn and Stephanie Weirich. Boxes go bananas: Encoding higher-order abstract syntax with parametric polymorphism. In Proceedings of the Eighth ACM SIGPLAN International Conference on Functional Programming, ICFP ’03, pages 249–262, New York, NY, USA, 2003. ACM. Google Scholar
Digital Library
Index Terms
Breaking through the normalization barrier: a self-interpreter for f-omega
Recommendations
Breaking through the normalization barrier: a self-interpreter for f-omega
POPL '16: Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming LanguagesAccording to conventional wisdom, a self-interpreter for a strongly normalizing lambda-calculus is impossible. We call this the normalization barrier. The normalization barrier stems from a theorem in computability theory that says that a total ...
Typed self-evaluation via intensional type functions
POPL '17: Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming LanguagesMany popular languages have a self-interpreter, that is, an interpreter for the language written in itself. So far, work on polymorphically-typed self-interpreters has concentrated on self-recognizers that merely recover a program from its ...
Typed self-evaluation via intensional type functions
POPL '17Many popular languages have a self-interpreter, that is, an interpreter for the language written in itself. So far, work on polymorphically-typed self-interpreters has concentrated on self-recognizers that merely recover a program from its ...






Comments