This paper is concerned with synthesizing programs based on black-box oracles: we are interested in the case where there exists an executable implementation of a component or library, but its internal structure is unknown. We are provided with just an API or function signature, and aim to synthesize a program with equivalent behavior. To attack this problem, we detail Presyn: a program synthesizer designed for flexible interoperation with existing programs and compiler toolchains. Presyn uses high-level imperative control-flow structures and a pair of cooperating predictive models to efficiently narrow the space of potential programs. These models can be trained effectively on small corpora of synthesized examples. We evaluate Presyn against five leading program synthesizers on a collection of 112 synthesis benchmarks collated from previous studies and real-world software libraries. We show that Presyn is able to synthesize a wider range of programs than each of them with less human input. We demonstrate the application of our approach to real-world code and software engineering problems with two case studies: accelerator library porting and detection of duplicated library reimplementations.
翻译:本文涉及基于黑箱或黑器的合成程序: 我们感兴趣的是存在可执行的组件或图书馆, 但其内部结构未知。 我们仅获得一个 API 或功能签名, 目的是以同等行为合成一个程序。 为了解决这个问题, 我们详细介绍Presyn: 一个程序合成器, 设计用于与现有程序和编译工具链进行灵活互动的方案合成器。 Presyn 使用高层次的紧急控制流结构, 以及一对合作预测模型, 以有效缩小潜在程序的空间。 这些模型可以进行有效的合成实例小公司培训。 我们根据从以往研究和现实世界软件库中整理的112个综合基准收集的五个主要程序合成器进行评估。 我们显示Presyn能够将比每个程序都更广泛的程序合成器, 使用较少的人文输入。 我们通过两个案例研究, 展示了我们对真实世界代码和软件工程问题的方法的应用: 加速器图书馆移植和检测重复的图书馆执行。