一句话:将递归程序合成拆分为固定递归结构的模板与非递归片段搜索,利用 paramorphism 简化并超越已有方法。
本文研究如何自动合成递归函数式程序。已有方法通常直接在递归程序空间搜索,效率与覆盖面受限。作者提出基于一类原始递归组合子——paramorphism——的合成方法:paramorphism 能表达代数数据类型上最常见的递归模式。核心是将合成问题分解为两部分:先用带多个洞的模板固定递归结构,再搜索非递归程序片段填充模板空洞。评估在文献基准集上进行,结果表明该方法不仅实现更简单,而且求解的基准数量超过此前提出的方法。
We show that synthesizing recursive functional programs using a class of primitive recursive combinators is both simpler and solves more benchmarks from the literature than previously proposed approaches. Our method synthesizes paramorphisms, a class of programs that includes the most common recursive programming patterns on algebraic data types. The crux of our approach is to split the synthesis problem into two parts: a multi-hole template that fixes the recursive structure, and a search for non-recursive program fragments to fill the template holes.