arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2411.02318cs.SEcs.AIcs.LOcs.PL
收藏

评估大语言模型在 VeriFast 中生成可验证规范的能力

Evaluating the Ability of Large Language Models to Generate Verifiable Specifications in VeriFast

Purdue University(普渡大学);University of Michigan - Ann Arbor(密歇根大学安娜堡分校)

Wen Fan, Marilyn Rego, Xin Hu, Sanya Dod, Zhaorui Ni, Danning Xie, Jenna DiVincenzo, Lin Tan

AI总结:

本文评估 GPT-4o 为 C 程序生成可由基于分离逻辑的 VeriFast 验证的规范的能力,发现其规范能保持功能行为但可验证性差且存在冗余,并探讨了改进方向。

摘要:

静态验证是提升软件质量的一种强有力方法,但它需要大量的人力与资源投入。对于使用所有权逻辑来推理堆操作程序的静态验证器而言,这一点尤为突出。大语言模型(LLM)已在多项软件工程活动中展现出潜力,包括代码生成、测试生成、面向定理证明器的证明生成,以及面向静态验证器的规范生成。然而,此前的工作尚未探索大语言模型在基于所有权逻辑(如分离逻辑)的规范生成方面表现如何。为填补这一空白,本文探究了 OpenAI 的 GPT-4o 模型在为 C 程序生成可由 VeriFast(一种基于分离逻辑的静态验证器)验证的规范方面的有效性。我们的实验采用三种不同类型的用户输入,并结合基础提示和思维链(CoT)提示来评估 GPT 的能力。结果表明,GPT-4o 生成的规范能够保持功能行为,但难以做到可验证。当规范可验证时,其中又包含冗余内容。本文还讨论了未来改进性能的研究方向。

英文摘要:

Static verification is a powerful method for enhancing software quality, but it demands significant human labor and resources. This is particularly true of static verifiers that reason about heap manipulating programs using an ownership logic. LLMs have shown promise in a number of software engineering activities, including code generation, test generation, proof generation for theorem provers, and specification generation for static verifiers. However, prior work has not explored how well LLMs can perform specification generation for specifications based in an ownership logic, such as separation logic. To address this gap, this paper explores OpenAI's GPT-4o model's effectiveness in generating specifications on C programs that are verifiable with VeriFast, a separation logic based static verifier. Our experiment employs three different types of user inputs as well as basic and Chain-of-Thought (CoT) prompting to assess GPT's capabilities. Our results indicate that the specifications generated by GPT-4o preserve functional behavior, but struggle to be verifiable. When the specifications are verifiable they contain redundancies. Future directions are discussed to improve the performance.

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

↑