Empowering union and intersection types with integrated subtyping

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.

[1]  Benjamin C. Pierce,et al.  Types and programming languages: the next generation , 2003, 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings..

[2]  Giuseppe Castagna,et al.  Semantic subtyping , 2002, Proceedings 17th Annual IEEE Symposium on Logic in Computer Science.

[3]  Paul Gochet,et al.  Algorithms for Relevant Logic , 2005, Logic, Thought and Action.

[4]  John C. Mitchell,et al.  Polymorphic Type Inference and Containment , 1988, Inf. Comput..

[5]  Mariangiola Dezani-Ciancaglini,et al.  Intersection and Union Types: Syntax and Semantics , 1995, Inf. Comput..

[6]  Peter H. Golde,et al.  C# Language Specification , 2003 .

[7]  Luca Viganò An O(n log n)-Space Decision Procedure for the Relevance Logic B+ , 2000, Stud Logica.

[8]  John C. Reynolds,et al.  Preliminary design of the programming language Forsythe , 1988 .

[9]  Ross Tate,et al.  Getting F-bounded polymorphism into shape , 2014, PLDI.

[10]  Davide Ancona,et al.  Semantic subtyping for imperative object-oriented languages , 2016, OOPSLA.

[11]  Daniele Varacca,et al.  Semantic Subtyping for Objects and Classes , 2016, Comput. J..

[12]  John C. Reynolds,et al.  Design of the programming language FORSYTHE , 1997 .

[13]  Martin Odersky,et al.  Putting type annotations to work , 1996, POPL '96.

[14]  Benjamin C. Pierce,et al.  XDuce: A statically typed XML processing language , 2003, TOIT.

[15]  Alexandra Silva,et al.  CoCaml: Functional Programming with Regular Coinductive Types , 2017, Fundam. Informaticae.

[16]  Nada Amin,et al.  Type soundness for dependent object types (DOT) , 2016, OOPSLA.

[17]  Benjamin C. Pierce,et al.  Regular expression types for XML , 2000, TOPL.

[18]  Joe B. Wells,et al.  A calculus with polymorphic and polyvariant flow types , 2002, J. Funct. Program..

[19]  Benjamin C. Pierce,et al.  A decision procedure for the subtype relation on intersection types with bounded variables , 1989 .

[20]  Alexander Aiken,et al.  Type inclusion constraints and type inference , 1993, FPCA '93.

[21]  MuehlboeckFabian,et al.  Empowering union and intersection types with integrated subtyping , 2018 .

[22]  Robin Milner,et al.  Principal type-schemes for functional programs , 1982, POPL '82.

[23]  Damien Pous,et al.  Checking NFA equivalence with bisimulations up to congruence , 2013, POPL.

[24]  Alan Edelman,et al.  Julia: A Fresh Approach to Numerical Computing , 2014, SIAM Rev..

[25]  Mariangiola Dezani-Ciancaglini,et al.  The Minimal Relevant Logic and the Call-by-Value Lambda Calculus∗ , 2001 .

[26]  Luigi Liquori,et al.  A Decidable Subtyping Logic for Intersection and Union Types , 2017, TTCS.

[27]  Ross Tate,et al.  Taming wildcards in Java's type system , 2011, PLDI '11.

[28]  Sophia Drossopoulou,et al.  Deny capabilities for safe, fast actors , 2015, AGERE!@SPLASH.

[29]  Jens Palsberg,et al.  Efficient recursive subtyping , 1992, POPL '93.

[30]  Fritz Henglein,et al.  Coinductive Axiomatization of Recursive Type Equality and Subtyping , 1998, Fundam. Informaticae.

[31]  M. Coppo,et al.  Functional Characterization of Some Semantic Equalities inside Lambda-Calculus , 1979, ICALP.

[32]  Simon L. Peyton Jones,et al.  Practical type inference for arbitrary-rank types , 2007, Journal of Functional Programming.

[33]  Giuseppe Castagna,et al.  Semantic subtyping: Dealing set-theoretically with function, union, intersection, and negation types , 2008, JACM.

[34]  G. Pottinger,et al.  A type assignment for the strongly normalizable |?-terms , 1980 .

[35]  Giorgio Ghelli,et al.  Coherence of Subsumption, Minimum Typing and Type-Checking in F<= , 1992, Math. Struct. Comput. Sci..

[36]  Nate Foster,et al.  NetKAT: semantic foundations for networks , 2014, POPL.

[37]  Mariangiola Dezani-Ciancaglini,et al.  A new type assignment for λ-terms , 1978, Arch. Math. Log..

[38]  B. Pierce Programming with intersection types, union types, and polymorphism , 1991 .

[39]  B. Pierce,et al.  On Decidability of Nominal Subtyping with Variance , 2006 .

[40]  J. E. L. Peck,et al.  Revised report on the algorithmic language ALGOL 68 , 2004, Acta Informatica.

[41]  Richard Sylvan,et al.  The semantics of entailment — III , 1972, J. Philos. Log..

[42]  Richard Sylvan,et al.  The semantics of entailment—II , 1972, Journal of Philosophical Logic.

[43]  James Gosling,et al.  The Java Language Specification, 3rd Edition , 2005 .

[44]  Guy L. Steele,et al.  Java(TM) Language Specification, The (3rd Edition) (Java (Addison-Wesley)) , 2005 .

[45]  Sam Tobin-Hochstadt,et al.  The design and implementation of typed scheme , 2008, POPL '08.

[46]  Frank Pfenning,et al.  Intersections and Unions of Session Types , 2016, ITRS.

[47]  Martín Abadi,et al.  Understanding TypeScript , 2014, ECOOP.

[48]  Guy L. Steele,et al.  The Java Language Specification , 1996 .

[49]  Nils Gesbert,et al.  A Logical Approach to Deciding Semantic Subtyping , 2015, ACM Trans. Program. Lang. Syst..

[50]  Jan Vitek,et al.  Julia subtyping: a rational reconstruction , 2018, Proc. ACM Program. Lang..

[51]  Jens Palsberg,et al.  From polyvariant flow information to intersection and union types , 1998, POPL '98.

[52]  Giuseppe Castagna,et al.  Set-theoretic foundation of parametric polymorphism and subtyping , 2011, ICFP.

[53]  Mirko Viroli On the recursive generation of parametric types , 2007 .

[54]  Fritz Henglein,et al.  Regular expression containment: coinductive axiomatization and computational interpretation , 2011, POPL '11.