Automated Transpilation of Imperative to Functional Code using Neural-Guided Program Synthesis (Extended Version)
Not on the map. Why?
Abstract (arXiv)
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.
Key facts. Cited by 7 papers in the map (data through 7 Oct 2026). First posted on arXiv 17 Mar 2022.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2022: 1; 2023: 2; 2024: 2; 2025: 1; 2026: 1.
7 papers.
- 2023Multilingual Code Co-Evolution Using Large Language Modelscited by 9
- 2024LLM-Aided Compilation for Tensor Acceleratorscited by 8
- 2022Leveraging Artificial Intelligence on Binary Code Comprehensioncited by 3
- 2023TorchQL: A Programming Framework for Integrity Constraints in Machine Learningcited by 2
- 2024Out of style: Misadventures with LLMs and code style transfercited by 1
- 2026CodePivot: Bootstrapping Multilingual Transpilation in LLMs via Reinforcement Learning without Parallel Corporacited by 1
- 2025SoK: Understanding (New) Security Issues Across AI4Code Use Casescited by 0
- 2026CodePivot: Bootstrapping Multilingual Transpilation in LLMs via Reinforcement Learning without Parallel Corpora20 Apr 2026
- 2025SoK: Understanding (New) Security Issues Across AI4Code Use Cases20 Dec 2025
- 2024LLM-Aided Compilation for Tensor Accelerators6 Aug 2024
- 2024Out of style: Misadventures with LLMs and code style transfer14 Jun 2024
- 2023TorchQL: A Programming Framework for Integrity Constraints in Machine Learning13 Aug 2023
- 2023Multilingual Code Co-Evolution Using Large Language Models27 Jul 2023
- 2022Leveraging Artificial Intelligence on Binary Code Comprehension11 Oct 2022