Table of Contents
Fetching ...

A Tale of 1001 LoC: Potential Runtime Error-Guided Specification Synthesis for Verifying Large-Scale Programs

Zhongyi Wang, Tengjie Lin, Mingshuai Chen, Haokun Li, Mingqi Yang, Xiao Yi, Shengchao Qin, Yixing Luo, Xiaofeng Li, Bin Gu, Liqiang Lu, Jianwei Yin

TL;DR

It is shown that Preguss substantially outperforms state-of-the-art LLM-based approaches and, in particular, it enables highly automated RTE-freeness verification for real-world programs with over a thousand LoC, with a reduction of 80.6%~88.9% human verification effort.

Abstract

Fully automated verification of large-scale software and hardware systems is arguably the holy grail of formal methods. Large language models (LLMs) have recently demonstrated their potential for enhancing the degree of automation in formal verification by, e.g., generating formal specifications as essential to deductive verification, yet exhibit poor scalability due to long-context reasoning limitations and, more importantly, the difficulty of inferring complex, interprocedural specifications. This paper presents Preguss -- a modular, fine-grained framework for automating the generation and refinement of formal specifications. Preguss synergizes between static analysis and deductive verification by steering two components in a divide-and-conquer fashion: (i) potential runtime error-guided construction and prioritization of verification units, and (ii) LLM-aided synthesis of interprocedural specifications at the unit level. We show that Preguss substantially outperforms state-of-the-art LLM-based approaches and, in particular, it enables highly automated RTE-freeness verification for real-world programs with over a thousand LoC, with a reduction of 80.6%~88.9% human verification effort.

A Tale of 1001 LoC: Potential Runtime Error-Guided Specification Synthesis for Verifying Large-Scale Programs

TL;DR

It is shown that Preguss substantially outperforms state-of-the-art LLM-based approaches and, in particular, it enables highly automated RTE-freeness verification for real-world programs with over a thousand LoC, with a reduction of 80.6%~88.9% human verification effort.

Abstract

Fully automated verification of large-scale software and hardware systems is arguably the holy grail of formal methods. Large language models (LLMs) have recently demonstrated their potential for enhancing the degree of automation in formal verification by, e.g., generating formal specifications as essential to deductive verification, yet exhibit poor scalability due to long-context reasoning limitations and, more importantly, the difficulty of inferring complex, interprocedural specifications. This paper presents Preguss -- a modular, fine-grained framework for automating the generation and refinement of formal specifications. Preguss synergizes between static analysis and deductive verification by steering two components in a divide-and-conquer fashion: (i) potential runtime error-guided construction and prioritization of verification units, and (ii) LLM-aided synthesis of interprocedural specifications at the unit level. We show that Preguss substantially outperforms state-of-the-art LLM-based approaches and, in particular, it enables highly automated RTE-freeness verification for real-world programs with over a thousand LoC, with a reduction of 80.6%~88.9% human verification effort.
Paper Structure (46 sections, 8 theorems, 13 equations, 13 figures, 2 tables, 1 algorithm)

This paper contains 46 sections, 8 theorems, 13 equations, 13 figures, 2 tables, 1 algorithm.

Key Result

Theorem 11

Suppose $\textit{prog}$ is free-of-RTE under hypotheses $\mathcal{H}$ as per eq:free-RTE-hypo. If every $h \in \mathcal{H}$ is valid, i.e., $\models h$, then $\textit{prog}$ is free-of-RTE in the sense of eq:free-RTE.

Figures (13)

  • Figure 1: Potential RTE-guided verification process (a)(b)(c) v.s. unguided verification (a)(d).
  • Figure 2: The dual role of interprocedural specifications: postconditions can help discharge false RTEs (c) while over-constrained preconditions can induce false alarms (d).
  • Figure 3: Handcrafting missing specifications via verifier feedback (e.g., proof obligations) for validating $p_7$.
  • Figure 4: Divide-and-conquer architecture of the Preguss framework.
  • Figure 5: The call graph (a) and V-Unit queue (b) of program id.c in \ref{['fig-2:dependencies-spec-property']}.
  • ...and 8 more figures

Theorems & Definitions (29)

  • Example 1
  • Example 2
  • Definition 3: Trace and Subtrace
  • Example 4
  • Definition 5: Trace Reachability and Satisfaction
  • Example 6
  • Definition 7: Property Validity under Hypotheses
  • Example 8
  • Definition 9: Sound Verifier
  • Definition 10: RTE-Freeness
  • ...and 19 more