Program synthesis is the process of generating a computer program following a set of specifications, which can be a high-level description of the problem and/or a set of input-output examples. The synthesis can be modeled as a search problem in which the search space is the set of all the programs valid under a grammar. As the search space is vast, brute force is usually not viable and search heuristics, such as genetic programming, also have difficulty navigating it without any guidance. In this paper we present HOTGP, a new genetic programming algorithm that synthesizes pure, typed, and functional programs. HOTGP leverages the knowledge provided by the rich data-types associated with the specification and the built-in grammar to constrain the search space and improve the performance of the synthesis. The grammar is based on Haskell's standard base library (the synthesized code can be directly compiled using any standard Haskell compiler) and includes support for higher-order functions, $\lambda$-functions, and parametric polymorphism. Experimental results show that, when compared to $6$ state-of-the-art algorithms using a standard set of benchmarks, HOTGP is competitive and capable of synthesizing the correct programs more frequently than any other of the evaluated algorithms.
翻译:程序合成是根据一组规范生成计算机程序的过程,这些规范可以是问题的高级描述和/或一组输入-输出示例。合成可以被建模为一个搜索问题,在这个搜索空间中,符合语法规范的程序构成了搜索空间的所有候选解。由于搜索空间巨大,相应的贪心算法,例如遗传编程,很难准确地在其中找到需要的解答。本文提出了一种全新的遗传编程算法HOTGP,该算法合成纯净、有类型、功能性强的程序。HOTGP利用由规范指定的丰富数据类型和内置语法知识约束搜索空间,提高了合成的性能。程序的语法是基于Haskell(一种纯函数语言)的标准库,包括对高阶函数、λ函数和参数化多态的支持。实验结果表明,在标准基准测试中,与其他六种先进算法相比,HOTGP具有竞争力,并能更频繁地合成出正确的程序。