Lune

ASE2024顶会

LLM Meets Bounded Model Checking: Neuro-symbolic Loop Invariant Inference

Guangyuan Wu, Weining Cao, Yuan Yao, Hengfeng Wei, Taolue Chen, Xiaoxing Ma

摘要

Loop invariant inference, a key component in program verification, is a challenging task due to the inherent undecidability and complex loop behaviors in practice. Recently, machine learning based techniques have demonstrated impressive performance in generating loop invariants automatically. However, these methods highly rely on the labeled training data, and are intrinsically random and uncertain, leading to unstable performance. In this paper, we investigate a synergy of large language models (LLMs) and bounded model checking (BMC) to address these issues. The key observation is that, although LLMs may not be able to return the correct loop invariant in one response, they usually can provide all individual predicates of the correct loop invariant in multiple responses. To this end, we propose a "query-filter-reassemble" strategy, namely, we first leverage the language generation power of LLMs to produce a set of candidate invariants, where training data is not needed. Then, we employ BMC to identify valid predicates from these candidate invariants, which are assembled to produce new candidate invariants and checked by off-the-shelf SMT solvers. The feedback is incorporated into the prompt for the next round of LLM querying. We expand the existing benchmark of 133 programs to 316 programs, providing a more comprehensive testing ground. Experimental results demonstrate that our approach significantly outperforms the state-of-the-art techniques, successfully generating 309 loop invariants out of 316 cases, whereas the existing baseline methods are only able to tackle 219 programs at best. The code is publicly available at https://github.com/SoftWiser-group/LaM4Inv.git .

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 11 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Not All Invariants Are Equal: Curating Training Data to Accelerate Program Verification with SLMs 引用了 Lemur: Integrating Large Language Models in Automated Program Verification
  • Not All Invariants Are Equal: Curating Training Data to Accelerate Program Verification with SLMs 引用了 Can Large Language Models Reason about Program Invariants?
  • Lemur: Integrating Large Language Models in Automated Program Verification 引用了 Can Large Language Models Reason about Program Invariants?
  • Clause2Inv: A Generate-Combine-Check Framework for Loop Invariant Inference 引用了 CLN2INV: Learning Loop Invariants with Continuous Logic Networks
  • A Tale of 1001 LoC: Potential Runtime Error-Guided Specification Synthesis for Verifying Large-Scale Programs 引用了 Lemur: Integrating Large Language Models in Automated Program Verification
  • Let a Neural Network be Your Invariant 引用了 CLN2INV: Learning Loop Invariants with Continuous Logic Networks
  • Let a Neural Network be Your Invariant 引用了 Can Large Language Models Reason about Program Invariants?
  • Can Large Language Models Reason about Program Invariants? 引用了 CLN2INV: Learning Loop Invariants with Continuous Logic Networks
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper11

  1. Let a Neural Network be Your InvariantMirco Giacobbe, Daniel Kroening, Abhinandan Pal, Michael TautschnigNeurIPS 2025 · 6 次引用
  2. Clause2Inv: A Generate-Combine-Check Framework for Loop Invariant InferenceWeining Cao, Guangyuan Wu, Tangzhi Xu, Yuan Yao 等ISSTA 2025 · 2 次引用
  3. Not All Invariants Are Equal: Curating Training Data to Accelerate Program Verification with SLMsIdo Pinto, Yizhak Elboher, Haoze Wu, Nina Narodytska 等ICML 2026 · 1 次引用
  4. SpecMAS: A Multi-Agent System for Self-Verifying System Generation via Formal Model CheckingRishabh Agrawal, Kaushik T. Ranade, Aja Khanal, Kalyan S. Basu 等NeurIPS 2025 · 1 次引用
  5. A Tale of 1001 LoC: Potential Runtime Error-Guided Specification Synthesis for Verifying Large-Scale ProgramsZhongyi Wang, Tengjie Lin, Mingshuai Chen, Haokun Li 等OOPSLA 2026 · 1 次引用

它引用的 Paper12

  1. Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida 等NeurIPS 2022 · 24,707 次引用
  2. Can Large Language Models Reason about Program Invariants?Kexin Pei, David Bieber, Kensen Shi, Charles Sutton 等ICML 2023 · 128 次引用
  3. Validating SMT solvers via semantic fusionDominik Winterer, Chengyu Zhang, Zhendong SuPLDI 2020 · 80 次引用
  4. CLN2INV: Learning Loop Invariants with Continuous Logic NetworksGabriel Ryan, Justin Wong, Jianan Yao, Ronghui Gu 等ICLR 2020 · 72 次引用
  5. Lemur: Integrating Large Language Models in Automated Program VerificationHaoze Wu, Clark W. Barrett, Nina NarodytskaICLR 2024 · 67 次引用

相关 Paper

  1. LLM-Generated Invariants for Bounded Model Checking Without Loop UnrollingMuhammad A. A. Pirzada, Giles Reger, Ahmed Bhayat, Lucas C. CordeiroASE 2024 · 7 次引用
  2. Ranking LLM-Generated Loop Invariants for Program VerificationSaikat Chakraborty, Shuvendu K. Lahiri, Sarah Fakhoury, Akash Lal 等EMNLP Findings 2023 · 36 次引用
  3. Enchanting Program Specification Synthesis by Large Language Models Using Static Analysis and Program VerificationCheng Wen, Jialun Cao, Jie Su, Zhiwu Xu 等CAV 2024 · 60 次引用
  4. Loop Invariant Inference through SMT Solving Enhanced Reinforcement LearningShiwen Yu, Ting Wang, Ji WangISSTA 2023 · 11 次引用
  5. LLM-Guided Loop Bound Generation for Program Termination VerificationZan Gong, Biting Huang, Fei HeICML 2026
黄昏的海面,两侧是细线勾勒的悬崖