CLN2INV: Learning Loop Invariants with Continuous Logic Networks
Gabriel Ryan, Justin Wong, Jianan Yao, Ronghui Gu, Suman Jana

TL;DR
This paper introduces CLN2INV, a neural approach that automatically learns precise loop invariants from program traces, significantly improving speed and accuracy over existing methods in program verification.
Contribution
The paper presents Continuous Logic Networks (CLNs) and their application in CLN2INV, the first tool to solve all solvable problems in Code2Inv with faster performance and ability to learn more complex invariants.
Findings
CLN2INV outperforms existing approaches on Code2Inv dataset.
CLN2INV solves all 124 solvable problems in Code2Inv.
Average solving time is 1.1 seconds, 40 times faster than previous methods.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Testing and Debugging Techniques · Formal Methods in Verification · Software Engineering Research
