ABSTRACT
We investigate CPS translatability of typed λ-calculi with inductive and coinductive types. We show that tenable Plotkin-style call-by-name CPS translations exist for simply typed λ-calculi with a natural number type and stream types and, more generally, with arbitrary positive inductive and coinductive types. These translations also work in the presence of control operators and generalize for dependently typed calculi where case-like eliminations are only allowed in non-dependent forms. No translation is possible along the same lines for small Σ-types and sum types with dependent case.
- 1.S. Abramsky, ed. Proc. of 5th Int. Conf. on Typed Lambda Calculi and Appl., TLCA'01, vol. 2044 of Lect. Notes in Comp. Sci.. Springer-Verlag, 2001.]]Google ScholarCross Ref
- 2.T. Altenkirch. Representations of first order function types as terminal coalgebras. In {1}, pp. 8-21.]]Google Scholar
- 3.A. Appel. Compiling with Continuations. Cambridge University Press, 1992.]] Google ScholarDigital Library
- 4.F. Barbanera and S. Berardi. A symmetric lambda calculus for classical program extraction. Information and Computation, 125(2):103-117, 1996.]] Google ScholarDigital Library
- 5.H. Barendregt. Lambda calculi with types. In S. Abramsky, D. M. Gabbay, and T. S. E. Maibaums, eds., Handbook of Logic in Computer Science, Vol. 2: Background: Computational Structures, pp. 117-309. Clarendon Press, 1992.]] Google ScholarDigital Library
- 6.G. Barthe, J. Hatcliff, and M. H. S~rensen. A notion of classical pure type system (preliminary version). In S. Brookes and M. Mislove, eds., Proc. of 13th Ann. Conf. on Math. Found. of Programming Semantics, MFPS'97, vol. 6 of Elect. Notes in Theor. Comp. Sci.. Elsevier, 1997.]]Google Scholar
- 7.G. Barthe, J. Hatcliff, and M. H. S~rensen. Re ections on reflections. In H. Glaser, P. Hartel, and H. Kuchen, eds., Proc. of 9th Int. Symp. on Programming Languages: Implementations, Logics, and Programs, PLILP'97, vol. 1292 of Lect. Notes in Comp. Sci., pp. 241-258. Springer-Verlag, 1997.]] Google ScholarDigital Library
- 8.G. Barthe, J. Hatcliff, and M. H. S~ensen. CPS-translations and applications: the cube and beyond. Higher-Order and Symbolic Computation, 12(2):125-170, 1999.]] Google ScholarDigital Library
- 9.G. Barthe and M. H. S~rensen. Domain-free pure type systems. J. of Funct. Prog., 10(5):417-452, 2000.]] Google ScholarDigital Library
- 10.S. Berardi, M. Bezem, and T. Coquand. A realization of the negative interpretation of the axiom of choice. In {16}, pp. 47-62.]] Google ScholarDigital Library
- 11.U. Berger. A constructive interpretation of positive inductive definitions. Unpublished draft, 1995.]]Google Scholar
- 12.U. Berger and H. Schwichtenberg. Program extraction from classical proofs. In D. Leivant, ed., Selected Papers from Int. Workshop on Logical and Computational Complexity, LCC'94, vol. 960 of Lect. Notes in Comp. Sci., pp. 77-97. Springer-Verlag, 1995.]] Google ScholarDigital Library
- 13.R. Constable and C. R. Murthy. Finding computational content in classical proofs. In G. Huet and G. Plotkin, eds., Logical Frameworks, pp. 341-362. Cambridge University Press, 1990.]] Google ScholarDigital Library
- 14.T. Coquand. Metamathematical investigations of a calculus of constructions. In {37}, pp. 91-122.]]Google Scholar
- 15.T. Coquand and C. Paulin. Inductively defined types (preliminary version). In P. Martin-Lof and G. Mints, eds., Proc. of Int. Conf. on Computer Logic, COLOG'88, vol. 417 of Lect. Notes in Comp. Sci., pp. 50-66. Springer-Verlag, 1990.]] Google ScholarDigital Library
- 16.M. Dezani-Ciancaglini and G. Plotkin, eds. Proc. of 2nd Int. Conf. on Typed Lambda Calculi and Appl., TLCA'95, vol. 902 of Lect. Notes in Comp. Sci.. Springer-Verlag, 1995.]] Google ScholarDigital Library
- 17.M. Felleisen, D. P. Friedman, E. Kohlbecker, and B. Duba. Theor. Comp. Sci., 52(3):205-237, 1987.]] Google ScholarDigital Library
- 18.M. Felleisen and A. Sabry. Continuations in programming practice: Introduction and survey. Manuscript, 1999.]]Google Scholar
- 19.FLINT project. http://flint.cs.yale.edu]]Google Scholar
- 20.H. Geuvers. Inductive and coinductive types with iteration and recursion. In B. Nordstrom, K. Pettersson and G. Plotkin, eds., Proc. of Workshop on Types for Proofs and Programs, TYPES'92, pp. 193-217. Dept. of Comp. Sci., Chalmers Univ. of Techn. and Goteborg Univ, 1992.]]Google Scholar
- 21.H. Geuvers. Inconsistency of classical logic in type theory. Unpublished note, 2001.]]Google Scholar
- 22.H. Geuvers. Induction is not derivable in second order dependent type theory. In {1}, pp. 166-181.]]Google Scholar
- 23.T. G. Griffin. The formulae-as-types notion of control. In Conf. Record of 17th Annual ACM Symp. on Principles of Programming Languages, POPL'90, pp. 47-57. ACM Press, 1990.]] Google ScholarDigital Library
- 24.P. de Groote. A CPS-Translation of the -Calculus. In S. Tison, ed., Proc. of 19th Int. Coll. on Trees in Algebra and Programming, CAAP'94, vol. 787 of Lect. Notes in Comp. Sci., pp. 85-99. Springer-Verlag, 1994.]] Google ScholarDigital Library
- 25.P. de Groote. A simple calculus of exception handling.]]Google Scholar
- 26.P. de Groote. On the strong normalization of natural deduction with permutation- conversions. In P. Narendran and M. Rusinowitch, eds., Proc. of 10th Int. Conf. on Rewriting Techniques and Appl., RTA'99, vol. 1631 of Lect. Notes in Comp. Sci., pp. 45-59. Springer-Verlag, 1999.]] Google ScholarDigital Library
- 27.R. Harper and M. Lillibridge. Polymorphic type assignment and CPS conversion. LISP and Symbolic Computation, 6(4):361-380, 1993.]] Google ScholarDigital Library
- 28.R. Harper and M. Lillibridge. Explicit polymorphism and CPS conversion. In Conf. Record of 20th ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages, POPL'93, pp. 206-219. ACM Press, 1993.]] Google ScholarDigital Library
- 29.D. Leivant. Contracting proofs to programs. In {37}, pp. 279-327.]]Google Scholar
- 30.R. Matthes. Extensions of System F by Iteration and Primitive Recursion on Monotone Inductive Types. PhD thesis, Ludwig-Maximilians-Universitat Munchen, 1998.]]Google Scholar
- 31.N. P. Mendler. Inductive types and type constraints in the second-order lambda-calculus. Ann. of Pure and Appl. Logic, 51(1-2):159-172, 1991.]]Google ScholarCross Ref
- 32.A. R. Meyer and M. Wand. Continuation semantics in typed lambda-calculi (summary). In R. Parikh, ed., Proc. of 3rd Workshop on Logics of Programs, vol. 193 of Lect. Notes in Comp. Sci., pp. 219-224. Springer-Verlag, 1985.]] Google ScholarDigital Library
- 33.C. R. Murthy. An evaluation semantics for classical proofs. In Proc. of 6th Ann. IEEE Symp. on Logic in Computer Science, LICS'91, pp. 96-107. IEEE CS Press, 1991.]]Google ScholarCross Ref
- 34.H. Nakano. A constructive logic behind the catch and throw mechanism. Ann. of Pure and Appl. Logic, 69(2-3):269-301, 1994.]]Google ScholarCross Ref
- 35.C.-H. L. Ong. A semantic view of classical proofs: type-theoretic, categorical, and denotational characterizations (preliminary extended abstract). In Proc. of 11th Ann. IEEE Symp. on Logic in Computer Science, LICS'96, pp. 230-241. IEEE CS Press, 1996.]] Google ScholarDigital Library
- 36.C.-H. L. Ong and C. A. Stewart. A Curry-Howard foundation for functional computation with control. In Conf. Record of 24th ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages, POPL'97, pp. 215-227, ACM Press, 1997.]] Google ScholarDigital Library
- 37.P. Odifreddi, ed. Logic and Computer Science, vol. 31 of APIC Studies in Data Processing. Academic Press, 1990.]]Google Scholar
- 38.M. Parigot. -calculus: An algorithmic interpretation of classical natural deduction. In A. Voronkov, ed., Proc. of Int. Conf. on Logic Programming and Automated Reasoning, LPAR'92, vol. 624 of Lect. Notes in Comp. Sci., pp. 190-201. Springer-Verlag, 1992.]] Google ScholarDigital Library
- 39.M. Parigot. Classical proofs as programs. In G. Gottlob, A. Leitsch, and D. Mundici, eds., Proc. of 3rd Kurt Godel Colloquium, KGC'93, vol. 713 of Lecture Notes in Computer Science, pp. 263-276. Springer-Verlag, 1993.]] Google ScholarDigital Library
- 40.C. Paulin-Mohring. Inductive definitions in the system Coq: Rules and properties. In M. Bezem and J. F. Groote, eds., Proc. of 1st Int. Conf. on Typed Lambda Calculi and Appl., TLCA'93, vol. 664 of Lect. Notes in Computer Science, pp. 328-345. Springer-Verlag, 1993.]] Google ScholarDigital Library
- 41.G. Plotkin. Call-by-name, call-by-value and the -calculus. Theor. Comp. Sci., 1(2):125-159, 1975.]]Google ScholarCross Ref
- 42.N. J. Rehof and M. H. S~rensen. The calculus. In M. Hagiya and J. Mitchell, eds., Proc. of 2nd Int. Symp. on Theor. Aspects of Comp. Sci., TACS'94, vol. 789 of Lect. Notes in Comp. Sci., pp. 516-542. Springer-Verlag, 1994.]] Google ScholarDigital Library
- 43.Z. Shao, B. Saha, V. Trifonov, and N. Papaspyrou. A type system for certified binaries. To appear in Conf. Record of 29th Ann. ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages, POPL'02. ACM Press, 2002.]] Google ScholarDigital Library
- 44.TAL project. http://www.cs.cornell.edu/talc]]Google Scholar
- 45.T. Uustalu and V. Vene. Least and greatest fixedpoints in intuitionistic natural deduction. Theor. Comp. Sci., to appear.]] Google ScholarDigital Library
- 46.B. Werner. Meta-theorie du Calcul des Constructions Inductives. PhD thesis, Universite Paris 7, 1994.]]Google Scholar
- 47.H. Xi and C. Schurmann. CPS transform and type derivations for Dependent ML. In Proc. of 8th Workshop on Logic, Language, Information and Computation, WoLLIC'01, 2001.]]Google Scholar
Index Terms
- CPS translating inductive and coinductive types
Recommendations
Type-preserving CPS translation of Σ and Π types is not not possible
Dependently typed languages such as Coq are used to specify and prove functional correctness of source programs, but what we ultimately need are guarantees about correctness of compiled code. By preserving dependent types through each compiler pass, we ...
CPS translating inductive and coinductive types
We investigate CPS translatability of typed λ-calculi with inductive and coinductive types. We show that tenable Plotkin-style call-by-name CPS translations exist for simply typed λ-calculi with a natural number type and stream types and, more generally,...
Type Theory based on Dependent Inductive and Coinductive Types
LICS '16: Proceedings of the 31st Annual ACM/IEEE Symposium on Logic in Computer ScienceWe develop a dependent type theory that is based purely on inductive and coinductive types, and the corresponding recursion and corecursion principles. This results in a type theory with a small set of rules, while still being fairly expressive. For ...
Comments