ZICQ
中 Log in / Sign up
Newsroom Research & Papers #LLMs & Foundation Models #Formal Verification #PETSc #Automated Verification #CIVL

ArXiv Proposes LLM-based Formal Verification for PETSc, Uncovering a 1997 Bug

Avatar of Mr.Xu

By Mr.Xu Compiled & Reviewed by Editorial

Published: · 8 views

中文阅读 (Chinese) English Version
Co-reading Select any sentence in the article to highlight, annotate, or copy a quote card. Join discussion ↓

Summary:ArXiv presents a novel approach for formal verification of the PETSc numerical library using Large Language Models (LLMs). The method generates human-certifiable ACSL contracts from function documentation and employs a deterministic toolchain with the CIVL verifier to check implementations against these contracts and existing reference models. Applied to three PETSc functions, the pipeline successfully identified a previously undiscovered bug in the MatAYPX function, highlighting the potential o


Background

PETSc (Portable, Extensible Toolkit for Scientific Computation) is a widely-used parallel numerical library crucial for scientific and engineering applications. However, formal verification of numerical libraries is rare due to the need for expert-written specifications and manual application of verification tools, which is time-consuming and error-prone.

Methodology

This research proposes an LLM-based automated verification approach with the following steps:

  1. ACSL Contract Generation: LLM generates human-certifiable ACSL contracts from function documentation.
  2. Deterministic Toolchain: A deterministic toolchain supporting a restricted ACSL profile generates a driver for verifying the implementation.
  3. CIVL Verifier: The CIVL verifier checks the implementation against the contracts and existing reference models.

Results

The study demonstrated the pipeline on three PETSc functions:

  • MatAXPY: With an existing reference model, verification was successful.
  • MatAYPX: Without a reference model, the LLM-generated contract served as the sole standard, leading to the discovery of a bug present since 1997.
  • MatFilter (Non-compressing mode): Without a reference model and with complex behavior, verification was successful.

Technical Highlights

  • Innovative LLM Application: The first application of LLMs in formal verification of numerical libraries, showcasing their potential in automating the generation of verification specifications.
  • Automated Toolchain: The combination of a deterministic toolchain and CIVL verifier enables an efficient automated verification process.
  • Bug Discovery: Successfully identified a bug present since 1997, demonstrating the method's effectiveness.

Industry Impact

This research offers a new approach to the formal verification of numerical libraries, potentially enhancing the reliability and safety of scientific computing software. The application of LLMs also provides a reference for automated verification in other domains.

Developer Recommendations

  • Explore LLM Applications in Verification: Developers can experiment with applying LLMs to automated verification tasks in other fields.
  • Focus on Toolchain Improvements: As LLM technology advances, the efficiency and accuracy of the verification toolchain will further improve.
  • Promote Interdisciplinary Collaboration: Combining knowledge from computer science and mathematics to drive the development of formal verification techniques.

Source: ArXiv NLP/LLM (cs.CL) (2026-09-30)

— END —

Tags: #LLMs & Foundation Models #Formal Verification #PETSc #Automated Verification #CIVL

Editorial & Fact-Checking Note: This article is compiled from primary research, official release documentation, and source papers by the ZICQ Newsroom pipeline with automated entity verification and human editorial review. If you notice any technical inaccuracy, please submit a correction via our corrections policy or email our editorial desk directly.

What's your take on this story?
🚀 Explore & Submit Works

Community Comments

Loading live comments and annotations…