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

Yul 的操作语义

An Operational Semantics for Yul

Vasileios Koutavas, Yu-Yang Lin, Nikos Tzevelekos

AI总结:

本文为 Solidity 中间语言 Yul 给出了大步和小步操作语义,证明二者等价,并实现了一个利用可证明正确优化的小步语义解释器,以支持 Yul 上的验证与符号执行。

摘要:

我们以与编程语言文献一致的数学记号,为 Yul——Solidity 编译器用于生成 EVM 字节码的中间语言——给出了大步和小步操作语义,该记号适用于语言证明,并可作为该语言精确且广泛可用的规范。我们的两种语义忠实于该语言原有的非正式规范,同时也澄清了诸如 void 函数调用等未充分规定的场景。我们的表述方式使我们能够证明两种语义之间的等价性。我们还在一个 Yul 解释器中实现了小步语义,该解释器利用了可证明正确的优化。我们使用来自 Solidity 编译器以及我们自己的测试对该解释器进行了测试。我们预期这项工作将使得能够直接在 Yul 中开发验证和符号执行技术,为以太坊安全生态做出贡献,并有助于开发可证明可靠性的未来类型系统。

英文摘要:

We present a big-step and small-step operational semantics for Yul -- the intermediate language used by the Solidity compiler to produce EVM bytecode -- in a mathematical notation that is congruous with the literature of programming languages, lends itself to language proofs, and can serve as a precise, widely accessible specification for the language. Our two semantics stay faithful to the original, informal specification of the language but also clarify under-specified cases such as void function calls. Our presentation allows us to prove the equivalence between the two semantics. We also implement the small-step semantics in an interpreter for Yul which avails of optimisations that are provably correct. We have tested the interpreter using tests from the Solidity compiler and our own. We envisage that this work will enable the development of verification and symbolic execution technology directly in Yul, contributing to the Ethereum security ecosystem, as well as aid the development of a provably sound future type system.

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

↑