arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1906.04908cs.LGcs.CLcs.PLstat.ML
收藏

SPoC:基于搜索的伪代码到代码

SPoC: Search-based Pseudocode to Code

Stanford University(斯坦福大学)

Sumith Kulal, Panupong Pasupat, Kartik Chandra, Mina Lee, Oded Padon, Alex Aiken, Percy Liang

摘要:

我们考虑的任务映射伪代码的功能正确的长程序。给定测试用例作为验证程序的机制,我们搜索伪代码的可能翻译的空间,以找到通过验证的程序。然而,没有适当的信用分配本地化的程序失败的来源,这是很难引导搜索到更有前途的程序。我们建议执行信用分配的信号编译错误,构成88.7%的程序失败的基础上。具体地说,我们把每个伪代码行的翻译作为程序的一个离散部分,每当一个合成的程序无法编译时,错误定位方法试图识别程序中负责失败的部分。然后,我们集中搜索这些部分的伪代码的替代翻译。为了进行评估,我们收集了包含18,356个人工编写的伪代码和测试用例的Sort数据集(基于搜索的伪代码到代码)。在100个程序编译的预算下,执行搜索将使用伪代码的前一个翻译的合成成功率从25.6%提高到44.7%。

英文摘要:

We consider the task of mapping pseudocode to long programs that are functionally correct. Given test cases as a mechanism to validate programs, we search over the space of possible translations of the pseudocode to find a program that passes the validation. However, without proper credit assignment to localize the sources of program failures, it is difficult to guide search toward more promising programs. We propose to perform credit assignment based on signals from compilation errors, which constitute 88.7% of program failures. Concretely, we treat the translation of each pseudocode line as a discrete portion of the program, and whenever a synthesized program fails to compile, an error localization method tries to identify the portion of the program responsible for the failure. We then focus search over alternative translations of the pseudocode for those portions. For evaluation, we collected the SPoC dataset (Search-based Pseudocode to Code) containing 18,356 programs with human-authored pseudocode and test cases. Under a budget of 100 program compilations, performing search improves the synthesis success rate over using the top-one translation of the pseudocode from 25.6% to 44.7%.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