arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.20962cs.SEcs.LO
收藏

结合逻辑与大型语言模型用于 ASP 程序的自动调试与修复

Combining Logic with Large Language Models for Automatic Debugging and Repair of ASP Programs

Ricardo Brancas, Vasco Manquinho, Ruben Martins

AI总结:

本文提出 FormHe,融合逻辑故障定位、程序变异与 LLM,自动识别并修复学生提交的错误 ASP 程序,实验显示故障检测准确率达 94%、修复成功率达 58%。

摘要:

逻辑程序是求解 NP-Hard 问题的一种强大方法。然而,由于其声明式特性,调试逻辑程序面临重大挑战。与允许逐步检查程序状态的过程式范式不同,逻辑程序需要通过对逻辑语句进行推理来定位故障。在学习环境中,由于学生缺乏经验,这种复杂性进一步加剧。我们提出 FormHe,这是一种新颖工具,结合基于逻辑的技术与大型语言模型,以识别并纠正 Answer Set Programming 提交中的问题。FormHe 由两个组件组成:故障定位模块和程序修复模块。首先,故障定位器识别一组需要修改的错误程序语句。随后,FormHe 采用程序变异技术和大型语言模型来修复有缺陷的 ASP 程序。这些修复随后可作为指导,帮助学生纠正其程序。我们针对学生提交的真实错误程序进行的实验表明,FormHe 在 94% 的情况下能够准确检测故障,并成功修复 58% 的错误提交。

英文摘要:

Logic programs are a powerful approach for solving NP-Hard problems. However, due to their declarative nature, debugging logic programs poses significant challenges. Unlike procedural paradigms, which allow for step-by-step inspection of program state, logic programs require reasoning about logical statements for fault localization. This complexity is amplified in learning environments due to students' inexperience. We introduce FormHe, a novel tool that combines logic-based techniques and Large Language Models to identify and correct issues in Answer Set Programming submissions. FormHe consists of two components: a fault localization module and a program repair module. First, the fault localizer identifies a set of faulty program statements requiring modification. Subsequently, FormHe employs program mutation techniques and Large Language Models to repair the flawed ASP program. These repairs can then serve as guidance for students to correct their programs. Our experiments with real buggy programs submitted by students show that FormHe accurately detects faults in 94% of cases and successfully repairs 58% of incorrect submissions.

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

↑