当前位置: X-MOL 学术J. Funct. Program. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Static Blame for gradual typing
Journal of Functional Programming ( IF 1.1 ) Pub Date : 2024-03-25 , DOI: 10.1017/s0956796824000029
CHENGHAO SU , LIN CHEN , LI YANHUI , YUMING ZHOU

Gradual typing integrates static and dynamic typing by introducing a dynamic type and a consistency relation. A problem of gradual type systems is that dynamic types can easily hide erroneous data flows since consistency relations are not transitive. Therefore, a more rigorous static check is required to reveal these hidden data flows statically. However, in order to preserve the expressiveness of gradually typed languages, static checks for gradually typed languages cannot simply reject programs with potentially erroneous data flows. By contrast, a more reasonable request is to show how these data flows can affect the execution of the program. In this paper, we propose and formalize Static Blame, a framework that can reveal hidden data flows for gradually typed programs and establish the correspondence between static-time data flows and runtime behavior. With this correspondence, we build a classification of potential errors detected from hidden data flows and formally characterize the possible impact of potential errors in each category on program execution, without simply rejecting the whole program. We implemented Static Blame on Grift, an academic gradually typed language, and evaluated the effectiveness of Static Blame by mutation analysis to verify our theoretical results. Our findings revealed that Static Blame exhibits a notable level of precision and recall in detecting type-related bugs. Furthermore, we conducted a manual classification to elucidate the reasons behind instances of failure. We also evaluated the performance of Static Blame, showing a quadratic growth in run time as program size increases.

中文翻译:

用于逐渐打字的静态指责

渐进类型通过引入动态类型和一致性关系来集成静态类型和动态类型。渐进类型系统的一个问题是动态类型很容易隐藏错误的数据流,因为一致性关系不具有传递性。因此,需要更严格的静态检查来静态地揭示这些隐藏的数据流。然而,为了保持渐进类型语言的表达能力,渐进类型语言的静态检查不能简单地拒绝具有潜在错误数据流的程序。相比之下,更合理的要求是展示这些数据流如何影响程序的执行。在本文中,我们提出并形式化静电责备,一个框架,可以揭示渐进类型程序的隐藏数据流,并建立静态数据流和运行时行为之间的对应关系。通过这种对应关系,我们构建了从隐藏数据流中检测到的潜在错误的分类,并正式描述了每个类别中的潜在错误对程序执行可能产生的影响,而不是简单地拒绝整个程序。我们在学术渐进式语言 Grift 上实现了 Static Blame,并通过变异分析评估了 Static Blame 的有效性,以验证我们的理论结果。我们的研究结果表明,Static Blame 在检测与类型相关的错误方面表现出显着的精确度和召回率。此外,我们还进行了手动分类,以阐明失败案例背后的原因。我们还评估了 Static Blame 的性能,显示随着程序大小的增加,运行时间呈二次方增长。
更新日期:2024-03-25
down
wechat
bug