Set-theoretic Types for Erlang

被引:5
|
作者
Schimpf, Albert [1 ]
Wehr, Stefan [2 ]
Bieniusa, Annette [1 ]
机构
[1] Univ Kaiserslautern Landau, Kaiserslautern, Germany
[2] Offenburg Univ Appl Sci, Offenburg, Germany
关键词
Erlang; functional programming; static type checking; semantic types; set-theoretic types;
D O I
10.1145/3587216.3587220
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Erlang is a functional programming language with dynamic typing. The language offers great flexibility for destructing values through pattern matching and dynamic type tests. Erlang also comes with a type language supporting parametric polymorphism, equi-recursive types, as well as union and a limited form of intersection types. However, type signatures only serve as documentation; there is no check that a function body conforms to its signature. Set-theoretic types and semantic subtyping fit Erlang's feature set very well. They allow expressing nearly all constructs of its type language and provide means for statically checking type signatures. This article brings set-theoretic types to Erlang and demonstrates how existing Erlang code can be statically type checked without or with only minor modifications to the code. Further, the article formalizes the main ingredients of the type system in a small core calculus, reports on an implementation of the system, and compares it with other static type checkers for Erlang.
引用
收藏
页数:14
相关论文
共 50 条
  • [1] Set-Theoretic Types for Polymorphic Variants
    Castagna, Giuseppe
    Petrucciani, Tommaso
    Nguyen, Kim
    ACM SIGPLAN NOTICES, 2016, 51 (09) : 378 - 391
  • [2] Polymorphic Functions with Set-Theoretic Types
    Castagna, Giuseppe
    Nguyen, Kim
    Xu, Zhiwu
    Abate, Pietro
    ACM SIGPLAN NOTICES, 2015, 50 (01) : 289 - 302
  • [3] Set-Theoretic types for polymorphic variants
    Castagna G.
    Petrucciani T.
    Nguyán K.
    1600, Association for Computing Machinery, 2 Penn Plaza, Suite 701, New York, NY 10121-0701, United States (51): : 378 - 391
  • [4] SET-THEORETIC MEREOLOGY
    Hamkins, Joel David
    Kikuchi, Makoto
    LOGIC AND LOGICAL PHILOSOPHY, 2016, 25 (03) : 285 - 308
  • [5] ON SET-THEORETIC INTERSECTIONS
    LYUBEZNIK, G
    JOURNAL OF ALGEBRA, 1984, 87 (01) : 105 - 112
  • [6] Set-theoretic blockchains
    Habic, Miha E.
    Hamkins, Joel David
    Klausner, Lukas Daniel
    Verner, Jonathan
    Williams, Kameryn J.
    ARCHIVE FOR MATHEMATICAL LOGIC, 2019, 58 (7-8) : 965 - 997
  • [7] POLYMORPHISM IS NOT SET-THEORETIC
    REYNOLDS, JC
    LECTURE NOTES IN COMPUTER SCIENCE, 1984, 173 : 145 - 156
  • [8] SET-THEORETIC INTERSECTIONS
    SCHENZEL, P
    VOGEL, W
    JOURNAL OF ALGEBRA, 1977, 48 (02) : 401 - 408
  • [9] Set-theoretic foundations
    Shapiro, S
    PROCEEDINGS OF THE TWENTIETH WORLD CONGRESS OF PHILOSOPHY, VOL 6: ANALYTIC PHILOSOPHY & LOGIC, 2000, : 183 - 196
  • [10] THE SET-THEORETIC MULTIVERSE
    Hamkins, Joel David
    REVIEW OF SYMBOLIC LOGIC, 2012, 5 (03): : 416 - 449