An Empirical Study of LLM-Generated Specifications for VeriFast

Wen Fan, Minh Tran, Sanya Dod, Xin Hu, Marilyn Rego +3 more
6/25/2026
cs.SEcs.AIcs.LO

No confident code implementation found for this paper.

Abstract

Static verification tools can assure industrial scale software, but require significant human labor to write specifications. This is particularly true of static verifiers based on separation logic (SL verifiers), which excel at verifying heapmanipulating programs, but require many complex auxiliary specifications to reason about heap structure.

Show full abstract

Recent work applies large language models (LLMs) to generate code, tests, and proofs, including specifications for verifiers, but mostly targeting non-SL verifiers. To address this gap, this paper thoroughly evaluates how well LLMs perform when prompted to generate specifications for verifying 303 C functions with the SL verifier VeriFast. We explored eight prompting approaches, ten LLMs, and three input types in two stages. Quantitative and qualitative analyses are used to assess the LLM-generated code and specifications for functional behavior, verifiability and errors. The results show that LLMs preserve functional behavior in source code and specifications (both over 91%), but achieve modest verification success (31.4%). Using Gemini 2.5 Pro and providing formal contracts lead to higher success rates in our setting. Moreover, most errors (94%) come from LLMs' mistakes in the domainspecific knowledge of SL verifiers such as VeriFast. These findings provide guidance for optimizing LLM-generated specifications for SL verifiers.

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. Any repos shown below are weak matches — 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{fan2026empirical,
  title  = {An Empirical Study of LLM-Generated Specifications for VeriFast},
  author = {Wen Fan and Minh Tran and Sanya Dod and Xin Hu and Marilyn Rego and Danning Xie and Jenna DiVincenzo and Lin Tan},
  year   = {2026},
  eprint = {2606.26490},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2606.26490v1}
}

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

Discussion