语言参数化引用合成(扩展版)
Language-Parametric Reference Synthesis (Extended)
AI总结:
针对IDE重构中引用合成难题,本文提出从Statix类型系统规范自动推导逆查找函数,并利用作用域图指导限定引用合成,在多种语言测试程序上验证了语言参数化方法的有效性。
摘要:
现代集成开发环境(IDE)提供自动化重构以帮助程序员开发和维护软件。然而,实现健全的自动化重构具有挑战性,因为重构可能会无意中引入名称绑定错误或导致引用解析到错误的声明。为了解决这些问题,Schäfer 等人先前的工作提出用锁定引用替换具体引用,以将绑定保留与转换分离。锁定引用空泛地解析到特定声明,并且在转换后必须被替换为也解析到该声明的具体引用。合成这些引用需要底层语言名称查找函数的忠实逆函数。\n由于现代编程语言中复杂的名称绑定特性,手动实现此类逆查找函数具有挑战性。相反,我们提出从用 Statix 元 DSL 编写的类型系统规范中自动推导此函数。为了指导限定引用的合成,我们使用作用域图(表示程序的绑定结构)来推断其名称并发现其语法结构。\n我们通过在 2528 个 Java、196 个 ChocoPy 和 49 个 Featherweight Generic Java 测试程序中为锁定引用合成具体引用来评估我们的方法。我们的方法产生了一种原则性的语言参数化引用合成方法。
英文摘要:
Modern Integrated Development Environments (IDEs) offer automated refactorings to aid programmers in developing and maintaining software. However, implementing sound automated refactorings is challenging, as refactorings may inadvertently introduce name-binding errors or cause references to resolve to incorrect declarations. To address these issues, previous work by Schäfer et al. proposed replacing concrete references with locked references to separate binding preservation from transformation. Locked references vacuously resolve to a specific declaration, and after transformation must be replaced with concrete references that also resolve to that declaration. Synthesizing these references requires a faithful inverse of the name lookup functions of the underlying language. Manually implementing such inverse lookup functions is challenging due to the complex name-binding features in modern programming languages. Instead, we propose to automatically derive this function from type system specifications written in the Statix meta-DSL. To guide the synthesis of qualified references we use scope graphs, which represent the binding structure of a program, to infer their names and discover their syntactic structure. We evaluate our approach by synthesizing concrete references for locked references in 2528 Java, 196 ChocoPy, and 49 Featherweight Generic Java test programs. Our approach yields a principled language-parametric method for synthesizing references.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。