paperbot · PL 论文追踪

全部论文 待读 收藏

P2 FrAngel: component-based synthesis with control structures

FrAngel:带控制结构的基于组件的程序合成
POPL 3(POPL)2019匹配度 2/10 · 论文属于经典的程序合成(基于组件的归纳合成与 angelic 条件),虽与程序语言/形式化方法相关,但未涉及静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析等用户核心方向。引用 36 inbox
Kensen Shi, Jacob Steinhardt, Percy Liang
crossref: 2026-09-10

AI 速览

一句话:FrAngel 通过挖掘部分成功程序中的代码片段并用 angelic 条件占位控制结构条件,实现带循环等控制结构的组件式合成。

基于组件的程序合成中,合成器需要根据一个组件(函数)库生成程序,但现有方法难以合成循环等控制结构,且往往要求组件具有形式化规格,代价高昂。本文提出 FrAngel:在给定目标签名、一组输入输出示例和组件库(无形式规格)的条件下,合成简短的、含控制结构的 Java 函数。其核心思想有二:一是从仅通过部分示例的“部分成功”程序中挖掘代码片段,作者称这类片段因具备 special-case similarity 性质而对合成很有价值;二是用 angelic 条件作为控制结构条件的占位符,对生成的程序 sketch 进行乐观求值,从而把合成过程分解为先寻找有希望的部分程序、再补全其缺失条件。实验表明,FrAngel 能在数秒内合成出多种含控制结构组合的有趣程序,显著优于此前的最先进方法。

问题
如何在只有输入输出示例、且组件库不带形式化规格的情况下,合成包含循环等控制结构的程序;已有组件式合成器难以处理控制结构,且常依赖昂贵的组件规格。
方法
从只通过部分示例的程序中挖掘代码片段(基于 special-case similarity),并以 angelic 条件作为控制结构条件的占位符,对程序 sketch 做乐观求值,将合成分解为寻找部分程序与补全条件两步。
评估
在给定签名、输入输出示例与组件库的设定下合成 Java 函数,展示数秒内可得多种含控制结构组合的程序,并与此前最先进方法进行对比,性能显著更优。
原文摘要(Abstract)

In component-based program synthesis, the synthesizer generates a program given a library of components (functions). Existing component-based synthesizers have difficulty synthesizing loops and other control structures, and they often require formal specifications of the components, which can be expensive to generate. We present FrAngel, a new approach to component-based synthesis that can synthesize short Java functions with control structures when given a desired signature, a set of input-output examples, and a collection of libraries (without formal specifications). FrAngel aims to discover programs with many distinct behaviors by combining two main ideas. First, it mines code fragments from partially-successful programs that only pass some of the examples. These extracted fragments are often useful for synthesis due to a property that we call special-case similarity . Second, FrAngel uses angelic conditions as placeholders for control structure conditions and optimistically evaluates the resulting program sketches. Angelic conditions decompose the synthesis process: FrAngel first finds promising partial programs and later fills in their missing conditions. We demonstrate that FrAngel can synthesize a variety of interesting programs with combinations of control structures within seconds, significantly outperforming prior state-of-the-art.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot655,
  title = {FrAngel: component-based synthesis with control structures},
  author = {Kensen Shi and Jacob Steinhardt and Percy Liang},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {3},
  number = {POPL},
  year = {2019},
  doi = {10.1145/3290386}
}