A Gradual Interpretation of Union Types

被引:13
|
作者
Toro, Matias [1 ]
Tanter, Eric [1 ]
机构
[1] Univ Chile, Comp Sci Dept DCC, PLEIAD Lab, Santiago, Chile
来源
STATIC ANALYSIS (SAS 2017) | 2017年 / 10422卷
关键词
SYNTAX;
D O I
10.1007/978-3-319-66706-5_19
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
Union types allow to capture the possibility of a term to be of several possibly unrelated types. Traditional static approaches to union types are untagged and tagged unions, which present dual advantages in their use. Inspired by recent work on using abstract interpretation to understand gradual typing, we present a novel design for union types, called gradual union types. Gradual union types combine the advantages of tagged and untagged union types, backed by dynamic checks. Seen as a gradual typing discipline, gradual union types are restricted imprecise types that denote a finite number of static types. We apply the Abstracting Gradual Typing (AGT) methodology of Garcia et al. to derive the static and dynamic semantics of a language that supports both gradual unions and the traditional, totally-unknown type. We uncover that gradual unions interact with the unknown type in a way that mandates a stratified approach to AGT, relying on a composition of two distinct abstract interpretations in order to retain optimality. Thanks to the abstract interpretation framework, the resulting language is type safe and satisfies the refined criteria for gradual languages. We also show how to compile such a language to a threesome cast calculus, and prove that the compilation preserves the semantics and properties of the language.
引用
收藏
页码:382 / 404
页数:23
相关论文
共 50 条
  • [1] Gradual typing with union and intersection types
    Castagna, Giuseppe
    Lanvin, Victor
    [J]. Proceedings of the ACM on Programming Languages, 2017, 1 (ICFP):
  • [2] A Realizability Interpretation for Intersection and Union Types
    Dougherty, Daniel J.
    de'Liguoro, Ugo
    Liquori, Luigi
    Stolze, Claude
    [J]. PROGRAMMING LANGUAGES AND SYSTEMS, APLAS 2016, 2016, 10017 : 187 - 205
  • [3] Gradual Security Types and Gradual Guarantees
    Bichhawat, Abhishek
    McCall, McKenna
    Jia, Limin
    [J]. 2021 IEEE 34TH COMPUTER SECURITY FOUNDATIONS SYMPOSIUM (CSF 2021), 2021, : 49 - 64
  • [4] Migrating Gradual Types
    Campora, John Peter
    Chen, Sheng
    Erwig, Martin
    Walkingshaw, Eric
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2018, 2 (POPL):
  • [5] Gradual Ownership Types
    Sergey, Ilya
    Clarke, Dave
    [J]. PROGRAMMING LANGUAGES AND SYSTEMS, 2012, 7211 : 579 - 599
  • [6] Gradual ownership types
    IBBT-DistriNet, Department of Computer Science, Katholieke Universiteit Leuven, Belgium
    [J]. Lect. Notes Comput. Sci., 1600, (579-599):
  • [7] Gradual session types
    Igarashi, Atsushi
    Thiemann, Peter
    Tsuda, Yuya
    Vasconcelos, Vasco T.
    Wadler, Philip
    [J]. JOURNAL OF FUNCTIONAL PROGRAMMING, 2019, 29
  • [8] Gradual Refinement Types
    Lehmann, Nico
    Tanter, Eric
    [J]. ACM SIGPLAN NOTICES, 2017, 52 (01) : 775 - 788
  • [9] Migrating gradual types
    Campora, John Peter
    Chen, Sheng
    Erwig, Martin
    Walkingshaw, Eric
    [J]. JOURNAL OF FUNCTIONAL PROGRAMMING, 2022, 32 (01)
  • [10] TRADE UNIONISM IN THE UNITED STATES THE ESSENCE OF UNIONISM AND THE INTERPRETATION OF UNION TYPES
    Hoxie, Robert F.
    [J]. JOURNAL OF POLITICAL ECONOMY, 1914, 22 (05) : 464 - 481