paperbot · PL 论文追踪

全部论文 待读 收藏

P2 RefiNym: using names to refine types

RefiNym:利用名称精化类型
FSE Proceedings of the 2018 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering2018匹配度 3/10 · 论文属于程序分析与类型系统方向,利用名称流挖掘概念类型并精化名义类型,但未涉及用户核心关注的 LLM/Agent 与静态分析交叉、浮点程序分析或贝叶斯程序分析,因此仅与 PL 背景弱相关。引用 27 inbox
Santanu Kumar Dash, Miltiadis Allamanis, Earl T. Barr
crossref: 2026-09-12

AI 速览

一句话:提出 RefiNym,通过名称流无监督挖掘概念类型并具体化为名义类型,以精化程序类型。

源代码兼具形式化算法通道与标识符/注释的自然语言通道。逻辑上不同的概念类型(如 Password 与 URL)常共享同一程序类型(如 string),使类型系统无法阻止跨概念误用。本文提出 name flows——扩展赋值流图以跟踪标识符名称;RefiNym 从中无监督地挖掘概念类型格,并将其具体化为不同名义类型。在 string 类型上,RefiNym 拆分原本合并的概念类型,把每个作用域的同类型变量数从 8.7 降至 2.2,并消除 21.9% 含多个同类型变量的作用域,使代码更自文档化,也让类型系统能阻止开发者的跨概念赋值。

问题
源代码中逻辑上不同的概念类型常共享同一程序类型,例如 Password 和 URL 都使用 string,导致类型系统无法区分并阻止跨概念误用。
方法
提出 name flows(扩展赋值流图以跟踪标识符名称),并实现无监督工具 RefiNym,从名称流中挖掘概念类型格并具体化为不同的名义类型。
评估
在 string 类型上评估:将每个作用域的同类型变量数从 8.7 降至 2.2,并消除 21.9% 含多个同类型变量的作用域,从而提升自文档性并支持类型系统阻止跨概念赋值。
原文摘要(Abstract)

Source code is bimodal: it combines a formal, algorithmic channel and a natural language channel of identifiers and comments. In this work, we model the bimodality of code with name flows, an assignment flow graph augmented to track identifier names. Conceptual types are logically distinct types that do not always coincide with program types. Passwords and URLs are example conceptual types that can share the program type string. Our tool, RefiNym, is an unsupervised method that mines a lattice of conceptual types from name flows and reifies them into distinct nominal types. For string, RefiNym finds and splits conceptual types originally merged into a single type, reducing the number of same-type variables per scope from 8.7 to 2.2 while eliminating 21.9% of scopes that have more than one same-type variable in scope. This makes the code more self-documenting and frees the type system to prevent a developer from inadvertently assigning data across conceptual types.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot4577,
  title = {RefiNym: using names to refine types},
  author = {Santanu Kumar Dash and Miltiadis Allamanis and Earl T. Barr},
  booktitle = {FSE},
  year = {2018},
  doi = {10.1145/3236024.3236042}
}