Disjoint intersection types

被引:0
|
作者
Oliveira B.C.D.S. [1 ]
Shi Z. [1 ]
Alpuim J. [1 ]
机构
[1] Oliveira, Bruno C. D. S.
[2] Shi, Zhiyuan
[3] Alpuim, João
来源
| 1600年 / Association for Computing Machinery, 2 Penn Plaza, Suite 701, New York, NY 10121-0701, United States卷 / 51期
关键词
Intersection Types; Type System;
D O I
10.1145/2951913.2951945
中图分类号
学科分类号
摘要
Dunfield showed that a simply typed core calculus with intersection types and a merge operator is able to capture various programming language features. While his calculus is type-safe, it is not coherent: different derivations for the same expression can elaborate to expressions that evaluate to different values. The lack of coherence is an important disadvantage for adoption of his core calculus in implementations of programming languages, as the semantics of the programming language becomes implementation-dependent. This paper presents λ-i: A coherent and type-safe calculus with a form of intersection types and a merge operator. Coherence is achieved by ensuring that intersection types are disjoint and programs are sufficiently annotated to avoid type ambiguity. We propose a definition of disjointness where two types A and B are disjoint only if certain set of types are common supertypes of A and B. We investigate three different variants of λ-i, with three variants of disjointness. In the simplest variant, which does not allow ĝŠ Currency sign types, two types are disjoint if they do not share any common supertypes at all. The other two variants introduce ĝŠ Currency sign types and refine the notion of disjointness to allow two types to be disjoint when the only the set of common supertypes are top-like. The difference between the two variants with ĝŠ Currency sign types is on the definition of top-like types, which has an impact on which types are allowed on intersections. We present a type system that prevents intersection types that are not disjoint, as well as an algorithmic specifications to determine whether two types are disjoint for all three variants. © 2016 ACM.
引用
下载
收藏
页码:364 / 377
页数:13
相关论文
共 50 条
  • [31] Elaborating intersection and union types
    Dunfield, Joshua
    JOURNAL OF FUNCTIONAL PROGRAMMING, 2014, 24 (2-3) : 133 - 165
  • [32] Intersection types for unbind and rebind
    Dezani-Ciancaglini, Mariangiola
    Giannini, Paola
    Zucca, Elena
    ELECTRONIC PROCEEDINGS IN THEORETICAL COMPUTER SCIENCE, 2011, (45): : 45 - 58
  • [33] The emptiness problem for intersection types
    Urzyczyn, P
    JOURNAL OF SYMBOLIC LOGIC, 1999, 64 (03) : 1195 - 1215
  • [34] Nominal essential intersection types
    Ayala-Rincon, Mauricio
    Fernandez, Maribel
    Rocha-Oliveira, Ana Cristina
    Ventura, Daniel Lima
    THEORETICAL COMPUTER SCIENCE, 2018, 737 : 62 - 80
  • [35] Subtyping and intersection types revisited
    Pfenning, Frank
    ACM SIGPLAN NOTICES, 2007, 42 (09) : 219 - 219
  • [36] Intersection types for explicit substitutions
    Lengrand, S
    Lescanne, P
    Dougherty, D
    Dezani-Ciancaglini, M
    van Bakel, S
    INFORMATION AND COMPUTATION, 2004, 189 (01) : 17 - 42
  • [37] Intersection Types for Unboundedness Problems
    Parys, Pawel
    ELECTRONIC PROCEEDINGS IN THEORETICAL COMPUTER SCIENCE, 2019, (293): : 7 - 27
  • [38] Simple SubTypes of Intersection Types
    Statman, Rick
    FUNDAMENTA INFORMATICAE, 2019, 170 (1-3) : 307 - 324
  • [39] STRONG CONJUNCTION AND INTERSECTION TYPES
    ALESSI, F
    BARBANERA, F
    LECTURE NOTES IN COMPUTER SCIENCE, 1991, 520 : 64 - 73
  • [40] Intersection types and computational effects
    Davies, R
    Pfenning, F
    ACM SIGPLAN NOTICES, 2000, 35 (09) : 198 - 208