[论文解读] Program Synthesis using Abstraction Refinement
本文提出了一种名为SYNGAR(基于抽象精化的合成)的程序合成技术,该技术利用抽象有限树自动机(AFTA)通过将具有等价抽象行为的程序分组来缩小搜索空间。通过迭代地使用错误证明来精化抽象,SYNGAR能够高效地找到正确程序或证明其不存在,在矩阵操作任务中相比最先进的工具实现了高达90倍的性能提升,并且在字符串转换任务中相较于FlashFill也表现出有利的性能表现。
We present a new approach to example-guided program synthesis based on counterexample-guided abstraction refinement. Our method uses the abstract semantics of the underlying DSL to find a program $P$ whose abstract behavior satisfies the examples. However, since program $P$ may be spurious with respect to the concrete semantics, our approach iteratively refines the abstraction until we either find a program that satisfies the examples or prove that no such DSL program exists. Because many programs have the same input-output behavior in terms of their abstract semantics, this synthesis methodology significantly reduces the search space compared to existing techniques that use purely concrete semantics. While synthesis using abstraction refinement (SYNGAR) could be implemented in different settings, we propose a refinement-based synthesis algorithm that uses abstract finite tree automata (AFTA). Our technique uses a coarse initial program abstraction to construct an initial AFTA, which is iteratively refined by constructing a proof of incorrectness of any spurious program. In addition to ruling out the spurious program accepted by the previous AFTA, proofs of incorrectness are also useful for ruling out many other spurious programs. We implement these ideas in a framework called ool. We have used the BLAZE framework to build synthesizers for string and matrix transformations, and we compare BLAZE with existing techniques. Our results for the string domain show that BLAZE compares favorably with FlashFill, a domain-specific synthesizer that is now deployed in Microsoft PowerShell. In the context of matrix manipulations, we compare BLAZE against Prose, a state-of-the-art general-purpose VSA-based synthesizer, and show that BLAZE results in a 90x speed-up over Prose.
研究动机与目标
- 解决由于搜索空间过大而导致的示例引导程序合成的可扩展性挑战。
- 通过基于等价抽象语义而非具体语义来分组程序,从而缩小搜索空间。
- 开发一种领域无关的合成框架,通过可定制的语义支持多种领域特定语言(DSL)。
- 通过使用错误程序的错误证明来迭代精化抽象,确保正确性。
- 在显著提升现有技术性能的同时,实现合成的可靠性和完备性。
提出的方法
- 使用抽象有限树自动机(AFTA)基于其抽象语义表示程序的等价类。
- 以粗粒度抽象初始化合成过程,并构建初始AFTA以表示具有相同抽象行为的程序。
- 通过检测在抽象语义下满足示例但实际在具体语义下不满足的虚假程序,应用反例引导的抽象精化(CEGAR)。
- 使用符号执行和谓词强化构造虚假程序的错误证明,从而不仅排除该虚假程序,还排除其他相关程序。
- 通过扩展AFTA中使用的谓词集合来精化抽象,确保在下一轮迭代中排除该虚假程序。
- 使用基于代价的排序函数来优先探索程序,确保终止性和完备性。
实验结果
研究问题
- RQ1与具体语义相比,抽象精化是否能显著缩小程序合成中的搜索空间?
- RQ2错误证明是否不仅能排除单个虚假程序,还能排除具有相似抽象行为的整个程序类别?
- RQ3基于AFTA和CEGAR的领域无关框架是否能在程序合成中同时实现可靠性和完备性?
- RQ4基于抽象的合成方法在实际应用领域中与FlashFill和Prose等最先进的工具相比性能如何?
- RQ5该方法是否能有效扩展到复杂领域(如矩阵变换),其中现有工具面临性能瓶颈?
主要发现
- SYNGAR的实现Blaze在矩阵操作任务中相比基于VSA的最先进的合成器Prose实现了90倍的性能提升。
- 在字符串转换领域,Blaze的性能优于广泛部署于Microsoft PowerShell中的合成器FlashFill,至少快一个数量级。
- SYNGAR在字符串和矩阵两个领域中,相较于另外两种现有技术,性能均至少提升了一个数量级。
- 该方法具有可靠性和完备性:如果存在正确程序,SYNGAR将通过迭代精化抽象最终找到它。
- 错误证明不仅有效排除了特定的虚假程序,还排除了大量具有相似抽象行为的其他程序。
- 使用抽象有限树自动机能够高效表示和精化程序等价类,从而大幅减少探索的程序数量。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。