一句话:结合RNN语法修复与约束推理,自动修复入门编程作业中的错误程序。
自动程序校正可应用于安全、验证与教育。针对在线课程中学生提交的反馈需求,现有修复技术多依赖抽象语法树(AST),难以处理存在语法错误的程序。本文提出神经符号方法:先用循环神经网络(RNN)在错误位置替换或插入预测 token 完成语法修复,该网络在给定作业的正确提交语料上训练;再对语法修复后的程序应用约束推理,使其功能正确。在超过 14,500 份含语法错误的学生提交上评估,方法修复了 60%(8689)提交的语法错误,并为 23.8%(3455)份提交找到功能正确的修复。
Automatic correction of programs is a challenging problem with numerous real world applications in security, verification, and education. One application that is becoming increasingly important is the correction of student submissions in online courses for providing feedback. Most existing program repair techniques analyze Abstract Syntax Trees (ASTs) of programs, which are unfortunately unavailable for programs with syntax errors. In this paper, we propose a novel Neuro-symbolic approach that combines neural networks with constraint-based reasoning. Specifically, our method first uses a Recurrent Neural Network (RNN) to perform syntax repairs for the buggy programs; subsequently, the resulting syntactically-fixed programs are repaired using constraint-based techniques to ensure functional correctness. The RNNs are trained using a corpus of syntactically correct submissions for a given programming assignment, and are then queried to fix syntax errors in an incorrect programming submission by replacing or inserting the predicted tokens at the error location. We evaluate our technique on a dataset comprising of over 14,500 student submissions with syntax errors. Our method is able to repair syntax errors in 60% (8689) of submissions, and finds functionally correct repairs for 23.8% (3455) submissions.
DOI 原文 ·
@inproceedings{paperbot4445,
title = {Neuro-symbolic program corrector for introductory programming assignments},
author = {Sahil Bhatia and Pushmeet Kohli and Rishabh Singh},
booktitle = {ICSE},
year = {2018},
doi = {10.1145/3180155.3180219}
}