Finding Inductive Loop Invariants using Large Language Models

Adharsh Kamath, Aditya Senthilnathan, Saikat Chakraborty, Pantazis Deligiannis, Shuvendu K. Lahiri +4 more
11/14/2023
cs.PLcs.LG

No confident code implementation found for this paper. 2 possible matches can be shown below.

Abstract

Loop invariants are fundamental to reasoning about programs with loops. They establish properties about a given loop's behavior.

Show full abstract

When they additionally are inductive, they become useful for the task of formal verification that seeks to establish strong mathematical guarantees about program's runtime behavior. The inductiveness ensures that the invariants can be checked locally without consulting the entire program, thus are indispensable artifacts in a formal proof of correctness. Finding inductive loop invariants is an undecidable problem, and despite a long history of research towards practical solutions, it remains far from a solved problem. This paper investigates the capabilities of the Large Language Models (LLMs) in offering a new solution towards this old, yet important problem. To that end, we first curate a dataset of verification problems on programs with loops. Next, we design a prompt for exploiting LLMs, obtaining inductive loop invariants, that are checked for correctness using sound symbolic tools. Finally, we explore the effectiveness of using an efficient combination of a symbolic tool and an LLM on our dataset and compare it against a purely symbolic baseline. Our results demonstrate that LLMs can help improve the state-of-the-art in automated program verification.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 2 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{kamath2023finding,
  title  = {Finding Inductive Loop Invariants using Large Language Models},
  author = {Adharsh Kamath and Aditya Senthilnathan and Saikat Chakraborty and Pantazis Deligiannis and Shuvendu K. Lahiri and Akash Lal and Aseem Rastogi and Subhajit Roy and Rahul Sharma},
  year   = {2023},
  eprint = {2311.07948},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2311.07948v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2311.07948.svg)](https://codeofpaper.com/paper/2311.07948)

Discussion