skip to main content
article

Breaking through the normalization barrier: a self-interpreter for f-omega

Published:11 January 2016Publication History
Skip Abstract Section

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.

References

  1. H. Abelson and G.J. Sussman. Structure and Interpretation of Computer Programs. MIT electrical engineering and computer science series. MIT Press, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  3. Henk Barendregt. Self-interpretations in lambda calculus. J. Funct. Program, 1(2):229–233, 1991.Google ScholarGoogle ScholarCross RefCross Ref
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. Bruno Barras and Benjamin Werner. Coq in coq. Technical report, 1997.Google ScholarGoogle Scholar
  6. Alessandro Berarducci and Corrado Böhm. A self-interpreter of lambda calculus having a normal form. In CSL, pages 85–99, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  9. James Chapman. Type theory should eat itself. Electronic Notes in Theoretical Computer Science, 228:21–36, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. Chiyan Chen and Hongwei Xi. Meta-Programming through Typeful Code Representation. Journal of Functional Programming, 15(6):797– 835, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. A. Chlipala. Certified Programming with Dependent Types: A Pragmatic Introduction to the Coq Proof Assistant. MIT Press, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  16. Robert Harper and Daniel R. Licata. Mechanizing metatheory in a logical framework. J. Funct. Program., 17(4-5):613–673, July 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  18. Oleg Kiselyov. Metatypechecking: Staged typed compilation into gadt using typeclasses. http://okmij.org/ftp/tagless-final/taglesstyped.html#tc-GADT-tc.Google ScholarGoogle Scholar
  19. Stephen C. Kleene. λ-definability and recursiveness. Duke Math. J., pages 340–353, 1936.Google ScholarGoogle ScholarCross RefCross Ref
  20. John McCarthy. Recursive functions of symbolic expressions and their computation by machine, part i. Commun. ACM, 3(4):184–195, April 1960. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. John C. Mitchell. Polymorphic type inference and containment. Inf. Comput., 76(2-3):211–249, February 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Torben Æ. Mogensen. Efficient self-interpretations in lambda calculus. Journal of Functional Programming, 2(3):345–363, 1992.Google ScholarGoogle ScholarCross RefCross Ref
  23. See also DIKU Report D–128, Sep 2, 1994.Google ScholarGoogle Scholar
  24. Greg Morrisett. F-omega – the workhorse of modern compilers. http://www.eecs.harvard.edu/ greg/cs256sp2005/lec16.txt, 2005.Google ScholarGoogle Scholar
  25. Matthew Naylor. Evaluating Haskell in Haskell. The Monad.Reader, 10:25–33, 2008.Google ScholarGoogle Scholar
  26. Frank Pfenning and Peter Lee. Metacircularity in the polymorphic λcalculus. Theoretical Computer Science, 89(1):137–159, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Benjamin C. Pierce. Types and Programming Languages. MIT Press, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Benjamin C. Pierce. Types and Programming Languages. MIT Press, Cambridge, MA, USA, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  30. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  31. 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 ScholarGoogle ScholarCross RefCross Ref
  32. Tim Sheard and Simon Peyton Jones. Template meta-programming for haskell. SIGPLAN Not., 37(12):60–75, December 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. T. Stuart. Understanding Computation: Impossible Code and the Meaning of Programs. Understanding Computation. O’Reilly Media, Incorporated, 2013.Google ScholarGoogle Scholar
  34. Aaron Stump. Directly reflective meta-programming. Higher Order Symbol. Comput., 22(2):115–144, June 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Walid Taha and Tim Sheard. Metaml and multi-stage programming with explicit annotations. In Theoretical Computer Science, pages 203–217. ACM Press, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Valery Trifonov, Bratin Saha, and Zhong Shao. Fully reflexive intensional type analysis. SIGPLAN Not., 35(9):82–93, September 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. David Turner. Total functional programming. Journal of Universal Computer Science, 10, 2004.Google ScholarGoogle Scholar
  38. Philip Wadler. Theorems for free! In Functional Programming Languages and Computer Architecture, pages 347–359. ACM Press, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Breaking through the normalization barrier: a self-interpreter for f-omega

              Recommendations

              Comments

              Login options

              Check if you have access through your login credentials or your institution to get full access on this article.

              Sign in

              Full Access

              • Published in

                cover image ACM SIGPLAN Notices
                ACM SIGPLAN Notices  Volume 51, Issue 1
                POPL '16
                January 2016
                815 pages
                ISSN:0362-1340
                EISSN:1558-1160
                DOI:10.1145/2914770
                • Editor:
                • Andy Gill
                Issue’s Table of Contents
                • cover image ACM Conferences
                  POPL '16: Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages
                  January 2016
                  815 pages
                  ISBN:9781450335492
                  DOI:10.1145/2837614

                Copyright © 2016 ACM

                Publisher

                Association for Computing Machinery

                New York, NY, United States

                Publication History

                • Published: 11 January 2016

                Check for updates

                Qualifiers

                • article

              PDF Format

              View or Download as a PDF file.

              PDF

              eReader

              View online with eReader.

              eReader
              About Cookies On This Site

              We use cookies to ensure that we give you the best experience on our website.

              Learn more

              Got it!