CLN2INV: Learning Loop Invariants with Continuous Logic Networks

By Gabriel Ryan, Justin Wong, Jianan Yao, Ronghui Gu, Suman Sekhar Jana. 2019

74 citations recorded by the source corpus.

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.

Subfields: Computational Theory and Mathematics, Information Systems, Software, Natural Language Processing

How researchers see this paper

The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.

In Computational Theory and Mathematics

  1. Eric Wallace
  2. Luke S. Zettlemoyer
  3. Jessy Lin
  4. Michael Lewis
  5. Daniel Fried
  6. Sida I. Wang

In Information Systems

  1. Wen-tau Yih
  2. Sida I. Wang
  3. Luke S. Zettlemoyer
  4. Daniel Fried
  5. Eric Wallace
  6. Michael Lewis
  7. Ruiqi Zhong
  8. Denny Zhou

In Software

  1. Eric Wallace
  2. Luke S. Zettlemoyer
  3. Michael Lewis
  4. Ruiqi Zhong
  5. Sida I. Wang
  6. Freda Shi
  7. Denny Zhou

In Natural Language Processing

  1. Luke S. Zettlemoyer
  2. Wen-tau Yih
  3. Percy Liang
  4. Michael Lewis
  5. Eric Wallace
  6. Dan Roth
  7. Mohit Bansal
  8. Yejin Choi

Citations in the corpus