Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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 2019 Publication History
  • Get Citation Alerts
  • 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.
    [2]
    Henk P. Barendregt. 1991. Introduction to generalized type systems. Journal of Functional Programming 1, 2 (April 1991), 121–154.
    [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.
    [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.
    [5]
    Edwin Brady. 2013. Idris, a general-purpose dependently typed programming language: Design and implementation. Journal of Functional Programming 23, 5 (2013), 552–593.
    [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.
    [7]
    Giuseppe Castagna, Tommaso Petrucciani, and Kim Nguyên. 2016. Settheoretic types for polymorphic variants. In International Conference on Functional Programming. 378–391.
    [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.
    [9]
    Thierry Coquand. 1992. Pattern Matching with Dependent Types. In Workshop on Types for Proofs and Programs. 66–79.
    [10]
    Denis Firsov and Aaron Stump. 2018. Generic Derivation of Induction for Impredicative Encodings in Cedille. In Certified Programs and Proofs. 215–227.
    [11]
    Eduardo Giménez. 1994. Codifying guarded definitions with recursive schemes. Technical Report RR1995-07. École Normale Supérieure de Lyon.
    [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.
    [13]
    Xavier Leroy. 1992. Unboxed Objects and Polymorphic Typing. In Symposium on Principles of Programming Languages. 177–188.
    [14]
    Xavier Leroy. 1997. The Effectiveness of Type-Based Unboxing. In International Workshop on Types in Compilation. BCCS-97-03.
    [15]
    Zhaohui Luo. 1989. ECC, an Extended Calculus of Constructions. In Annual Symposium on Logic in Computer Science. 386–395.
    [16]
    Robin Milner, Mads Tofte, Robert Harper, and David B. MacQueen. 1997. The Definition of Standard ML Revised. MIT Press, Cambridge, Massachusetts.
    [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.
    [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.
    [19]
    Stefan Monnier. 2007. The Swiss Coercion. In Programming Languages meets Program Verification. ACM Press, Freiburg, Germany, 33–40.
    [20]
    Stefan Monnier. 2019. Typer: ML boosted with type theory and Scheme. In Journées Francophones des Langages Applicatifs. 193–208.
    [21]
    Ulf Norell. 2007. Towards a Practical Programming Language Based on Dependent Type Theory. Ph.D. Dissertation. Chalmers university.
    [22]
    Martin Odersky and Philip Wadler. 1997. Pizza into Java: Translating Theory into Practice. In Symposium on Principles of Programming Languages.
    [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.
    [24]
    Zhong Shao. 1997. Flexible Representation Analysis. In International Conference on Functional Programming. ACM Press, 85–98.
    [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.
    [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.

    Recommendations

    Comments

    Information & Contributors

    Information

    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
    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].

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 18 August 2019

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. Inductive types
    2. case analysis
    3. compilation
    4. union types

    Qualifiers

    • Research-article

    Conference

    ICFP '19
    Sponsor:

    Upcoming Conference

    ICFP '24

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • 0
      Total Citations
    • 180
      Total Downloads
    • Downloads (Last 12 months)19
    • Downloads (Last 6 weeks)1

    Other Metrics

    Citations

    View Options

    Get Access

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media