一句话:提出超 Hoare 逻辑,将断言提升到状态集合,可在同一逻辑中证明和反证程序超性质。
传统 Hoare 逻辑证明单次执行的性质,超性质 Hoare 逻辑可证明多次执行的性质(如非干涉),但只能证明不良执行组合不存在;类似 Incorrectness Logic 的逻辑则证明其存在,且均用固定数量状态上的断言规约性质。本文提出超 Hoare 逻辑,将断言提升为任意状态集合的性质,判断可表达程序终止执行集合上的任意超性质,既涵盖单执行性质,也能同时推理执行组合的不存在与存在,从而在同一逻辑中证明和反证程序超性质,包括既有逻辑无法表达的性质。作者证明该逻辑可靠且完备,展示其自然捕获重要证明原则,并在 Isabelle/HOL 中机器化验证全部结果。
Hoare logics are proof systems that allowone 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.
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@article{abs-2301-10037,
title = {Hyper Hoare Logic: (Dis-)Proving Program Hyperproperties},
author = {Thibault Dardinier and Peter Müller},
journal = {Proceedings of the ACM on Programming Languages},
volume = {8},
number = {PLDI},
year = {2024},
doi = {10.1145/3656437}
}