[论文解读] Lolisa: Formal Syntax and Semantics for a Subset of the Solidity Programming Language
Lolisa 为 Solidity 的一个大型子集首次提供了经过机械验证的形式化语法与语义,利用 GERM 框架和执行-验证同构性(EVI),通过更强的静态类型系统提升了类型安全性,支持几乎全部 Solidity 语法结构——包括映射、修饰符、结构体及多返回值——并实现了 Solidity 程序的直接、逐行翻译,且可扩展至其他语言。
This article presents the formal syntax and semantics for a large subset of the Solidity programming language developed for the Etheruem blockchain platform based on our resent work about developing a general, extensible, and reusable formal memory (GERM) framework and an extension of Curry-Howard isomorphism, denoted as execution-verification isomorphism (EVI). This subset is denoted as Lolisa, which, to our knowledge, is the first mechanized and validated formal syntax and semantics developed for Solidity. The formal syntax of Lolisa adopts a stronger static type system than Solidity for enhanced type safety. In addition, Lolisa not only includes nearly all the syntax components of Solidity, such as mapping, modifier, contract, and address types, but it also contains general-purpose programming language features, such as multiple return values, pointer arithmetic, struct, and field access. Therefore, the inherent compatibility of Lolisa allows Solidity programs to be directly translated into Lolisa with a line-by-line correspondence without rebuilding or abstracting, and, in addition, the inherent generality of Lolisa allows it to be extended to express other programming languages as well. To this end, we also present a preliminary scheme for extending Lolisa to other languages systematically.
研究动机与目标
- 为 Solidity 的一个大型子集开发形式化验证的、可机械化的语法与语义,以提升智能合约开发中的正确性与安全性。
- 通过引入强于 Solidity 原生类型系统的更强静态类型系统,提升类型安全性。
- 确保 Solidity 程序可直接、逐行翻译为 Lolisa,无需抽象或重构。
- 建立一个通用基础,可系统性地扩展以形式化其他编程语言。
- 证明可将 GERM 框架与执行-验证同构性(EVI)应用于区块链特定语言(如 Solidity)的可行性。
提出的方法
- 利用 GERM 框架设计 Lolisa 作为 Solidity 的形式化语言子集,以实现可重用且可扩展的形式化内存模型。
- 应用执行-验证同构性(EVI)将程序执行与形式化验证关联,支持机械推理。
- 扩展语法以支持高级特性,如多返回值、指针运算、结构体及字段访问。
- 在 Lolisa 框架内形式化核心 Solidity 构造,包括映射、修饰符、合约定义及地址类型。
- 定义一种系统化方案,基于其形式化基础将 Lolisa 扩展以表达其他编程语言。
- 通过逐行翻译语义确保与 Solidity 的兼容性,且不损失表达能力。
实验结果
研究问题
- RQ1能否为 Solidity 的一个大型子集开发出保持完整语法与语义保真的形式化、可机械化的语义?
- RQ2如何有效应用 GERM 框架与 EVI 来建模 Solidity 中智能合约的执行与验证?
- RQ3Lolisa 的更强静态类型系统相较于原生 Solidity 在多大程度上提升了类型安全性?
- RQ4是否可能在不进行抽象或重构的前提下,实现从 Solidity 到形式化语言的直接、逐行翻译?
- RQ5Lolisa 是否可系统性地扩展以形式化 Solidity 以外的其他编程语言?
主要发现
- Lolisa 是首个为 Solidity 大型子集实现的、经机械验证的形式化语法与语义,实现了完整的正式化,并附带机器可检查的证明。
- 该语言支持几乎所有关键 Solidity 特性,包括映射、修饰符、结构体及多返回值,且与原始语法保持完全一致。
- Lolisa 中更强的静态类型系统显著提升了类型安全性,超越了原生 Solidity 的能力。
- 从 Solidity 到 Lolisa 的直接、逐行翻译在形式上得到支持,可实现与现有 Solidity 代码库的无缝集成。
- Lolisa 的设计允许系统性地扩展以形式化其他编程语言,证明了其通用性与可重用性。
- EVI 与 GERM 框架的应用实现了执行与验证的统一处理,支持对智能合约行为的形式化推理。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。