论文标题
通过封闭的连续逻辑网络学习非线性循环不变式(扩展版)
Learning Nonlinear Loop Invariants with Gated Continuous Logic Networks (Extended Version)
论文作者
论文摘要
验证现实世界程序通常需要通过非线性约束推断循环不变。在执行许多数值操作的程序中尤其如此,例如航空电子或工业工厂的控制系统。最近,循环不变推理的数据驱动方法已显示出希望,尤其是在线性不变的方面。但是,由于高阶术语的数量和大小,对少数样本过度拟合的可能性以及可能的不平等范围的较大空间,将数据驱动的推断应用于非线性环路不变式不变。 在本文中,我们引入了一种新的神经体系结构,用于通用SMT学习,封闭式连续逻辑网络(G-CLN),并将其应用于非线性循环不变学习。 G-CLN通过门控单元和辍学扩展了连续的逻辑网络(CLN)体系结构,从而使模型可以在大量术语中强稳定地学习一般不变性。为了解决有限程序采样产生的过度拟合,我们引入了分数采样---循环语义的声音松弛到连续函数,以促进实际域上无限的采样。我们还设计了一种新的CLN激活函数,即分段偏置二次单元(PBQU),以自然学习紧密的不平等范围。 我们将这些方法纳入可以学习一般非线性回路不变性的非线性环路不变的推理系统中。我们以非线性环不变性的基准评估了我们的系统,并证明它解决了27个问题中的26个,比先前的工作多3,平均运行时间为53.3秒。我们通过在线性代码2INV基准中解决所有124个问题,进一步证明了G-CLN的通用学习能力。我们还执行定量稳定性评估,并表明G-CLN的汇合率为$ 97.5 \%$ $ $ $ $ $ $ $ $ $ 39.2 \%$ $比CLN型号的改善。
Verifying real-world programs often requires inferring loop invariants with nonlinear constraints. This is especially true in programs that perform many numerical operations, such as control systems for avionics or industrial plants. Recently, data-driven methods for loop invariant inference have shown promise, especially on linear invariants. However, applying data-driven inference to nonlinear loop invariants is challenging due to the large numbers of and magnitudes of high-order terms, the potential for overfitting on a small number of samples, and the large space of possible inequality bounds. In this paper, we introduce a new neural architecture for general SMT learning, the Gated Continuous Logic Network (G-CLN), and apply it to nonlinear loop invariant learning. G-CLNs extend the Continuous Logic Network (CLN) architecture with gating units and dropout, which allow the model to robustly learn general invariants over large numbers of terms. To address overfitting that arises from finite program sampling, we introduce fractional sampling---a sound relaxation of loop semantics to continuous functions that facilitates unbounded sampling on real domain. We additionally design a new CLN activation function, the Piecewise Biased Quadratic Unit (PBQU), for naturally learning tight inequality bounds. We incorporate these methods into a nonlinear loop invariant inference system that can learn general nonlinear loop invariants. We evaluate our system on a benchmark of nonlinear loop invariants and show it solves 26 out of 27 problems, 3 more than prior work, with an average runtime of 53.3 seconds. We further demonstrate the generic learning ability of G-CLNs by solving all 124 problems in the linear Code2Inv benchmark. We also perform a quantitative stability evaluation and show G-CLNs have a convergence rate of $97.5\%$ on quadratic problems, a $39.2\%$ improvement over CLN models.