Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article
Open access

Unifying typing and subtyping

Published: 12 October 2017 Publication History

Abstract

In recent years dependent types have become a hot topic in programming language research. A key reason why dependent types are interesting is that they allow unifying types and terms, which enables both additional expressiveness and economy of concepts. Unfortunately there has been much less work on dependently typed calculi for object-oriented programming. This is partly because it is widely acknowledged that the combination between dependent types and subtyping is particularly challenging.
This paper presents λ I, which is a dependently typed generalization of System F. The resulting calculus follows the style of Pure Type Systems, and contains a single unified syntactic sort that accounts for expressions, types and kinds. To address the challenges posed by the combination of dependent types and subtyping, λ I employs a novel technique that unifies typing and subtyping. In λ I there is only a judgement that is akin to a typed version of subtyping. Both the typing relation, as well as type well-formedness are just special cases of the subtyping relation. The resulting calculus has a rich metatheory and enjoys of several standard and desirable properties, such as subject reduction, transitivity of subtyping, narrowing as well as standard substitution lemmas. All the metatheory of λ I is mechanically proved in the Coq theorem prover. Furthermore, (and as far as we are aware) λ I is the first dependently typed calculus that completely subsumes System F, while preserving various desirable properties.

Supplementary Material

Auxiliary Archive (oopsla17-oopsla156-aux.zip)

References

