paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Synthesizing replacement classes

合成替换类
POPL 4(POPL)2019匹配度 3/10 · 该论文属于传统程序合成与程序验证,虽与PL/形式化方法相关,但未涉及用户核心关注的LLM/Agent与静态分析/形式化验证交叉、浮点程序分析或贝叶斯程序分析,也没有LLM/Agent作为工具或对象。引用 14 inbox
Malavika Samak, Deokhwan Kim, Martin C. Rinard
crossref: 2026-09-10

AI 速览

一句话:提出借助自动合成的类间状态等价谓词,将候选类 R 合成为与原类 O 功能等价的替换类的技术。

论文提出一种自动合成替换类(replacement class)的技术。给定原始类 O 与候选替换类 R,该技术先合成 O 与 R 状态之间的类间等价谓词,再借助该谓词逐一合成替换方法,使得每个方法都保持对应对象的状态等价。由此可在方法级独立合成的同时,保证任意长调用序列后原对象与替换对象仍处于等价状态。作者将该技术实现为工具 Mask,并在开源 Java 类上进行评估,结果验证了其在合成替换类方面的有效性。

问题
如何自动为已有类 O 生成一个实现相同接口、提供相同功能的替换类,是软件维护与重构中的难题。
方法
给定原始类 O 和候选替换类 R,先合成二者状态间的类间等价谓词,再以该谓词为规约逐个合成替换方法,确保方法调用前后 O 与 R 的对应对象状态保持等价。
评估
将技术实现为工具 Mask,并在开源 Java 类上进行实验评估,结果表明 Mask 能有效合成替换类。
原文摘要(Abstract)

We present a new technique for automatically synthesizing replacement classes. The technique starts with an original class O and a potential replacement class R, then uses R to synthesize a new class that implements the same interface and provides the same functionality as O. Critically, our technique works with a synthe- sized inter-class equivalence predicate between the states of O and R. It uses this predicate to ensure that original and synthesized methods leave corresponding O and R objects in equivalent states. The predicate therefore enables the technique to synthesize individual replacement methods in isolation while still obtain- ing a replacement class that leaves the original and replacement objects in equivalent states after arbitrarily long method invocation sequences. We have implemented the technique as part of a tool, named Mask, and evaluated it using open-source Java classes. The results highlight the effectiveness of Mask in synthesizing replacement classes.

链接与引用

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

BibTeX
@article{paperbot559,
  title = {Synthesizing replacement classes},
  author = {Malavika Samak and Deokhwan Kim and Martin C. Rinard},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {4},
  number = {POPL},
  year = {2019},
  doi = {10.1145/3371120}
}