CLN2INV: Learning Loop Invariants with Continuous Logic Networks

09/25/2019
by   Gabriel Ryan, et al.
0

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 second 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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
03/17/2020

Learning Nonlinear Loop Invariants with Gated Continuous Logic Networks

In many cases, verifying real-world programs requires inferring loop inv...
research
10/10/2020

Cuvée: Blending SMT-LIB with Programs and Weakest Preconditions

Cuvée is a program verification tool that reads SMT-LIB-like input files...
research
03/17/2020

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

Verifying real-world programs often requires inferring loop invariants w...
research
10/12/2020

A Complete Approach to Loop Verification with Invariants and Summaries

Loop invariants characterize the partial result computed by a loop so fa...
research
05/19/2020

Pegasus: Sound Continuous Invariant Generation

Continuous invariants are an important component in deductive verificati...
research
10/31/2019

Data Abstraction and Relational Program Logic

In a paper published in 1972 Hoare articulated the fundamental notions o...
research
08/16/2018

Aligator.jl - A Julia Package for Loop Invariant Generation

We describe the Aligator.jl software package for automatically generatin...

Please sign up or login with your details

Forgot password? Click here to reset