Leveraging Large Language Models for Automated Proof Synthesis in Rust

Jianan Yao, Ziqiao Zhou, Weiteng Chen, Weidong Cui
11/7/2023
cs.FLcs.AI

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

Abstract

Formal verification can provably guarantee the correctness of critical system software, but the high proof burden has long hindered its wide adoption. Recently, Large Language Models (LLMs) have shown success in code analysis and synthesis. In this paper, we present a combination of LLMs and static analysis to synthesize invariants, assertions, and other proof structures for a Rust-based formal verification framework called Verus. In a few-shot setting, LLMs demonstrate impressive logical ability in generating postconditions and loop invariants, especially when analyzing short code snippets. However, LLMs lack the ability to retain and propagate context information, a strength of traditional static analysis. Based on these observations, we developed a prototype based on OpenAI's GPT-4 model. Our prototype decomposes the verification task into multiple smaller ones, iteratively queries GPT-4, and combines its output with lightweight static analysis. We evaluated the prototype with a developer in the automation loop on 20 vector-manipulating programs. The results demonstrate that it significantly reduces human effort in writing entry-level proof code.

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. 5 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{yao2023leveraging,
  title  = {Leveraging Large Language Models for Automated Proof Synthesis in Rust},
  author = {Jianan Yao and Ziqiao Zhou and Weiteng Chen and Weidong Cui},
  year   = {2023},
  eprint = {2311.03739},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2311.03739v2}
}

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.03739.svg)](https://codeofpaper.com/paper/2311.03739)

Discussion