[1]
Andreas Abel and Dulma Rodriguez. 2008. Syntactic metatheory of higher-order subtyping. In CSL ’08. 446–460.
[2]
Beniamino Accattoli and Giulio Guerrieri. 2016. Open Call-by-Value. In APLAS ’16. Springer, 206–226.
[3]
Thorsten Altenkirch, Nils Anders Danielsson, Andres Löh, and Nicolas Oury. 2010. ΠΣ: Dependent types without the sugar. In Functional and Logic Programming. Springer, 40–55.
[4]
Nada Amin, Samuel Grütter, Martin Odersky, Tiark Rompf, and Sandro Stucki. 2016. The essence of dependent object types. In A List of Successes That Can Change the World. Springer, 249–272.
[5]
Nada Amin, Adriaan Moors, and Martin Odersky. 2012. Dependent object types. In FOOL ’12. ACM.
[6]
Nada Amin, Tiark Rompf, and Martin Odersky. 2014. Foundations of path-dependent types. In OOPSLA ’14. ACM, 233–249.
[7]
David Aspinall and Adriana Compagnoni. 1996. Subtyping dependent types. In LICS ’96. 86–97.
[8]
Lennart Augustsson. 1998. Cayenne — a Language with Dependent Types. In ICFP ’98. ACM, 239–250.
[9]
Henk Barendregt. 1991. Introduction to generalized type systems. Journal of Functional Programming 1, 2 (1991), 125–154.
[10]
Henk Barendregt. 1992. Lambda Calculi with Types. In Handbook of Logic in Computer Science, Vol. 2. 117–309.
[11]
Edwin Brady. 2013. Idris, a general-purpose dependently typed programming language: Design and implementation. Journal of Functional Programming 23, 05 (2013), 552–593.
[12]
Kim B. Bruce, Luca Cardelli, and Benjamin C. Pierce. 1999. Comparing object encodings. Information and Computation 155, 1-2 (1999), 108–133.
[13]
Joana Campos and Vasco T. Vasconcelos. 2015. Imperative objects with dependent types. In FTfJP ’15. ACM, 2:1–2:6.
[14]
Luca Cardelli. 1986a. Amber. In Combinators and Functional Programming Languages. Springer Berlin Heidelberg, 21–47.
[15]
Luca Cardelli. 1986b. A Polymorphic lambda-calculus with Type: Type. Digital Systems Research Center.
[16]
Luca Cardelli, Simone Martini, John C. Mitchell, and Andre Scedrov. 1994. An extension of system F with subtyping. Information and Computation 109, 1-2 (1994), 4–56.
[17]
Luca Cardelli and Peter Wegner. 1985. On understanding types, data abstraction, and polymorphism. ACM Computing Surveys (CSUR) 17, 4 (1985), 471–523.
[18]
Chris Casinghino, Vilhelm Sjöberg, and Stephanie Weirich. 2014. Combining Proofs and Programs in a Dependently Typed Language. In POPL ’14. ACM, 33–45.
[19]
Giuseppe Castagna and Gang Chen. 2001. Dependent types with subtyping and late-bound overloading. Information and Computation 168, 1 (2001), 1–67.
[20]
Gang Chen. 1997. Subtyping calculus of construction. Mathematical Foundations of Computer Science 1997 (1997), 189–198.
[21]
Gang Chen. 1998. Dependent type system with subtyping (I) type level transitivity elimination. Journal of Computer Science and Technology 13, 6 (1998), 564–578.
[22]
Gang Chen. 2003. Coercive Subtyping for the Calculus of Constructions. In POPL ’03. ACM, 150–159.
[23]
Adriana Compagnoni and Healfdene Goguen. 2003. Typed operational semantics for higher-order subtyping. Information and Computation 184, 2 (2003), 242–297.
[24]
Adriana Beatriz Compagnoni. 1995. Higher-order subtyping with intersection types. Ph.D. Dissertation. University of Nijmegen.
[25]
Thierry Coquand and Gérard Huet. 1988. The Calculus of Constructions. Information and Computation 76 (1988), 95–120.
[26]
Karl Crary, Robert Harper, and Sidd Puri. 1999. What is a recursive module?. In PLDI ’99. ACM, 50–63.
[27]
Pierre-Louis Curien and Giorgio Ghelli. 1992. Coherence of subsumption, minimum typing and type-checking in F ≤. Mathematical structures in computer science 2, 01 (1992), 55–91.
[28]
Jean-Yves Girard. 1972. Interprétation fonctionelle et élimination des coupures de l’arithmétique d’ordre supérieur. Ph.D. Dissertation. Université Paris VII.
[29]
Robert Harper. 2013. Practical foundations for programming languages (1st ed.). Cambridge University Press.
[30]
DeLesley S. Hutchins. 2010. Pure Subtype Systems. In POPL ’10. ACM, 287–298.
[31]
Jonas Kaiser, Tobias Tebbi, and Gert Smolka. 2017. Equivalence of System F and λ2 in Coq Based on Context Morphism Lemmas. In CPP ’17. ACM, 222–234.
[32]
Garrin Kimmell, Aaron Stump, Harley D. Eades III, Peng Fu, Tim Sheard, Stephanie Weirich, Chris Casinghino, Vilhelm Sjöberg, Nathan Collins, and Ki Yung Ahn. 2012. Equational Reasoning about Programs with General Recursion and Call-by-value Semantics. In PLPV ’12. 15–26.
[33]
Adriaan Moors, Frank Piessens, and Martin Odersky. 2008. Generics of a Higher Kind. In OOPSLA ’08. ACM, 423–438.
[34]
Ulf Norell. 2007. Towards a practical programming language based on dependent type theory. Ph.D. Dissertation. Chalmers University of Technology.
[35]
Martin Odersky, Philippe Altherr, Vincent Cremet, Burak Emir, Sebastian Maneth, Stéphane Micheloud, Nikolay Mihaylov, Michel Schinz, Erik Stenman, and Matthias Zenger. 2004. An Overview of the Scala Programming Language. Technical Report IC/2004/64. EPFL Lausanne, Switzerland.
[36]
Martin Odersky, Vincent Cremet, Christine Röckl, and Matthias Zenger. 2003. A nominal theory of objects with dependent types. In ECOOP ’03. Springer, 201–224.
[37]
Luca Paolini and Simona Ronchi Della Rocca. 1999. Call-by-value Solvability. RAIRO-Theoretical Informatics and Applications 33, 6 (1999), 507–534.
[38]
Benjamin C. Pierce. 1992. Bounded quantification is undecidable. In POPL ’92. ACM, 305–315.
[39]
Benjamin C. Pierce. 2002. Types and programming languages. MIT press.
[40]
Benjamin C. Pierce and Martin Steffen. 1997. Higher-order subtyping. Theoretical computer science 176, 1 (1997), 235–282.
[41]
Benjamin C. Pierce and David N. Turner. 1994. Simple type-theoretic foundations for object-oriented programming. Journal of functional programming 4, 02 (1994), 207–247.
[42]
Benjamin C. Pierce and David N. Turner. 2000. Local type inference. ACM Transactions on Programming Languages and Systems (TOPLAS) 22, 1 (2000), 1–44.
[43]
Tiark Rompf and Nada Amin. 2016. Type soundness for dependent object types (DOT). In OOPSLA ’16. ACM, 624–641.
[44]
David A. Schmidt. 1994. The Structure of Typed Programming Languages. MIT Press.
[45]
Peter Sewell, Francesco Zappa Nardelli, Scott Owens, Gilles Peskine, Thomas Ridge, Susmit Sarkar, et al. 2010. Ott: Effective tool support for the working semanticist. Journal of functional programming 20, 1 (2010), 71–122.
[46]
Vilhelm Sjöberg, Chris Casinghino, Ki Yung Ahn, Nathan Collins, Harley D. Eades III, Peng Fu, Garrin Kimmell, Tim Sheard, Aaron Stump, and Stephanie Weirich. 2012. Irrelevance, Heterogenous Equality, and Call-by-value Dependent Type Systems. In MSFP ’12. 112–162.
[47]
Vilhelm Sjöberg and Stephanie Weirich. 2015. Programming Up to Congruence. In POPL ’15. ACM, 369–382.
[48]
Martin Steffen. 1998. Polarized Higher-Order Subtyping. Ph.D. Dissertation. Technische Fakultät, Friedrich-Alexander-Universität Erlangen-Nürnberg.
[49]
Aaron Stump, Morgan Deters, Adam Petcher, Todd Schiller, and Timothy Simpson. 2008. Verified Programming in Guru. In PLPV ’09. 49–58.
[50]
The Coq development team. 2016. The Coq proof assistant reference manual. https://coq.inria.fr/refman/ Version 8.6.
[51]
Floris van Doorn, Herman Geuvers, and Freek Wiedijk. 2013. Explicit Convertibility Proofs in Pure Type Systems. In LFMTP ’13. ACM, 25–36.
[52]
Stephanie Weirich, Justin Hsu, and Richard A. Eisenberg. 2013. System FC with Explicit Kind Equality. In ICFP ’13. ACM, 275–286.
[53]
Andrew K. Wright and Matthias Felleisen. 1994. A syntactic approach to type soundness. Information and computation 115, 1 (1994), 38–94.
[54]
Hongwei Xi and Frank Pfenning. 1999. Dependent types in practical programming. In POPL ’99. ACM, 214–227.
[55]
Yanpeng Yang, Xuan Bi, and Bruno C. d. S. Oliveira. 2016. Unified Syntax with Iso-types. In APLAS ’16. Springer, 251–270.
[56]
Yanpeng Yang and Bruno C. d. S. Oliveira. 2017. Unifying Typing and Subtyping (Extended version). Available from https://bitbucket.org/ypyang/oopsla17 . (2017).
[57]
Jan Zwanenburg. 1999. Pure type systems with subtyping. In TLCA ’99. 381–396.

