Keeping sums under control

In a recent paper [31], I presented with Marcelo Fiore and Roberto Di Cosmo a new normalisation tool for the -calculus with sum types, based on the technique of normalisation by evaluation, and more precisely on techniques developped by Olivier Danvy for partial evaluation, using control operators. The main characteristic of this tool is that it produces a result in a canonical form we introduced. That is to say: two -equivalent terms will be normalised into (almost) identical terms. It was not the case with the traditional algorithm, which could even lead to an explosion of the size of code. This canonical form is an -long -normal form with constraints, which capture the denition of -long normal form for the -calculus without sums, and reduces drastically the -conversion possibilities for sums. The present paper recall the denition of these normal forms and the normalisation algorithm, and shows how it is possible to use these tools to solve a problem of characterization of type isomorphisms. Indeed, the canonical form allowed to nd the complicated counterexamples we exhibited in another work [6], that proves that type isomorphisms in the -calculus with sums are not nitely axiomatisable. What’s more, when proving that these terms are isomorphisms, the new partial evaluation algorithm avoids an explosion of the size of the term that arises with the old one.

[1]  Roberto Di Cosmo Review of Isomorphisms of Types:: from λ-calculus to information retrieval and language design , 1997 .

[2]  R. Gurevič Equational theory of positive numbers with exponentiation , 1985 .

[3]  Colin Runciman,et al.  Retrieving Reusable Software Components by Polymorphic Type , 1991, J. Funct. Program..

[4]  Vincent Balat,et al.  Une étude des sommes fortes : isomorphismes et formes normales. (A study of strong sums: isomorphisms and normal forms) , 2002 .

[5]  Roberto Di Cosmo,et al.  Type isomorphisms in a type-assignment framework , 1992, POPL '92.

[6]  Roberto Di Cosmo,et al.  Deciding type isomorphisms in a type-assignment framework , 1993, Journal of Functional Programming.

[7]  Alfred Tarski,et al.  An extended arithmetic of ordinal numbers , 1969 .

[8]  Olivier Danvy,et al.  Type-directed partial evaluation , 1995, POPL '96.

[9]  J. Lambek,et al.  Introduction to higher order categorical logic , 1986 .

[10]  G. Rota Introduction to higher order categorical logic , 1988 .

[11]  Didier Rémy,et al.  A generalization of exceptions and control in ML-like languages , 1995, FPCA '95.

[12]  Roberto Di Cosmo,et al.  Isomorphisms of Types , 1995, Progress in Theoretical Computer Science.

[13]  Olivier Danvy,et al.  Memoization in Type-Directed Partial Evaluation , 2002 .

[14]  Mikael Rittri,et al.  Using types as search keys in function libraries , 1989, Journal of Functional Programming.

[15]  Alex Wilkie On Exponentiation - A Solution to Tarski's High School Algebra Problem , 2001 .

[16]  David Delahaye,et al.  Recherche dans une bibliothèque de preuves Coq en utilisant le type et modulo isomorphismes , 1997 .

[17]  Olivier Danvy,et al.  Strong Normalization by Type-Directed Partial Evaluation and Run-Time Code Generation , 1998, Types in Compilation.

[18]  Olivier Danvy,et al.  Abstracting control , 1990, LISP and Functional Programming.

[19]  Ulrich Berger,et al.  An inverse of the evaluation functional for typed lambda -calculus , 1991, [1991] Proceedings Sixth Annual IEEE Symposium on Logic in Computer Science.

[20]  Mikael Rittri,et al.  Retrieving Library Identifiers via Equational Matching of Types , 1990, CADE.

[21]  Colin Runciman,et al.  Retrieving re-usable software components by polymorphic type , 1989, Journal of Functional Programming.

[22]  Marcelo P. Fiore,et al.  Lambda Definability with Sums via Grothendieck Logical Relations , 1999, TLCA.

[23]  Gilles Barthe,et al.  Type Isomorphisms and Proof Reuse in Dependent Type Theory , 2001, FoSSaCS.

[24]  Roberto Di Cosmo,et al.  Extensional normalisation and type-directed partial evaluation for typed lambda calculus with sums , 2004, POPL.

[25]  Olivier Danvy,et al.  Representing Control: a Study of the CPS Transformation , 1992, Mathematical Structures in Computer Science.

[26]  Roberto Di Cosmo,et al.  Type Isomorphisms for Module Signatures , 1996, PLILP.

[27]  Martin Hofmann,et al.  Normalization by evaluation for typed lambda calculus with coproducts , 2001, Proceedings 16th Annual IEEE Symposium on Logic in Computer Science.

[28]  Thorsten Altenkirch,et al.  Normalization by evaluation for λ→2 , 2004 .

[29]  Thorsten Altenkirch,et al.  Normalization by Evaluation for lambda-2 , 2004, FLOPS.

[30]  S. Solov′ev The category of finite sets and Cartesian closed categories , 1983 .

[31]  Carl A. Gunter Return Types for Functional Continuations , 1998 .

[32]  Roberto Di Cosmo,et al.  Provable isomorphisms of types , 1992, Mathematical Structures in Computer Science.

[33]  Roberto Di Cosmo,et al.  Remarks on isomorphisms in typed lambda calculi with empty and sum types , 2002, Proceedings 17th Annual IEEE Symposium on Logic in Computer Science.

[34]  Christopher League Review of Isomorphisms of Types:: from λ-calculus to information retrieval and language design by Roberto Di Cosmo (Birkhauser, 1995) , 1997, SIGA.

[35]  Helmut Schwichtenberg,et al.  Normalisation by Evaluation , 1998, Prospects for Hardware Foundations.

[36]  Marcelo P. Fiore,et al.  Semantic analysis of normalisation by evaluation for typed lambda calculus , 2002, PPDP '02.