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

面向资源操作程序的资源规约

Resource Specifications for Resource-Manipulating Programs

Zachary Grannan, Alexander J. Summers

AI总结:

针对资源操作程序经典规约冗长难用的问题,提出支持用户定义一等资源的验证方法,扩展Prusti验证器,验证智能合约与区块链应用,证明规约更简洁易用。

摘要:

模块化程序验证器的规约以程序状态约束(如前置条件)和程序状态关系(如后置条件)的形式表达。对于以管理各类资源(如加密货币)为核心功能的程序而言,这类基于状态的规约必须将人类可天然默认理解的性质显式声明。例如,向银行账户存款不会改变其他账户余额是显而易见的,但在经典方法中这必须被表述为框架条件。因此,资源操作程序的经典规约很快会变得冗长,难以解读、编写和调试。\n本文提出了一种新方法,对模块化程序验证器进行扩展以支持用户定义的一等资源,使得资源相关的操作和性质可被直接表达,消除了在规约中具象化隐含知识的需求。我们将该方法实现为程序验证器Prusti的扩展,并用它验证了真实世界的智能合约以及一个区块链应用的关键部分。我们的评估表明,使用该方法编写的规约比纯基于程序状态编写的规约更简洁,且显著更简单。

英文摘要:

Specifications for modular program verifiers are expressed as constraints on program states (e.g. preconditions) and relations on program states (e.g. postconditions). For programs whose domain is managing resources of any kind (e.g. cryptocurrencies), such state-based specifications must make explicit properties that a human would implicitly understand for free. For example, it's clear that depositing into your bank account will not change other balances, but classically this must be stated as a frame condition. As a result, classical specifications for resource-manipulating programs quickly become verbose and difficult to interpret, write and debug. In this paper, we present a novel methodology that extends a modular program verifier to support user-defined first-class resources, allowing resource-related operations and properties to be expressed directly and eliminating the need to reify implicit knowledge in the specifications. We implement our methodology as an extension of the program verifier Prusti, and use it to verify real-world smart contracts and a key part of a blockchain application. Our evaluation demonstrates that specifications written with our methodology are more concise and substantially simpler than specifications written purely in terms of program states.

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

↑