skip to main content

Empowering union and intersection types with integrated subtyping

Published:24 October 2018Publication History
Skip Abstract Section

Abstract

Union and intersection types are both simple and powerful but have seen limited adoption. The problem is that, so far, subtyping algorithms for type systems extended with union and intersections have typically been either unreliable or insufficiently expressive. We present a simple and composable framework for empowering union and intersection types so that they interact with the rest of the type system in an intuitive and yet still decidable manner. We demonstrate the utility of this framework by illustrating the impact it has made throughout the design of the Ceylon programming language developed by Red Hat.

Skip Supplemental Material Section

Supplemental Material

a112-muehlboeck.webm

webm

71.9 MB

References

  1. Coşku Acay and Frank Pfenning. 2017. Intersections and Unions of Session Types . Electronic Proceedings in Theoretical Computer Science 242, ITRS (2017), 4–19.Google ScholarGoogle ScholarCross RefCross Ref
  2. Alexander Aiken and Edward L. Wimmers. 1993. Type Inclusion Constraints and Type Inference . In FPCA. ACM, New York, NY, USA, 31–41. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Davide Ancona and Andrea Corradi. 2016. Semantic Subtyping for Imperative Object-oriented Languages . In OOPSLA. ACM, New York, NY, USA, 568–587. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Carolyn Jane Anderson, Nate Foster, Arjun Guha, Jean-Baptiste Jeannin, Dexter Kozen, Cole Schlesinger, and David Walker. 2014. NetKAT: Semantic Foundations for Networks . In POPL. ACM, New York, NY, USA, 113–126. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Franco Barbanera, Mariangiola Dezani-Ciancaglini, and Ugo de’Liguoro. 1995. Intersection and Union Types: Syntax and Semantics . Information and Computation 119, 2 (1995), 202–230. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Jeff Bezanson, Alan Edelman, Stefan Karpinski, and Viral B. Shah. 2017. Julia: A Fresh Approach to Numerical Computing . SIAM Rev. 59, 1 (2017), 65–98.Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Gavin Bierman, Martín Abadi, and Mads Torgersen. 2014. Understanding TypeScript . In ECOOP. Springer Berlin Heidelberg, Berlin, Heidelberg, DE, 257–281. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Filippo Bonchi and Damien Pous. 2013. Checking NFA Equivalence with Bisimulations up to Congruence . In POPL. ACM, New York, NY, USA, 457–468. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Michael Brandt and Fritz Henglein. 1998. Coinductive Axiomatization of Recursive Type Equality and Subtyping . Fundamenta Informaticae 33, 4 (1998), 309–338. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Giuseppe Castagna and Zhiwu Xu. 2011. Set-Theoretic Foundation of Parametric Polymorphism and Subtyping . In ICFP. ACM, New York, NY, USA, 94–106. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Sylvan Clebsch, Sophia Drossopoulou, Sebastian Blessing, and Andy McNeil. 2015. Deny Capabilities for Safe, Fast Actors . In AGERE! ACM, New York, NY, USA, 1–12. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Mario Coppo and Mariangiola Dezani-Ciancaglini. 1978. A New Type Assignment for λ-Terms . Archiv für Mathematische Logik und Grundlagenforschung 19, 1 (1978), 139–156.Google ScholarGoogle ScholarCross RefCross Ref
  13. Mario Coppo, Mariangiola Dezani-Ciancaglini, and Patrick Sallé. 1979. Functional Characterization of Some Semantic Equalities Inside λ-Calculus . Automata, Languages and Programming 71 (1979), 133–146. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Pierre-Louis Curien and Giorgio Ghelli. 1992. Coherence of Subsumption, Minimum Typing and Type-Checking in F ≤ . Mathematical Structures in Computer Science 2, 1 (1992), 55—-91.Google ScholarGoogle ScholarCross RefCross Ref
  15. Luís Damas and Robin Milner. 1982. Principal Type-Schemes for Functional Programs . In POPL. ACM, New York, NY, USA, 207–212. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Ornela Dardha, Daniele Gorla, and Daniele Varacca. 2013. Semantic Subtyping for Objects and Classes . In MOODS/FORTE. Springer Berlin Heidelberg, Berlin, Heidelberg, DEU, 66–82.Google ScholarGoogle Scholar
  17. Facebook. 2014. The Flow Static Type Checker Documentation .Google ScholarGoogle Scholar
  18. Alain Frisch, Giuseppe Castagna, and Véronique Benzaken. 2002. Semantic Subtyping . In LICS. IEEE, Washington, DC, USA, 137–146. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Alain Frisch, Giuseppe Castagna, and Véronique Benzaken. 2008. Semantic Subtyping: Dealing Set-Theoretically with Function, Union, Intersection, and Negation Types . Journal of the ACM 55, 4, Article 19 (2008), 64 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Nils Gesbert, Pierre Genevès, and Nabil Layaïda. 2015. A Logical Approach to Deciding Semantic Subtyping . TOPLAS 38, 1, Article 3 (2015), 31 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Paul Gochet, Pascal Gribomont, and Didier Rossetto. 2005. Algorithms for Relevant Logic . In Logic, Thought and Action. Springer Netherlands, Dordrecht, NLD, 479–496.Google ScholarGoogle Scholar
  22. James Gosling, Bill Joy, Guy Steele, and Gilad Bracha. 2005. The Java™ Language Specification, 3rd Edition . Addison-Wesley Professional, Boston, MA, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Ben Greenman, Fabian Muehlboeck, and Ross Tate. 2014. Getting F-Bounded Polymorphism into Shape . In PLDI. ACM, New York, NY, USA, 89–99. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Anders Hejlsberg, Scott Wiltamuth, and Peter Golde. 2005. C# Language Specification 2.0 . Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Fritz Henglein and Lasse Nielsen. 2011. Regular Expression Containment: Coinductive Axiomatization and Computational Interpretation . In POPL. ACM, New York, NY, USA, 385–398. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Haruo Hosoya and Benjamin C. Pierce. 2003. XDuce: A Statically Typed XML Processing Language . ACM Transactions on Internet Technology 3, 2 (2003), 117–148. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Haruo Hosoya, Jérôme Vouillon, and Benjamin C. Pierce. 2000. Regular Expression Types for XML . In ICFP. ACM, New York, NY, USA, 11–22. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Jean-Baptiste Jeannin, Dexter Kozen, and Alexandra Silva. 2017. CoCaml: Functional Programming with Regular Coinductive Types . Fundamenta Informaticae 150, 3/4 (2017), 347–377.Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Simon L. Peyton Jones, Dimitrios Vytiniotis, Stephanie Weirich, and Mark Shields. 2007. Practical Type Inference for Arbitrary-Rank Types . Journal of Functional Programming 17, 1 (2007), 1–82. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Andrew J. Kennedy and Benjamin C. Pierce. 2007. On Decidability of Nominal Subtyping with Variance . In FOOL. ACM, New York, NY, USA, Article 5, 12 pages.Google ScholarGoogle Scholar
  31. Gavin King. 2013. The Ceylon Language Specification, Version 1.0 .Google ScholarGoogle Scholar
  32. Dexter Kozen, Jens Palsberg, and Michael I. Schwartzbach. 1995. Efficient Recursive Subtyping . Mathematical Structures in Computer Science 5, 1 (1995), 113–125.Google ScholarGoogle ScholarCross RefCross Ref
  33. Luigi Liquori and Claude Stolze. 2017. A Decidable Subtyping Logic for Intersection and Union Types . In Topics in Theoretical Computer Science. Springer International Publishing, Cham, CHE, 74–90.Google ScholarGoogle Scholar
  34. Microsoft. 2012. TypeScript .Google ScholarGoogle Scholar
  35. Microsoft. 2018. The Typescript Handbook .Google ScholarGoogle Scholar
  36. John C. Mitchell. 1988. Polymorphic Type Inference and Containment . Information and Computation 76, 2/3 (1988), 211–249. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Fabian Muehlboeck and Ross Tate. 2018. Artifact for Article “Empowering Union and Intersection Types with Integrated Subtyping” . In OOPSLA. ACM, New York, NY, USA.Google ScholarGoogle Scholar
  38. Martin Odersky and Konstantin Läufer. 1996. Putting Type Annotations to Work . In POPL. ACM, New York, NY, USA, 54–67. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Jens Palsberg and Christina Pavlopoulou. 1998. From Polyvariant Flow Information to Intersection and Union Types . In POPL. ACM, New York, NY, USA, 197–208. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Benjamin C. Pierce. 1989. A Decision Procedure for the Subtype Relation on Intersection Types with Bounded Variables . Technical Report CMU-CS-89-169. Carnegie Mellon University.Google ScholarGoogle Scholar
  41. Benjamin C. Pierce. 1991. Programming with Intersection Types, Union Types, and Polymorphism . Technical Report CMU-CS-91-106. Carnegie Mellon University.Google ScholarGoogle Scholar
  42. Benjamin C. Pierce. 2002. Types and Programming Languages . MIT Press, Boston, MA, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Garrell Pottinger. 1980. A Type Assignment for the Strongly Normalizable λ-Terms . In To H.B. Curry: Essays on Combinatory Logic, Lambda Calculus, and Formalism. Academic Press, London, GBR, New York, NY, USA.Google ScholarGoogle Scholar
  44. John C. Reynolds. 1988. Preliminary Design of the Programming Language Forsythe . Technical Report CMU-CS-88-159. Carnegie Mellon University.Google ScholarGoogle Scholar
  45. John C. Reynolds. 1997. Design of the Programming Language Forsythe . In ALGOL-like Languages. Birkhäuser Boston, Boston, MA, USA, 173–233.Google ScholarGoogle Scholar
  46. Tiark Rompf and Nada Amin. 2016. Type Soundness for Dependent Object Types (DOT) . In OOPSLA. ACM, New York, NY, USA, 624–641. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. Richard Routley and Robert K. Meyer. 1972. The Semantics of Entailment: III . Journal of Philosophical Logic 1, 2 (1972), 192–208.Google ScholarGoogle ScholarCross RefCross Ref
  48. Ross Tate, Alan Leung, and Sorin Lerner. 2011. Taming Wildcards in Java’s Type System . In PLDI. ACM, New York, NY, USA, 614–627. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. The Coq Development Team. 1984. The Coq Proof Assistant .Google ScholarGoogle Scholar
  50. The Dotty Development Team. 2015. Dotty .Google ScholarGoogle Scholar
  51. Sam Tobin-Hochstadt and Matthias Felleisen. 2008. The Design and Implementation of Typed Scheme . In POPL. ACM, New York, NY, USA, 395–406. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. Steffen van Bakel, Mariangiola Dezani-Ciancaglini, Ugo de’Liguoro, and Yoko Motohama. 2000. The Minimal Relevant Logic and the Call-by-Value Lambda Calculus . Technical Report TR-ARP-05-2000. Australian National University.Google ScholarGoogle Scholar
  53. Adriaan van Wijngaarden, Barry J. Mailloux, John E. L. Peck, Cornelis H. A. Koster, Michel Sintzoff, Charles H. Lindsey, Lambert G. L. T. Meertens, and Richard G. Fisker (Eds.). 1975. Revised Report on the Algorithmic Language ALGOL 68 . Acta Informatica 5 (1975), 1–236. Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. Luca Viganò. 2000. An O(n log n)-Space Decision Procedure for the Relevance Logic B+ . Studia Logica 66, 3 (2000), 385–407.Google ScholarGoogle ScholarCross RefCross Ref
  55. Mirko Viroli. 2000. On the Recursive Generation of Parametric Types . Technical Report DEIS-LIA-00-002. University of Bologna.Google ScholarGoogle Scholar
  56. Joe B. Wells, Allyn Dimock, Robert Muller, and Franklyn Turbak. 2002. A Calculus with Polymorphic and Polyvariant Flow Types . Journal of Functional Programming 12, 3 (2002), 183–227. Google ScholarGoogle ScholarDigital LibraryDigital Library
  57. Francesco Zappa Nardelli, Julia Belyakova, Artem Pelenitsyn, Benjamin Chung, Jeff Bezanson, and Jan Vitek. 2018. Julia Subtyping: A Rational Reconstruction . In OOPSLA. ACM, New York, NY, USA, Article 113, 28 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Empowering union and intersection types with integrated subtyping

            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

            Full Access

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader