[论文解读] Hyper Hoare Logic: (Dis-)Proving Program Hyperproperties (extended version)
本文提出了超霍雷逻辑(Hyper Hoare Logic),这是一种新型程序逻辑,通过允许断言对任意程序状态集合进行推理,从而在传统霍雷逻辑的基础上进行推广,使同一形式系统内既能证明超性质(如非干扰性),也能反证性质(如错误的存在性)。其主要贡献在于提出了一套可靠且完备的逻辑体系,能够捕捉复杂的轨迹与超性质,包括以往霍雷逻辑无法触及的性质,并在Isabelle/HOL中建立了形式化证明。
Hoare logics are proof systems that allow one to formally establish properties of computer programs. Traditional Hoare logics prove properties of individual program executions (such as functional correctness). Hoare logic has been generalized to prove also properties of multiple executions of a program (so-called hyperproperties, such as determinism or non-interference). These program logics prove the absence of (bad combinations of) executions. On the other hand, program logics similar to Hoare logic have been proposed to disprove program properties (e.g., Incorrectness Logic), by proving the existence of (bad combinations of) executions. All of these logics have in common that they specify program properties using assertions over a fixed number of states, for instance, a single pre- and post-state for functional properties or pairs of pre- and post-states for non-interference. In this paper, we present Hyper Hoare Logic, a generalization of Hoare logic that lifts assertions to properties of arbitrary sets of states. The resulting logic is simple yet expressive: its judgments can express arbitrary program hyperproperties, a particular class of hyperproperties over the set of terminating executions of a program (including properties of individual program executions). By allowing assertions to reason about sets of states, Hyper Hoare Logic can reason about both the absence and the existence of (combinations of) executions, and, thereby, supports both proving and disproving program (hyper-)properties within the same logic, including (hyper-)properties that no existing Hoare logic can express. We prove that Hyper Hoare Logic is sound and complete, and demonstrate that it captures important proof principles naturally. All our technical results have been proved in Isabelle/HOL.
研究动机与目标
- 为解决传统霍雷逻辑仅能证明不良执行组合不存在的局限性,通过支持对这类组合存在性的推理,实现改进。
- 在单一逻辑中统一证明与反证能力,克服过度近似(超安全性)与不足近似(错误性)推理之间的二元对立。
- 将断言从单个或固定大小的状态元组推广至任意状态集合,从而表达涉及未定数量或可变数量执行的复杂超性质。
- 证明该逻辑对终止程序的所有超性质的表达与验证均具备可靠性和完备性。
- 通过表明关键证明原则(如对分支的同步推理)可自然编码,为实用验证工具提供基础。
提出的方法
- 将标准霍雷逻辑的判断形式扩展,允许前提与后置条件为对任意状态集合的断言,而非固定大小的状态元组。
- 引入一种广义判断形式,将程序命令与初始状态集和最终状态集之间的关系关联,通过基于集合的断言表达。
- 定义一类新断言,使用张量积算子(例如 $A igotimes_{x=1,2} B$)实现对不同分支中状态不相交子集的同步推理。
- 设计一种同步推理规则,允许并行推理两个不同程序分支,利用结构相似性提升证明的模块化程度。
- 通过在Isabelle/HOL中的形式化,证明该逻辑的可靠性和完备性,确保所有判断在逻辑上有效,且所有有效超性质均可推导得出。
- 通过在同一逻辑框架下编码复杂超性质(如确定性、非干扰性及错误存在性)证明其表达能力。
实验结果
研究问题
- RQ1单一程序逻辑能否同时表达程序执行组合的缺失与存在,包括错误与非确定性?
- RQ2对任意状态集合的断言能否捕捉所有轨迹与超性质,包括涉及未定数量执行的性质?
- RQ3能否设计一种霍雷风格逻辑,支持对程序不同分支的同步推理,即使这些分支结构相似但不完全相同?
- RQ4该逻辑能否对所有终止程序的超性质均具备可靠性和完备性?
- RQ5现有证明原则(如关系推理或错误性推理)能否自然地嵌入统一框架中?
主要发现
- 超霍雷逻辑对所有终止程序的超性质均具备可靠性和完备性,为执行集合的推理奠定了基础性结果。
- 该逻辑能够表达并验证任何先前霍雷逻辑无法处理的超性质,包括涉及不良执行组合存在的性质,如运行时错误或非确定性。
- 同步推理规则通过允许对结构相似但不同的分支并行推理,提升了具有分支结构程序的模块化验证效率。
- 在Isabelle/HOL中对逻辑及其元理论的正式化确保了正确性,并为工具集成与进一步验证工具开发提供了基础。
- 该逻辑涵盖了现有方法:它在统一框架内支持过度近似推理(如非干扰性)、不足近似推理(如错误检测)以及混合推理。
- 本文证明了对状态集合的推理足以捕捉所有超性质,如完备性定理(定理10)所示,证实了该方法的表达能力。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。