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.
- A. Ahmad, D. Licata, and R. Harper. Deciding coproduct equality with focusing. Manuscript, 2010.Google Scholar
- 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 Scholar
Digital Library
- V. Balat. Keeping sums under control. In Workshop on Normalization by Evaluation, pages 11–20, Los Angeles, United States, Aug. 2009.Google Scholar
- 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 Scholar
Digital Library
- T. Brock-Nannestad and D. Ilik. An intuitionistic formula hierarchy based on high-school identities. arXiv:1601.04876, 2016.Google Scholar
- S. N. Burris and K. A. Yeats. The saga of the high school identities. Algebra Universalis, 52:325–342, 2004.Google Scholar
Cross Ref
- 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 Scholar
Digital Library
- A. D´ıaz-Caro and G. Dowek. Simply typed lambda-calculus modulo type isomorphisms. Draft at https://hal.inria.fr/hal-01109104, 2015.Google Scholar
- 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 Scholar
Digital Library
- D. Dougherty. Some lambda calculi with categorical sums and products. In Rewriting Techniques and Applications, pages 137–151. Springer, 1993. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Cross Ref
- H. Friedman. Equality between functionals. In Logic Colloquium ’73, volume 453 of Lecture Notes in Mathematics, pages 22–37. Springer, 1975.Google Scholar
- N. Ghani. βη-equality for coproducts. In Typed Lambda Calculi and Applications, pages 171–185. Springer, 1995. Google Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- M. Rittri. Using types as search keys in function libraries. J. Funct. Program., 1(1):71–89, 1991.Google Scholar
Cross Ref
- 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 Scholar
Index Terms
The exp-log normal form of types: decomposing extensional equality and representing terms compactly
Recommendations
The exp-log normal form of types: decomposing extensional equality and representing terms compactly
POPL '17: Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming LanguagesLambda 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. ...
Extensional normalisation and type-directed partial evaluation for typed lambda calculus with sums
POPL '04We present a notion of η-long β-normal term for the typed lambda calculus with sums and prove, using Grothendieck logical relations, that every term is equivalent to one in normal form. Based on this development we give the first type-directed partial ...
Extensional equivalence and singleton types
We study the λΠΣS≤ calculus, which contains singleton types S(M) classifying terms of base type provably equivalent to the term M. The system includes dependent types for pairs and functions (Σ and Π) and a subtyping relation induced by regarding ...







Comments