Learning Nonlinear Loop Invariants with Gated Continuous Logic Networks (Extended Version)
Not on the map. Why?
Abstract (arXiv)
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.
Key facts. Cited by 17 papers in the map (data through 7 Oct 2026). First posted on arXiv 17 Mar 2020.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 3; 2022: 1; 2023: 4; 2024: 3; 2025: 3; 2026: 3.
17 papers.
Sort:
By area:
- 2023Can Large Language Models Transform Natural Language Intent into Formal Method Postconditions?cited by 53
- 2024Code Repair with LLMs gives an Exploration-Exploitation Tradeoffcited by 50
- 2023Finding Inductive Loop Invariants using Large Language Modelscited by 35
- 2023Ranking LLM-Generated Loop Invariants for Program Verificationcited by 33
- 2021Learning Security Classifiers with Verified Global Robustness Propertiescited by 14
- 2024Enhancing Automated Loop Invariant Generation for Complex Programs with Large Language Modelscited by 7
- 2025Quokka: Accelerating Program Verification with LLMs via Invariant Synthesiscited by 4
- 2021Toward Neural-Network-Guided Program Synthesis and Verificationcited by 2
- 2024Application of AI to formal methods - an analysis of current trendscited by 2
- 2026SpecMind: Cognitively Inspired, Interactive Multi-Turn Framework for Postcondition Inferencecited by 2
- 2021WheaCha: A Method for Explaining the Predictions of Models of Codecited by 1
- 2025LLM For Loop Invariant Generation and Fixing: How Far Are We?cited by 1
5 more
- 2026Teaching Code LLMs to Reason with Intermediate Formal Specificationscited by 1
- 2022BNSynth: Bounded Boolean Functional Synthesiscited by 0
- 2023Chronosymbolic Learning: Efficient CHC Solving with Symbolic Reasoning and Inductive Learningcited by 0
- 2025AutoICE: Automatically Synthesizing Verifiable C Code via LLM-driven Evolutioncited by 0
- 2026Privilege and confidentiality in generative AI workflowscited by 0
- 2026Privilege and confidentiality in generative AI workflows6 Jul 2026
- 2026Teaching Code LLMs to Reason with Intermediate Formal Specifications5 Jul 2026
- 2026SpecMind: Cognitively Inspired, Interactive Multi-Turn Framework for Postcondition Inference24 Feb 2026
- 2025AutoICE: Automatically Synthesizing Verifiable C Code via LLM-driven Evolution8 Dec 2025
- 2025LLM For Loop Invariant Generation and Fixing: How Far Are We?9 Nov 2025
- 2025Quokka: Accelerating Program Verification with LLMs via Invariant Synthesis25 Sep 2025
- 2024Enhancing Automated Loop Invariant Generation for Complex Programs with Large Language Models13 Dec 2024
- 2024Application of AI to formal methods - an analysis of current trends22 Nov 2024
- 2024Code Repair with LLMs gives an Exploration-Exploitation Tradeoff26 May 2024
- 2023Finding Inductive Loop Invariants using Large Language Models14 Nov 2023
- 2023Ranking LLM-Generated Loop Invariants for Program Verification13 Oct 2023
- 2023Can Large Language Models Transform Natural Language Intent into Formal Method Postconditions?3 Oct 2023
5 more
- 2023Chronosymbolic Learning: Efficient CHC Solving with Symbolic Reasoning and Inductive Learning2 May 2023
- 2022BNSynth: Bounded Boolean Functional Synthesis15 Dec 2022
- 2021Learning Security Classifiers with Verified Global Robustness Properties24 May 2021
- 2021Toward Neural-Network-Guided Program Synthesis and Verification17 Mar 2021
- 2021WheaCha: A Method for Explaining the Predictions of Models of Code9 Feb 2021
- 2023Can Large Language Models Transform Natural Language Intent into Formal Method Postconditions?cited by 53
- 2024Code Repair with LLMs gives an Exploration-Exploitation Tradeoffcited by 50
- 2023Finding Inductive Loop Invariants using Large Language Modelscited by 35
- 2023Ranking LLM-Generated Loop Invariants for Program Verificationcited by 33
- 2021Learning Security Classifiers with Verified Global Robustness Propertiescited by 14
- 2024Enhancing Automated Loop Invariant Generation for Complex Programs with Large Language Modelscited by 7
- 2025Quokka: Accelerating Program Verification with LLMs via Invariant Synthesiscited by 4
- 2021Toward Neural-Network-Guided Program Synthesis and Verificationcited by 2
- 2024Application of AI to formal methods - an analysis of current trendscited by 2
- 2026SpecMind: Cognitively Inspired, Interactive Multi-Turn Framework for Postcondition Inferencecited by 2
- 2021WheaCha: A Method for Explaining the Predictions of Models of Codecited by 1
- 2025LLM For Loop Invariant Generation and Fixing: How Far Are We?cited by 1
12 most cited of 15 All 15 (JSON)
- 2026Privilege and confidentiality in generative AI workflows6 Jul 2026
- 2026SpecMind: Cognitively Inspired, Interactive Multi-Turn Framework for Postcondition Inference24 Feb 2026
- 2025AutoICE: Automatically Synthesizing Verifiable C Code via LLM-driven Evolution8 Dec 2025
- 2025LLM For Loop Invariant Generation and Fixing: How Far Are We?9 Nov 2025
- 2025Quokka: Accelerating Program Verification with LLMs via Invariant Synthesis25 Sep 2025
- 2024Enhancing Automated Loop Invariant Generation for Complex Programs with Large Language Models13 Dec 2024
- 2024Application of AI to formal methods - an analysis of current trends22 Nov 2024
- 2024Code Repair with LLMs gives an Exploration-Exploitation Tradeoff26 May 2024
- 2023Finding Inductive Loop Invariants using Large Language Models14 Nov 2023
- 2023Ranking LLM-Generated Loop Invariants for Program Verification13 Oct 2023
- 2023Can Large Language Models Transform Natural Language Intent into Formal Method Postconditions?3 Oct 2023
- 2022BNSynth: Bounded Boolean Functional Synthesis15 Dec 2022
12 newest of 15 All 15 (JSON)