skip to main content
10.1145/3331554.3342607acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Inductive types deconstructed: the calculus of united constructions

Published:18 August 2019Publication History

ABSTRACT

Algebraic data types and inductive types like those of the Calculus of Inductive Constructions (CIC) are the bread and butter of statically typed functional programming languages. They conveniently combine in a single package product types, sum types, recursive types, and indexed types. But this also makes them somewhat heavyweight: for example, tuples have to be defined as "degenerate" single constructor inductive types, and extraction of a single field becomes a laborious full case-analysis on the object. We consider this to be unsatisfactory. In this article, we develop an alternative presentation of CIC's inductive types where the various elements are provided separately, such that inductive types are built on top of tuples and sums rather than the other way around. The resulting language is lower-level yet we show it can be translated to to a predicative version of the Calculus of Inductive Constructions in a type-preserving way. An additional benefit is that it can conveniently give a precise type to the default branch of "case" statements.

References

  1. Thorsten Altenkirch, Nils Anders Danielsson, Andres Löh, and Nicolas Oury. 2010. ΠΣ: Dependent Types without the Sugar. In International Symposium on Functional and Logic Programming. 40–55. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Henk P. Barendregt. 1991. Introduction to generalized type systems. Journal of Functional Programming 1, 2 (April 1991), 121–154.Google ScholarGoogle ScholarCross RefCross Ref
  3. Bruno Barras and Bruno Bernardo. 2008. Implicit Calculus of Constructions as a Programming Language with Dependent Types. In Conference on Foundations of Software Science and Computation Structures (Lecture Notes in Computer Science), Vol. 4962. Budapest, Hungary. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Matthias Blume, Umut A. Acar, and Wonseok Chae. 2006. Extensible programming with first-class cases. In International Conference on Functional Programming. Portland, Oregon, 239–250. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Edwin Brady. 2013. Idris, a general-purpose dependently typed programming language: Design and implementation. Journal of Functional Programming 23, 5 (2013), 552–593.Google ScholarGoogle ScholarCross RefCross Ref
  6. Chris Casinghino, Vilhelm Sjöberg, and Stephanie Weirich. 2014. Combining proofs and programs in a dependently typed language. In Symposium on Principles of Programming Languages. ACM Press, 33–45. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Giuseppe Castagna, Tommaso Petrucciani, and Kim Nguyên. 2016. Settheoretic types for polymorphic variants. In International Conference on Functional Programming. 378–391. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. James Chapman, Pierre-Évariste Dagand, Conor McBride, and Peter Morris. 2010. The Gentle Art of Levitation. In International Conference on Functional Programming. Baltimore, MD, 3–14. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Thierry Coquand. 1992. Pattern Matching with Dependent Types. In Workshop on Types for Proofs and Programs. 66–79.Google ScholarGoogle Scholar
  10. Denis Firsov and Aaron Stump. 2018. Generic Derivation of Induction for Impredicative Encodings in Cedille. In Certified Programs and Proofs. 215–227. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Eduardo Giménez. 1994. Codifying guarded definitions with recursive schemes. Technical Report RR1995-07. École Normale Supérieure de Lyon.Google ScholarGoogle Scholar
  12. Gérard P. Huet, Christine Paulin-Mohring, et al. 2000. The Coq Proof Assistant Reference Manual. Part of the Coq system version 6.3.1.Google ScholarGoogle Scholar
  13. Xavier Leroy. 1992. Unboxed Objects and Polymorphic Typing. In Symposium on Principles of Programming Languages. 177–188. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Xavier Leroy. 1997. The Effectiveness of Type-Based Unboxing. In International Workshop on Types in Compilation. BCCS-97-03.Google ScholarGoogle Scholar
  15. Zhaohui Luo. 1989. ECC, an Extended Calculus of Constructions. In Annual Symposium on Logic in Computer Science. 386–395. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Robin Milner, Mads Tofte, Robert Harper, and David B. MacQueen. 1997. The Definition of Standard ML Revised. MIT Press, Cambridge, Massachusetts. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Alexandre Miquel. 2001. The implicit calculus of constructions: extending pure type systems with an intersection type binder and subtyping. In International conference on Typed Lambda Calculi and Applications. 344– 359. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Nathan Mishra-Linger and Tim Sheard. 2008. Erasure and Polymorphism in Pure Type Systems. In Conference on Foundations of Software Science and Computation Structures (Lecture Notes in Computer Science), Vol. 4962. Budapest, Hungary, 350–364. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Stefan Monnier. 2007. The Swiss Coercion. In Programming Languages meets Program Verification. ACM Press, Freiburg, Germany, 33–40. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Stefan Monnier. 2019. Typer: ML boosted with type theory and Scheme. In Journées Francophones des Langages Applicatifs. 193–208.Google ScholarGoogle Scholar
  21. Ulf Norell. 2007. Towards a Practical Programming Language Based on Dependent Type Theory. Ph.D. Dissertation. Chalmers university.Google ScholarGoogle Scholar
  22. Martin Odersky and Philip Wadler. 1997. Pizza into Java: Translating Theory into Practice. In Symposium on Principles of Programming Languages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Christine Paulin-Mohring. 1993. Inductive definitions in the system Coq— rules and properties. In International conference on Typed Lambda Calculi and Applications, M. Bezem and J. Groote (Eds.). LNCS 664, SpringerVerlag, 328–345. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Zhong Shao. 1997. Flexible Representation Analysis. In International Conference on Functional Programming. ACM Press, 85–98. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Martin Sulzmann, Manuel M. T. Chakravarty, Simon Peyton Jones, and Kevin Donnelly. 2007. System F with Type Equality Coercions. In Types in Language Design and Implementation. Nice, France, 53–66. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Nikhil Swamy, Cătălin Hriţcu, Chantal Keller, Aseem Rastogi, Antoine Delignat-Lavaud, Simon Forest, Karthikeyan Bhargavan, Cédric Fournet, Pierre-Yves Strub, Markulf Kohlweiss, Jean-Karim Zinzindohoue, and Santiago Zanella-Béguelin. 2016. Dependent Types and Multi-monadic Effects in F*. In Symposium on Principles of Programming Languages. ACM Press, 256–270. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Inductive types deconstructed: the calculus of united constructions

          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
          • Published in

            cover image ACM Conferences
            TyDe 2019: Proceedings of the 4th ACM SIGPLAN International Workshop on Type-Driven Development
            August 2019
            76 pages
            ISBN:9781450368155
            DOI:10.1145/3331554

            Copyright © 2019 ACM

            Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 18 August 2019

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • research-article

            Upcoming Conference

            ICFP '24
          • Article Metrics

            • Downloads (Last 12 months)17
            • Downloads (Last 6 weeks)0

            Other Metrics

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader