arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.31389cs.PLcs.CR
收藏

Neuroforger: 通过大语言模型为智能合约验证生成认证违规见证

Neuroforger: certified violation witnesses for smart contracts verification via LLMs

University of Cagliari(卡利亚里大学)

Massimo Bartoletti, Enrico Lipparini

AI总结:

针对自然语言属性歧义和LLM回答无正确性保证的问题,提出一种结合LLM、类型检查和具体执行的工作流,通过引入扩展Solidity的抽象类型形式规范语言,生成并验证违规见证(反例)。

摘要:

近期的大语言模型(LLMs)具备了推理能力,使其在预测智能合约是否遵守特定属性方面表现良好,这为传统基于形式化方法的智能合约验证提供了一种补充途径。然而,LLMs在此类场景中的应用存在两个主要问题:1)用自然语言表达的属性本质上是模糊的;2)LLMs返回的答案没有正确性保证。在本文中,我们通过以下方式同时解决了这两个问题:1)引入一种新的形式规范语言,该语言通过抽象类型扩展了Solidity;2)设计了一个工作流,将LLMs与类型检查和具体执行相结合,以生成并验证违规见证(即反例)。关键思想是将规范表示为带有(存在量化)抽象类型变量的Solidity测试;将这些变量实例化为具体值(正确类型)将测试具体化为目标属性的可执行反例(PoC)。我们在工具Neuroforger中实现了该流程,并在从文献中提取的智能合约验证数据集上进行了实验评估,获得了有希望的结果,证明了其在现实场景中的潜在适用性。

英文摘要:

Recent large language models (LLMs) incorporate reasoning capabilities that allow them to perform well in predicting whether a smart contract respects a certain property, suggesting a complementary approach to traditional formal-methods-based techniques for smart contract verification. However, the application of LLMs in such context has two major issues: 1) properties expressed in natural language are intrinsically ambiguous, and 2) answers returned by LLMs have no guarantee of correctness. In this paper, we address both issues simultaneously by: 1) introducing a new formal specification language that extends Solidity with abstract types, and 2) designing a workflow that combines LLMs with type checking and concrete execution to generate and validate violation witnesses (i.e., counterexamples). The key idea is to represent a specification as a Solidity test with (existentially quantified) variables of abstract type; finding an instantiation of these variables to concrete values (of the correct type) concretizes the test into an executable counterexample (PoC) for the target property. We implemented our procedure in the tool Neuroforger, experimentally evaluating it on a smart-contract verification dataset drawn from literature, obtaining promising results that demonstrate its potential applicability in the wild.

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

↑