This paper introduces a local search method for improving an existing program with respect to a measurable objective. Program Optimization with Locally Improving Search (POLIS) exploits the structure of a program, defined by its lines. POLIS improves a single line of the program while keeping the remaining lines fixed, using existing brute-force synthesis algorithms, and continues iterating until it is unable to improve the program's performance. POLIS was evaluated with a 27-person user study, where participants wrote programs attempting to maximize the score of two single-agent games: Lunar Lander and Highway. POLIS was able to substantially improve the participants' programs with respect to the game scores. A proof-of-concept demonstration on existing Stack Overflow code measures applicability in real-world problems. These results suggest that POLIS could be used as a helpful programming assistant for programming problems with measurable objectives.
翻译:本文提出了一种局部搜索方法,用于在可量化目标下改进现有程序。基于局部改进搜索的程序优化(POLIS)利用了由代码行定义的程序结构。POLIS在保持其余代码行不变的情况下,使用现有的暴力综合算法改进单行代码,并持续迭代,直至无法提升程序性能。通过一项27人用户研究对POLIS进行了评估,参与者编写程序以最大化两款单人游戏(“月球着陆器”和“高速公路”)的得分。结果表明,POLIS能显著提升参与者程序的游戏得分。此外,在现有Stack Overflow代码上的概念验证演示评估了该方法在实际问题中的适用性。这些结果表明,POLIS可作为编程问题的有益辅助工具,尤其适用于具有可量化目标的编程任务。