paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Equivalence by Canonicalization for Synthesis-Backed Refactoring

面向合成支持重构的规范化等价
PLDI 8(PLDI)2024匹配度 3/10 · 论文属于程序合成与重构领域,核心是等价性规范化检查,与程序分析/形式化验证有间接关联;但未涉及 LLM/Agent、ML 系统、浮点程序分析或贝叶斯程序分析,因此与用户当前研究画像的核心问题匹配度较低。引用 2 inbox
Justin Lubin, Jeremy Ferguson, Kevin Ye, Jacob Yim, Sarah E. Chasins
crossref: 2026-09-10

AI 速览

一句话:提出基于规范化等价的程序合成框架,将直接风格代码重构为使用库组合子的等价代码。

论文针对如何将不使用库组件的“直接风格”代码重构为使用库组件的“组合子风格”等价代码这一问题,提出基于组件的重构合成框架。其核心是“通过规范化实现等价”的判定技术:该技术可靠但不完备,不依赖输入输出示例或逻辑规约,并可复用已有编译器优化。作者在 Elm 的高阶函数组合子(如 map、filter)和 Python NumPy 的高性能数值组合子两个场景实例化框架,实现工具 Cobbler,并在数千个真实程序上评估执行时间与输出质量。结果表明,合成支持的重构可在不同领域应用,且除输入程序外无需额外规约。

问题
如何自动把不使用库组件的直接风格代码重构为使用库组合子的等价代码,且不依赖输入输出示例或逻辑规约。
方法
提出 component-based refactoring 合成框架,并用 equivalence by canonicalization 进行可靠但不完备的等价检查,复用编译器优化;在 Elm 与 NumPy 场景实例化为 Cobbler。
评估
在数千个真实程序上评估 Elm 和 NumPy 两个实例的执行时间与输出质量。
原文摘要(Abstract)

We present an enumerative program synthesis framework called component-based refactoring that can refactor “direct” style code that does not use library components into equivalent “combinator” style code that does use library components. This framework introduces a sound but incomplete technique to check the equivalence of direct code and combinator code called equivalence by canonicalization that does not rely on input-output examples or logical specifications. Moreover, our approach can repurpose existing compiler optimizations, leveraging decades of research from the programming languages community. We instantiated our new synthesis framework in two contexts: (i) higher-order functional combinators such as map and filter in the staticallytyped functional programming language Elm and (ii) high-performance numerical computing combinators provided by the NumPy library for Python. We implemented both instantiations in a tool called Cobbler and evaluated it on thousands of real programs to test the performance of the component-based refactoring framework in terms of execution time and output quality. Our work offers evidence that synthesis-backed refactoring can apply across a range of domains without specification beyond the input program.

链接与引用

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

BibTeX
@article{paperbot2509,
  title = {Equivalence by Canonicalization for Synthesis-Backed Refactoring},
  author = {Justin Lubin and Jeremy Ferguson and Kevin Ye and Jacob Yim and Sarah E. Chasins},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {PLDI},
  year = {2024},
  doi = {10.1145/3656453}
}