Automated transpilation of imperative to functional code using neural-guided program synthesis
Benjamin Mariano, Yanju Chen, Yu Feng, Greg Durrett, Isil Dillig
摘要
While many mainstream languages such as Java, Python, and C# increasingly incorporate functional APIs to simplify programming and improve parallelization/performance, there are no effective techniques that can be used to automatically translate existing imperative code to functional variants using these APIs. Motivated by this problem, this paper presents a transpilation approach based on inductive program synthesis for modernizing existing code. Our method is based on the observation that the overwhelming majority of source/target programs in this setting satisfy an assumption that we call trace-compatibility: not only do the programs share syntactically identical low-level expressions, but these expressions also take the same values in corresponding execution traces. Our method leverages this observation to design a new neural-guided synthesis algorithm that (1) uses a novel neural architecture called cognate grammar network (CGN) and ( 2) leverages a form of concolic execution to prune partial programs based on intermediate values that arise during a computation. We have implemented our approach in a tool called NGST2 and use it to translate imperative Java and Python code to functional variants that use the Stream and functools APIs respectively. Our experiments show that NGST2 significantly outperforms several baselines and that our proposed neural architecture and pruning techniques are vital for achieving good results.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了最后一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper11
- Verified Code Transpilation with LLMsSahil Bhatia, Jie Qiu, Niranjan Hasabnis, Sanjit A. Seshia 等NeurIPS 2024 · 被引用 36 次
- Multilingual Code Co-evolution using Large Language ModelsJiyang Zhang, Pengyu Nie, Junyi Jessy Li, Milos GligoricFSE 2023 · 被引用 34 次
- Programming-by-Demonstration for Long-Horizon Robot TasksNoah Patton, Kia Rahmani, Meghana Missula, Joydeep Biswas 等POPL 2024 · 被引用 11 次
- Control-Flow Deobfuscation using Trace-Informed Compositional Program SynthesisBenjamin Mariano, Ziteng Wang, Shankara Pailoor, Christian S. Collberg 等OOPSLA 2024 · 被引用 5 次
- SIRO: Empowering Version Compatibility in Intermediate Representations via Program SynthesisBowen Zhang, Wei Chen, Peisen Yao, Chengpeng Wang 等ASPLOS 2024 · 被引用 4 次
它引用的顶会 Paper4
- Unsupervised Translation of Programming LanguagesBaptiste Rozière, Marie-Anne Lachaux, Lowik Chanussot, Guillaume LampleNeurIPS 2020 · 被引用 606 次
- Learning Compositional Rules via Neural Program SynthesisMaxwell I. Nye, Armando Solar-Lezama, Josh Tenenbaum, Brenden M. LakeNeurIPS 2020 · 被引用 120 次
- Web question answering with neurosymbolic program synthesisQiaochu Chen, Aaron Lamoreaux, Xinyu Wang, Greg Durrett 等PLDI 2021 · 被引用 25 次
- Demystifying Loops in Smart ContractsBenjamin Mariano, Yanju Chen, Yu Feng, Shuvendu K. Lahiri 等ASE 2020 · 被引用 20 次
相关 Paper
- Automated Translation of Functional Big Data Queries to SQLGuoqiang Zhang, Benjamin Mariano, Xipeng Shen, Isil DilligOOPSLA 2023 · 被引用 5 次
- User-Customizable Transpilation of Scripting LanguagesBo Wang, Aashish Kolluri, Ivica Nikolic, Teodora Baluta 等OOPSLA 2023 · 被引用 13 次
- Top-Down Synthesis for Library LearningMatthew Bowers, Theo X. Olausson, Lionel Wong, Gabriel Grand 等POPL 2023 · 被引用 32 次
- Differentiable Synthesis of Program ArchitecturesGuofeng Cui, He ZhuNeurIPS 2021 · 被引用 20 次
- Terra: Imperative-Symbolic Co-Execution of Imperative Deep Learning ProgramsTaebum Kim, Eunji Jeong, Geon-Woo Kim, Yunmo Koo 等NeurIPS 2021 · 被引用 7 次
