skip to main content
research-article

The exp-log normal form of types: decomposing extensional equality and representing terms compactly

Published:01 January 2017Publication History
Skip Abstract Section

Abstract

Lambda calculi with algebraic data types lie at the core of functional programming languages and proof assistants, but conceal at least two fundamental theoretical problems already in the presence of the simplest non-trivial data type, the sum type. First, we do not know of an explicit and implemented algorithm for deciding the beta-eta-equality of terms---and this in spite of the first decidability results proven two decades ago. Second, it is not clear how to decide when two types are essentially the same, i.e. isomorphic, in spite of the meta-theoretic results on decidability of the isomorphism.

In this paper, we present the exp-log normal form of types---derived from the representation of exponential polynomials via the unary exponential and logarithmic functions---that any type built from arrows, products, and sums, can be isomorphically mapped to. The type normal form can be used as a simple heuristic for deciding type isomorphism, thanks to the fact that it is a systematic application of the high-school identities.

We then show that the type normal form allows to reduce the standard beta-eta equational theory of the lambda calculus to a specialized version of itself, while preserving completeness of the equality on terms.

We end by describing an alternative representation of normal terms of the lambda calculus with sums, together with a Coq-implemented converter into/from our new term calculus. The difference with the only other previously implemented heuristic for deciding interesting instances of eta-equality by Balat, Di Cosmo, and Fiore, is that we exploits the type information of terms substantially and this often allows us to obtain a canonical representation of terms without performing a sophisticated term analyses.

References

  1. A. Ahmad, D. Licata, and R. Harper. Deciding coproduct equality with focusing. Manuscript, 2010.Google ScholarGoogle Scholar
  2. T. Altenkirch, P. Dybjer, M. Hofmann, and P. Scott. Normalization by evaluation for typed lambda calculus with coproducts. In Logic in Computer Science, 2001. Proceedings. 16th Annual IEEE Symposium on, pages 303–310, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. V. Balat. Keeping sums under control. In Workshop on Normalization by Evaluation, pages 11–20, Los Angeles, United States, Aug. 2009.Google ScholarGoogle Scholar
  4. V. Balat, R. Di Cosmo, and M. Fiore. Extensional normalisation and type-directed partial evaluation for typed lambda calculus with sums. In Proceedings of the 31st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’04, pages 64–76, New York, NY, USA, 2004. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. T. Brock-Nannestad and D. Ilik. An intuitionistic formula hierarchy based on high-school identities. arXiv:1601.04876, 2016.Google ScholarGoogle Scholar
  6. S. N. Burris and K. A. Yeats. The saga of the high school identities. Algebra Universalis, 52:325–342, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  7. R. Di Cosmo and D. Kesner. A confluent reduction for the extensional typed λ-calculus with pairs, sums, recursion and terminal object. In A. Lingas, R. Karlsson, and S. Carlsson, editors, Automata, Languages and Programming, volume 700 of Lecture Notes in Computer Science, pages 645–656. Springer Berlin Heidelberg, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. A. D´ıaz-Caro and G. Dowek. Simply typed lambda-calculus modulo type isomorphisms. Draft at https://hal.inria.fr/hal-01109104, 2015.Google ScholarGoogle Scholar
  9. A. D´ıaz-Caro and P. E. Mart´ınez L´opez. Isomorphisms considered as equalities: Projecting functions and enhancing partial application through an implementation of λ +. In IFL 2015: Symposium on the implementation and application of functional programming languages. ACM, 2016. To appear. Preprint at arXiv:1511.09324. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. D. Dougherty. Some lambda calculi with categorical sums and products. In Rewriting Techniques and Applications, pages 137–151. Springer, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. D. J. Dougherty and R. Subrahmanyam. Equality between functionals in the presence of coproducts. In Proceedings of the 10th Annual IEEE Symposium on Logic in Computer Science, LICS ’95, pages 282–, Washington, DC, USA, 1995. IEEE Computer Society. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. M. Fiore, R. D. Cosmo, and V. Balat. Remarks on isomorphisms in typed lambda calculi with empty and sum types. Annals of Pure and Applied Logic, 141:35–50, 2006.Google ScholarGoogle ScholarCross RefCross Ref
  13. H. Friedman. Equality between functionals. In Logic Colloquium ’73, volume 453 of Lecture Notes in Mathematics, pages 22–37. Springer, 1975.Google ScholarGoogle Scholar
  14. N. Ghani. βη-equality for coproducts. In Typed Lambda Calculi and Applications, pages 171–185. Springer, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. G. H. Hardy. Orders of Infinity. The ‘Infinitärcalcül’ of Paul Du Bois-Reymond. Cambridge Tracts in Mathematic and Mathematical Physics. Cambridge University Press, 1910.Google ScholarGoogle Scholar
  16. D. Ilik. Axioms and decidability for type isomorphism in the presence of sums. In Proceedings of the Joint Meeting of the Twenty-Third EACSL Annual Conference on Computer Science Logic (CSL) and the Twenty-Ninth Annual ACM/IEEE Symposium on Logic in Computer Science (LICS), CSL-LICS ’14, pages 53:1–53:7, New York, NY, USA, 2014. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. C. Liang and D. Miller. Focusing and polarization in intuitionistic logic. In J. Duparc and T. A. Henzinger, editors, Computer Science Logic, volume 4646 of Lecture Notes in Computer Science, pages 451–465. Springer Berlin Heidelberg, 2007. ISBN 978-3-540-74914-1. S. Lindley. Extensional rewriting with sums. In S. R. Della Rocca, editor, Typed Lambda Calculi and Applications, volume 4583 of Lecture Notes in Computer Science, pages 255–271. Springer Berlin Heidelberg, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. M. Rittri. Using types as search keys in function libraries. J. Funct. Program., 1(1):71–89, 1991.Google ScholarGoogle ScholarCross RefCross Ref
  19. G. Scherer. Multi-Focusing on Extensional Rewriting with Sums. In T. Altenkirch, editor, 13th International Conference on Typed Lambda Calculi and Applications (TLCA 2015), volume 38 of Leibniz International Proceedings in Informatics (LIPIcs), pages 317–331, Dagstuhl, Germany, 2015. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik. ISBN 978-3- 939897-87-3. Introduction The exp-log Normal Form of Types -Congruence Classes at ENF Type A Compact Representation of Terms at ENF Type A Converter for the Compact Term Representation ConclusionGoogle ScholarGoogle Scholar

Index Terms

  1. The exp-log normal form of types: decomposing extensional equality and representing terms compactly

          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

          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!