BALI: 基于分支的循环不变式推断与大语言模型
BALI: Branch-Aware Loop Invariant Inference with Large Language Models
AI总结:
BALI通过结合大语言模型和分支感知分析,提升循环不变式的推断和验证精度,实现更高效和自动化的不变式发现。
摘要:
循环不变式是验证迭代算法正确性的基础。然而,推导合适的不变式仍是一个具有挑战性且常需手动完成的任务,尤其是在复杂程序中。在本文中,我们引入了BALI,一种结合大语言模型(LLMs)的分支感知框架,以增强循环不变式的推断和验证。我们的方法结合了自动推理与分支感知的静态程序分析,以提高精度和可扩展性。具体而言,与以往仅依赖LLM的猜测和检查方法不同,BALI首先使用SMT验证分支序列级(路径级)子句,然后将它们组合成程序级的不变式。我们概述了其关键组件,展示了初步结果,并讨论了未来方向,以实现完全自动化的不变式发现。
英文摘要:
Loop invariants are fundamental for reasoning about the correctness of iterative algorithms. However, deriving suitable invariants remains a challenging and often manual task, particularly for complex programs. In this paper, we introduce BALI, a branch-aware framework that integrates large language models (LLMs) to enhance the inference and verification of loop invariants. Our approach combines automated reasoning with branch-aware static program analysis to improve both precision and scalability. Specifically, unlike prior LLM-only guess-and-check methods, BALI first verifies branch-sequence-level (path-level) clauses with SMT and then composes them into program-level invariants. We outline its key components, present preliminary results, and discuss future directions toward fully automated invariant discovery.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。