paper-with-me

Papers

Learning Nonlinear Loop Invariants with Gated Continuous Logic Networks (Extended Version)

2020-03-17 · Jianan Yao, Gabriel Ryan, Justin Wong, Suman Jana, Ronghui Gu

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.

📄 PDF Abstract BibTeX arXiv:2003.07959

Code (1)

rrlcs/bnsynth pytorch

Similar Papers 제목 키워드 기반

CLN2INV: Learning Loop Invariants with Continuous Logic Networks

2019-09-25 · ICLR 2020 1 · Gabriel Ryan, Justin Wong, Jianan Yao, Ronghui Gu 외

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 verifi…

Gated Uncertainty-Aware Runtime Dual Invariants for Neural Signal-Controlled Robotics

2025-11-25 · Tasha Kim, Oiwi Parker Jones arxiv

Safety-critical assistive systems that directly decode user intent from neural signals require rigorous guarantees of reliability and trust. We present GUARDIAN (Gated Uncertainty-Aware Runtime Dual Invariants), a framew…

Loop Invariant Generation: A Hybrid Framework of Reasoning optimised LLMs and SMT Solvers

2025-08-01 · Varun Bharti, Shashwat Jha, Dhruv Kumar, Pankaj Jalote arxiv

Loop invariants are essential for proving the correctness of programs with loops. Developing loop invariants is challenging, and fully automatic synthesis cannot be guaranteed for arbitrary programs. Some approaches have…

Logical Reasoning

Generalized invariants meet constitutive neural networks: A novel framework for hyperelastic materials

2025-08-16 · Denisa Martonová, Alain Goriely, Ellen Kuhl arxiv

The major challenge in determining a hyperelastic model for a given material is the choice of invariants and the selection how the strain energy function depends functionally on these invariants. Here we introduce a new …

LLM For Loop Invariant Generation and Fixing: How Far Are We?

2025-11-09 · Mostafijur Rahman Akhond, Saikat Chakraborty, Gias Uddin arxiv

A loop invariant is a property of a loop that remains true before and after each execution of the loop. The identification of loop invariants is a critical step to support automated program safety assessment. Recent adva…