Verifying LLM-Generated Code in the Context of Software Verification with Ada/SPARK

Marcos Cramer, Lucian McIntyre
2/11/2025
cs.SEcs.AI

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

Large language models (LLMs) have demonstrated remarkable code generation capabilities, but the correctness of the generated code cannot be inherently trusted. This paper explores the feasibility of using formal software verification, specifically the SPARK framework for Ada, to ensure the reliability of LLM-generated code. We present Marmaragan, a tool that leverages an LLM in order to generate SPARK annotations for existing programs, enabling formal verification of the code. The tool is benchmarked on a curated set of SPARK programs, with annotations selectively removed to test specific capabilities. The performance of Marmaragan with GPT-4o on the benchmark is promising, with correct annotations having been generated for 50.7% of the benchmark cases. The results establish a foundation for future work on combining the power of LLMs with the reliability of formal software 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. 1 weaker match is 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{cramer2025verifying,
  title  = {Verifying LLM-Generated Code in the Context of Software Verification with Ada/SPARK},
  author = {Marcos Cramer and Lucian McIntyre},
  year   = {2025},
  eprint = {2502.07728},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.07728v1}
}

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

Discussion