Automated Transpilation of Imperative to Functional Code using Neural-Guided Program Synthesis (Extended Version)
Benjamin Mariano, Yanju Chen, Yu Feng, Greg Durrett, Isil Dillig

TL;DR
This paper introduces NGST2, a neural-guided program synthesis tool that automatically translates imperative Java and Python code into functional variants using APIs, leveraging trace-compatibility and concolic execution for effective transpilation.
Contribution
The paper presents a novel neural architecture called cognate grammar network and a trace-based pruning method, enabling effective automatic imperative-to-functional code transpilation.
Findings
NGST2 outperforms baseline methods in accuracy and efficiency.
Neural architecture and pruning are crucial for successful transpilation.
Effective translation of imperative Java and Python code to functional APIs achieved.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Parallel Computing and Optimization Techniques · Software Testing and Debugging Techniques
