Gradual typing with union and intersection types

被引:28
|
作者
Castagna G. [1 ]
Lanvin V. [2 ]
机构
[1] CNRS, Université Paris Diderot
来源
Proceedings of the ACM on Programming Languages | 2017年 / 1卷 / ICFP期
关键词
Gradual typing; Intersection types; Negation types; Set-theoretic types; Union types;
D O I
10.1145/3110285
中图分类号
学科分类号
摘要
We propose a type system for functional languages with gradual types and set-theoretic type connectives and prove its soundness. In particular, we show how to lift the definition of the domain and result type of an application from non-gradual types to gradual ones and likewise for the subtyping relation. We also show that deciding subtyping for gradual types can be reduced in linear time to deciding subtyping for non-gradual types and that the same holds true for all subtyping-related decision problems that must be solved for type inference. More generally, this work not only enriches gradual type systems with unions and intersections and with the type precision that arise from their use, but also proposes and advocates a new style of gradual types programming where union and intersection types are used by programmers to instruct the system to perform fewer dynamic checks. © 2017 Copyright held by the owner/author(s).
引用
收藏
相关论文
共 50 条
  • [41] Abstracting Gradual Typing
    Garcia R.
    Clark A.M.
    Tanter E.
    ACM SIGPLAN Notices, 2016, 51 (01): : 429 - 442
  • [42] Bidirectional Higher-Rank Polymorphism with Intersection and Union Types
    Jiang, Shengyi
    Cui, Chen
    Oliveira, Bruno C. d. S.
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2025, 9 (POPI):
  • [43] Distributing Intersection and Union Types with Splits and Duality (Functional Pearl)
    Huang, Xuejing
    Oliveira, Bruno C. D. S.
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2021, 5
  • [44] On declarative rewriting for sound and complete union, intersection and negation types
    Pearce, David J.
    JOURNAL OF COMPUTER LANGUAGES, 2019, 50 : 84 - 101
  • [45] Gradual Typing: A New Perspective
    Castagna, Giuseppe
    Lanvin, Victor
    Petrucciani, Tommaso
    Siek, Jeremy G.
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2019, 3 (POPL):
  • [46] System E: Expansion variables for flexible typing with linear and non-linear types and intersection types
    Carlier, S
    Polakow, J
    Wells, JB
    Kfoury, AJ
    PROGRAMMING LANGUAGES AND SYSTEMS, 2004, 2986 : 294 - 309
  • [47] Gradual Typing for Effect Handlers
    New, Max S.
    Giovannini, Eric
    Licata, Daniel R.
    PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2023, 7 (OOPSLA):
  • [48] Gradual Security Typing with References
    Fennell, Luminous
    Thiemann, Peter
    2013 IEEE 26TH COMPUTER SECURITY FOUNDATIONS SYMPOSIUM (CSF), 2013, : 224 - 239
  • [49] Is Sound Gradual Typing Dead?
    Takikawa, Asumu
    Feltey, Daniel
    Greenman, Ben
    New, Max S.
    Vitek, Jan
    Felleisen, Matthias
    ACM SIGPLAN NOTICES, 2016, 51 (01) : 456 - 468
  • [50] Reconciling noninterference and gradual typing
    de Amorim, Arthur Azevedo
    Fredrikson, Matt
    Jia, Limin
    PROCEEDINGS OF THE 35TH ANNUAL ACM/IEEE SYMPOSIUM ON LOGIC IN COMPUTER SCIENCE (LICS 2020), 2020, : 116 - 129