What Is Decidable about Gradual Types?

被引:9
|
作者
Migeed, Zeina [1 ]
Palsberg, Jens [1 ]
机构
[1] Univ Calif Los Angeles, Comp Sci Dept, 4732 Boelter Hall, Los Angeles, CA 90095 USA
来源
PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL | 2020年 / 4卷 / POPL期
关键词
Types; migration; algorithms;
D O I
10.1145/3371097
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Programmers can use gradual types to migrate programs to have more precise type annotations and thereby improve their readability, efficiency, and safety. Such migration requires an exploration of the migration space and can benefit from tool support, as shown in previous work. Our goal is to provide a foundation for better tool support by settling decidability questions about migration with gradual types. We present three algorithms and a hardness result for deciding key properties and we explain how they can be useful during an exploration. In particular, we show how to decide whether the migration space is finite, whether it has a top element, and whether it is a singleton. We also show that deciding whether it has a maximal element is NP-hard. Our implementation of our algorithms worked as expected on a suite of microbenchmarks.
引用
收藏
页数:29
相关论文
共 50 条