Automatic program repair seeks to generate correct code from buggy programs, with most approaches searching the correct program in a discrete, symbolic space of source code tokens. This symbolic search is fundamentally limited by its inability to directly reason about program behavior. We introduce Gradient-Based Program Repair (GBPR), a new paradigm that reframes program repair as continuous optimization in a differentiable numerical program space. Our core insight is to compile symbolic programs into differentiable numerical representations, enabling search in the numerical program space directly guided by program behavior. To evaluate GBPR, we present RaspBugs, a new benchmark of 1,466 buggy symbolic RASP programs and their respective numerical representations. Our experiments demonstrate that GBPR can effectively repair buggy symbolic programs by gradient-based optimization in the numerical program space, with convincing repair trajectories. To our knowledge, we are the first to state program repair as continuous optimization in a numerical program space. Our work establishes a new direction for program repair research, bridging two rich worlds: continuous optimization and program behavior.


翻译:自动程序修复旨在从有缺陷的程序中生成正确的代码,大多数方法在源代码标记的离散符号空间中搜索正确的程序。这种符号搜索从根本上受限于其无法直接推理程序行为。我们引入了基于梯度的程序修复(GBPR),这是一种将程序修复重新定义为可微分数值程序空间中连续优化的新范式。我们的核心洞见是将符号程序编译为可微分的数值表示,从而能够在数值程序空间中直接依据程序行为指导搜索。为评估GBPR,我们提出了RaspBugs,这是一个包含1,466个有缺陷的符号RASP程序及其对应数值表示的新基准。实验表明,GBPR能够通过在数值程序空间中进行基于梯度的优化,有效修复有缺陷的符号程序,并展示出可信的修复轨迹。据我们所知,我们是首个将程序修复表述为数值程序空间中连续优化的研究。我们的工作为程序修复研究开辟了新的方向,连接了两个丰富的领域:连续优化与程序行为。

0
下载
关闭预览

相关内容

IEEE TPAMI | 基于标注偏差估计的实例相关PU学习
专知会员服务
12+阅读 · 2021年10月23日
【NeurIPS2019】图变换网络:Graph Transformer Network
NAACL 2019 | 一种考虑缓和KL消失的简单VAE训练方法
PaperWeekly
20+阅读 · 2019年4月24日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员