Program synthesis with Genetic Programming searches for a correct program that satisfies the input specification, which is usually provided as input-output examples. One particular challenge is how to effectively handle loops and recursion avoiding programs that never terminate. A helpful abstraction that can alleviate this problem is the employment of Recursion Schemes that generalize the combination of data production and consumption. Recursion Schemes are very powerful as they allow the construction of programs that can summarize data, create sequences, and perform advanced calculations. The main advantage of writing a program using Recursion Schemes is that the programs are composed of well defined templates with only a few parts that need to be synthesized. In this paper we make an initial study of the benefits of using program synthesis with fold and unfold templates, and outline some preliminary experimental results. To highlight the advantages and disadvantages of this approach, we manually solved the entire GPSB benchmark using recursion schemes, highlighting the parts that should be evolved compared to alternative implementations. We noticed that, once the choice of which recursion scheme is made, the synthesis process can be simplified as each of the missing parts of the template are reduced to simpler functions, which are further constrained by their own input and output types.
翻译:遗传编程的程序综合通过在输入-输出样例中搜索满足规范的正确程序。其中一个关键挑战是如何有效处理循环和递归,避免程序永不终止。缓解此问题的有效抽象是采用递归方案,该方案可泛化数据生产与消费的组合。递归方案功能强大,允许构建能够汇总数据、生成序列及执行高级计算的程序。使用递归方案编写程序的主要优势在于,程序由定义明确的模板构成,仅需综合少量组件。本文初步研究了使用fold和unfold模板进行程序综合的优势,并概述了初步实验结果。为突出该方法的优缺点,我们手动使用递归方案解决了整个GPSB基准测试,标注了相较于替代实现应进化的部分。研究发现,一旦选定递归方案,综合过程可被简化:模板中缺失部分均简化为更简单的函数,且这些函数进一步受其输入输出类型约束。