CLN2INV:用连续逻辑网络学习循环不变量
CLN2INV: Learning Loop Invariants with Continuous Logic Networks
摘要:
程序验证提供了一个框架,以确保程序的正确性,从而系统地消除不同类别的错误。循环不变量的推断是真实世界程序自动验证的主要挑战之一,这些程序通常包含许多循环。在本文中,我们提出了连续逻辑网络(CLN),一种新的神经结构,自动学习循环不变量直接从程序执行轨迹。与现有的神经网络不同,CLN可以从程序执行轨迹中学习可满足性模理论(SMT)中用于循环不变量的公式的精确和显式表示。我们开发了一个新的声音和完整的语义映射分配SMT公式连续的真值,允许CLN进行有效的训练。我们使用CLN来实现一个新的循环不变式推理系统CLN2INV,它在流行的Code2Inv数据集上的性能明显优于现有方法。CLN2INV是第一个解决Code2Inv数据集中所有124个理论上可解决的问题的工具。此外,CLN2INV解决每个问题平均只需1.1秒,比现有方法快40倍。我们进一步证明,CLN2INV甚至可以学习12个比Code2Inv数据集所需的更复杂的循环不变量。
英文摘要:
Program verification offers a framework for ensuring program correctness and therefore systematically eliminating different classes of bugs. Inferring loop invariants is one of the main challenges behind automated verification of real-world programs which often contain many loops. In this paper, we present Continuous Logic Network (CLN), a novel neural architecture for automatically learning loop invariants directly from program execution traces. Unlike existing neural networks, CLNs can learn precise and explicit representations of formulas in Satisfiability Modulo Theories (SMT) for loop invariants from program execution traces. We develop a new sound and complete semantic mapping for assigning SMT formulas to continuous truth values that allows CLNs to be trained efficiently. We use CLNs to implement a new inference system for loop invariants, CLN2INV, that significantly outperforms existing approaches on the popular Code2Inv dataset. CLN2INV is the first tool to solve all 124 theoretically solvable problems in the Code2Inv dataset. Moreover, CLN2INV takes only 1.1 seconds on average for each problem, which is 40 times faster than existing approaches. We further demonstrate that CLN2INV can even learn 12 significantly more complex loop invariants than the ones required for the Code2Inv dataset.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。