# LLM-generated ACSL contracts for numerical libraries

Digest AI · Research · published 2026-09-29T04:00:00Z

Canonical: https://digestai.news/story/llm-generated-acsl-contracts-for-numerical-libraries

## Summary

A new approach uses large language models (LLMs) to automatically generate a small, human-certifiable Automated C Specification Language (ACSL) contract from function documentation. This combined with a deterministic toolchain that supports a restricted ACSL profile and generates a driver using the CIVL verifier checks the implementation against the contract and an existing reference model. The pipeline was demonstrated on three PETSc functions: MatAXPY, MatAYPX, and the non-compressing mode of MatFilter. This approach discovered a previously undiscovered bug in MatAYPX that has been present since 1997.

## Key points

- LLM-generated ACSL contracts for numerical libraries
- Demonstrated on three PETSc functions: MatAXPY, MatAYPX, and non-compressing mode of MatFilter
- Discovered a previously undiscovered bug in MatAYPX since 1997

## Why it matters

This approach could potentially automate the process of generating ACSL contracts for numerical libraries, which can help reduce bugs and improve the reliability of scientific applications.

## Sources

1. [Verification of PETSc with CIVL using LLM-generated ACSL contracts and deterministic driver generation](https://arxiv.org/abs/2609.31687) (arXiv cs.CL, 2026-09-29, primary source)

## Cite

Digest AI, "LLM-generated ACSL contracts for numerical libraries", 29 September 2026, https://digestai.news/story/llm-generated-acsl-contracts-for-numerical-libraries

---

Written by Digest AI's editorial model from the linked sources; the sources are the record. Headlines, digests and key points are written by Digest AI and may be quoted with a link to the story page. Linked articles belong to their publishers. Terms: https://digestai.news/terms#reuse
JSON: https://digestai.news/story/llm-generated-acsl-contracts-for-numerical-libraries.json
