arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2602.00715cs.SE
收藏

超越基本规范?基于LLM的规范生成中逻辑构造的系统研究

Beyond Basic Specifications? A Systematic Study of Logical Constructs in LLM-based Specification Generation

School of Computer Science and Technology, Xidian University(西安电子科技大学计算机科学与技术学院);National Key Laboratory of Science and Technology on Information System Security, AMS(信息系统安全国家重点实验室,AMS);Unit 32092 of PLA(中国人民解放军第32092部队);School of Cyber Engineering, Xidian University(西安电子科技大学网络空间安全学院);Systems Engineering Institute, AMS(系统工程研究院,AMS)

Zehan Chen, Long Zhang, Zhiwei Zhang, JingJing Zhang, Ruoyu Zhou, Yulong Shen, JianFeng Ma, Lin Yang

AI总结:

本文研究了基于LLM的规范生成中逻辑构造的应用,通过实验证明LLMs能生成有效逻辑构造,并提升验证能力与鲁棒性。

摘要:

形式化规范在准确描述程序行为和确保软件正确性中起着关键作用。近年来,利用大型语言模型(LLMs)自动生成程序规范已成为提高验证效率的一种有前途的途径。然而,现有研究大多局限于基于基本语法构造生成规范,未能满足复杂程序验证对高层抽象的需求。因此,我们提出将逻辑构造纳入现有的基于LLM的规范生成框架中。然而,目前缺乏系统性研究来探讨LLMs是否能有效生成此类复杂构造。为此,我们开展了一项实证研究,旨在探索各种语法构造对规范生成框架的影响。具体而言,我们定义了四种具有不同抽象层次的语法配置,并对主流程序验证数据集进行了广泛评估,使用了多种代表性LLMs。实验结果首先证实LLMs能够生成有效的逻辑构造。进一步分析表明,逻辑构造与基本语法构造的协同使用在验证能力和鲁棒性上带来了提升,而不会显著增加验证开销。此外,我们还发现了两种细化范式的独特优势。据我们所知,这是首次系统性研究探讨利用LLMs生成高层逻辑构造的可行性,为未来具有增强抽象能力的自动程序验证框架的建设提供了实证基础和指导。

英文摘要:

Formal specifications play a pivotal role in accurately characterizing program behaviors and ensuring software correctness. In recent years, leveraging large language models (LLMs) for the automatic generation of program specifications has emerged as a promising avenue for enhancing verification efficiency. However, existing research has been predominantly confined to generating specifications based on basic syntactic constructs, falling short of meeting the demands for high-level abstraction in complex program verification. Consequently, we propose incorporating logical constructs into existing LLM-based specification generation framework. Nevertheless, there remains a lack of systematic investigation into whether LLMs can effectively generate such complex constructs. To this end, we conduct an empirical study aimed at exploring the impact of various types of syntactic constructs on specification generation framework. Specifically, we define four syntactic configurations with varying levels of abstraction and perform extensive evaluations on mainstream program verification datasets, employing a diverse set of representative LLMs. Experimental results first confirm that LLMs are capable of generating valid logical constructs. Further analysis reveals that the synergistic use of logical constructs and basic syntactic constructs leads to improvements in both verification capability and robustness, without significantly increasing verification overhead. Additionally, we uncover the distinct advantages of two refinement paradigms. To the best of our knowledge, this is the first systematic work exploring the feasibility of utilizing LLMs for generating high-level logical constructs, providing an empirical basis and guidance for the future construction of automated program verification framework with enhanced abstraction capabilities.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