Semantic Code Refactoring for Abstract Data Types
Shankara Pailoor, Yuepeng Wang, Isil Dillig
摘要
Modifications to the data representation of an abstract data type (ADT) can require significant semantic refactoring of the code. Motivated by this observation, this paper presents a new method to automate semantic code refactoring tasks. Our method takes as input the original ADT implementation, a new data representation, and a so-called relational representation invariant (relating the old and new data representations), and automatically generates a new ADT implementation that is semantically equivalent to the original version.
Our method is based on counterexample-guided inductive synthesis (CEGIS) but leverages three key ideas that allow it to handle real-world refactoring tasks. First, our approach reduces the underlying relational synthesis problem to a set of (simpler) programming-by-example problems, one for each method in the ADT. Second, it leverages symbolic reasoning techniques, based on logical abduction, to deduce code snippets that should occur in the refactored version. Finally, it utilizes a notion of partial equivalence to make inductive synthesis much more effective in this setting. We have implemented the proposed approach in a new tool called Revamp for automatically refactoring Java classes and evaluated it on 30 Java class mined from Github. Our evaluation shows that Revamp can correctly refactor the entire ADT in 97% of the cases and that it can successfully re-implement 144 out of the 146 methods that require modifications.
CCS Concepts: • Software and its engineering → Abstract data types.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper9
- Superfusion: Eliminating Intermediate Data Structures via Inductive SynthesisRuyi Ji, Yuwei Zhao, Nadia Polikarpova, Yingfei Xiong 等PLDI 2024 · 被引用 4 次
- From Batch to Stream: Automatic Generation of Online AlgorithmsZiteng Wang, Shankara Pailoor, Aaryan Prakash, Yuepeng Wang 等PLDI 2024 · 被引用 4 次
- Graphiti: Bridging Graph and Relational Database QueriesYang He, Ruijie Fang, Isil Dillig, Yuepeng WangPLDI 2025 · 被引用 3 次
- Relational Synthesis of Recursive Programs via Constraint Annotated Tree AutomataAnders Miltner, Ziteng Wang, Swarat Chaudhuri, Isil DilligCAV 2024 · 被引用 2 次
- Automated Discovery of Tactic Libraries for Interactive Theorem ProvingYutong Xin, Jimmy Xin, Gabriel Poesia, Noah D. Goodman 等OOPSLA 2025
它引用的顶会 Paper7
- Combining the top-down propagation and bottom-up enumeration for inductive program synthesisWoosuk LeePOPL 2021 · 被引用 34 次
- Data-driven inference of representation invariantsAnders Miltner, Saswat Padhi, Todd D. Millstein, David WalkerPLDI 2020 · 被引用 33 次
- Data Migration using Datalog Program SynthesisYuepeng Wang, Rushi Shah, Abby Criswell, Rong Pan 等VLDB 2020 · 被引用 30 次
- Cyclic program synthesisShachar Itzhaky, Hila Peleg, Nadia Polikarpova, Reuben N. S. Rowe 等PLDI 2021 · 被引用 26 次
- Synthesis-powered optimization of smart contracts via data type refactoringYanju Chen, Yuepeng Wang, Maruth Goyal, James Dong 等OOPSLA 2022 · 被引用 14 次
相关 Paper
- Synthesizing data structure refinements from integrity constraintsShankara Pailoor, Yuepeng Wang, Xinyu Wang, Isil DilligPLDI 2021 · 被引用 10 次
- Synthesizing replacement classesMalavika Samak, Deokhwan Kim, Martin C. RinardPOPL 2020 · 被引用 14 次
- Recursion synthesis with unrealizability witnessesAzadeh Farzan, Danya Lette, Victor NicoletPLDI 2022 · 被引用 19 次
- From Custom Logic to APIs: Understanding and Recommending API Replacement RefactoringsBridget Nyirongo, Yanjie Jiang, Yuxia Zhang, Hui LiuISSTA 2026
- Provenance-guided synthesis of Datalog programsMukund Raghothaman, Jonathan Mendelson, David Zhao, Mayur Naik 等POPL 2020 · 被引用 49 次
