Program synthesis is the task of automatically generating expressions that satisfy a given specification. Program synthesis techniques have been used to automate the generation of loop invariants in code, synthesize function summaries, and to assist programmers via program sketching. Syntax-guided synthesis has been a successful paradigm in this area, however, one area where the state-of-the-art solvers fall-down is reasoning about potentially unbounded data structures such as arrays where both specifications and solutions may require quantifiers and quantifier alternations. We present SynRG, a synthesis algorithm based on restricting the synthesis problem to generate candidate solutions with quantification over a finite domain, and then generalizing these candidate solutions to the unrestricted domain of the original specification. We report experiments on invariant synthesis benchmarks and on program sketching benchmarks taken from the Java StringUtils class and show that our technique can synthesize expressions out of reach of all existing solvers.
翻译:程序合成是自动生成符合特定规格的表达式的任务。 程序合成技术已经用于在代码、 合成功能摘要中自动生成循环变量, 并通过程序草图协助程序设计员。 语法指导合成是这一领域的一个成功范例, 然而, 最先进的解答器下降的一个领域是潜在无约束的数据结构的推理, 例如, 各种规格和解决方案可能需要量化和量化的交替的阵列。 我们介绍了SynRG, 一种基于限制合成问题的综合算法, 以生成量化一个有限域的候选解决方案, 然后将这些候选解决方案推广到原始规格的无限制域。 我们报告了关于差异合成基准和从 Java StretingUtils 类中采集的方案草图基准的实验, 并表明我们的技术可以合成所有现有解答器所接触的表达方式。