Cited By

View all
  • (2024)Network Connectivity Resilience in Next Generation Backhaul Networks: Challenges and Future OpportunitiesIEEE Transactions on Network and Service Management10.1109/TNSM.2024.339285721:5(5321-5334)Online publication date: 1-Oct-2024
  • (2022)Competitive Bidding Strategies for Online Linear Optimization with Inventory Management ConstraintsACM SIGMETRICS Performance Evaluation Review10.1145/3529113.352911549:3(6-7)Online publication date: 25-Mar-2022
  • (2022)Type-level programming with match typesProceedings of the ACM on Programming Languages10.1145/34986986:POPL(1-24)Online publication date: 12-Jan-2022
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Proceedings of the ACM on Programming Languages
Proceedings of the ACM on Programming Languages  Volume 1, Issue OOPSLA
October 2017
1786 pages
EISSN:2475-1421
DOI:10.1145/3152284
Issue’s Table of Contents
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 ACM 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: 12 October 2017
Published in PACMPL Volume 1, Issue OOPSLA

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. dependent types
  2. object-oriented programming
  3. subtyping

Qualifiers

  • Research-article

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)136
  • Downloads (Last 6 weeks)24
Reflects downloads up to 28 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Network Connectivity Resilience in Next Generation Backhaul Networks: Challenges and Future OpportunitiesIEEE Transactions on Network and Service Management10.1109/TNSM.2024.339285721:5(5321-5334)Online publication date: 1-Oct-2024
  • (2022)Competitive Bidding Strategies for Online Linear Optimization with Inventory Management ConstraintsACM SIGMETRICS Performance Evaluation Review10.1145/3529113.352911549:3(6-7)Online publication date: 25-Mar-2022
  • (2022)Type-level programming with match typesProceedings of the ACM on Programming Languages10.1145/34986986:POPL(1-24)Online publication date: 12-Jan-2022
  • (2021)Competitive Algorithms for Online Multidimensional Knapsack ProblemsProceedings of the ACM on Measurement and Analysis of Computing Systems10.1145/34910425:3(1-30)Online publication date: 15-Dec-2021
  • (2021)Multi-Head Spatio-Temporal Attention Mechanism for Urban Anomaly Event PredictionProceedings of the ACM on Interactive, Mobile, Wearable and Ubiquitous Technologies10.1145/34780995:3(1-21)Online publication date: 14-Sep-2021
  • (2021)A theory of higher-order subtyping with type intervalsProceedings of the ACM on Programming Languages10.1145/34735745:ICFP(1-30)Online publication date: 19-Aug-2021
  • (2019)Pure iso-type systemsJournal of Functional Programming10.1017/S095679681900010829Online publication date: 17-Sep-2019
  • (2018)An Optimal Randomized Online Algorithm for QoS Buffer ManagementACM SIGMETRICS Performance Evaluation Review10.1145/3292040.321962946:1(28-30)Online publication date: 12-Jun-2018
  • (2018)An Optimal Randomized Online Algorithm for QoS Buffer ManagementAbstracts of the 2018 ACM International Conference on Measurement and Modeling of Computer Systems10.1145/3219617.3219629(28-30)Online publication date: 12-Jun-2018

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media