[Paper Review] Hyper Hoare Logic: (Dis-)Proving Program Hyperproperties (extended version)
This paper introduces Hyper Hoare Logic, a novel program logic that generalizes traditional Hoare logic by allowing assertions to reason about arbitrary sets of program states, enabling both the proving of hyperproperties (e.g., non-interference) and the disproof of properties (e.g., existence of bugs) within a single formal system. The key contribution is a sound and complete logic that captures complex trace and hyperproperties, including those beyond the reach of prior Hoare logics, with formal proofs established in 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.
Motivation & Objective
- To address the limitation of traditional Hoare logics, which can only prove the absence of bad execution combinations, by enabling reasoning about the existence of such combinations.
- To unify proving and disproving capabilities within a single logic, overcoming the dichotomy between overapproximate (hypersafety) and underapproximate (incorrectness) reasoning.
- To generalize assertions from single or fixed-size state tuples to arbitrary sets of states, enabling expression of complex hyperproperties, including those involving unbounded or variable numbers of executions.
- To demonstrate that the logic is both sound and complete for expressing and verifying arbitrary hyperproperties of terminating programs.
- To provide a foundation for practical verification tools by showing that key proof principles—such as synchronous reasoning over branches—can be naturally encoded.
Proposed method
- Extends standard Hoare logic judgments to allow pre- and post-conditions that are assertions over arbitrary sets of program states, rather than fixed-size tuples of states.
- Introduces a generalized judgment form where a program command is associated with a relation between sets of initial and final states, expressed via set-based assertions.
- Defines a new class of assertions using a tensor product operator (e.g., $A igotimes_{x=1,2} B$) to reason about disjoint subsets of states in a synchronized manner across different branches.
- Develops a synchronous reasoning rule that allows reasoning about two different program branches in parallel, exploiting structural similarity to improve proof modularity.
- Proves soundness and completeness of the logic using formalization in Isabelle/HOL, ensuring that all judgments are logically valid and that all valid hyperproperties are derivable.
- Demonstrates expressivity by encoding complex hyperproperties such as determinism, non-interference, and the presence of bugs using the same logical framework.
Experimental results
Research questions
- RQ1Can a single program logic express both the absence and existence of combinations of program executions, including bugs and non-determinism?
- RQ2Can assertions over arbitrary sets of states capture all trace and hyperproperties, including those involving unbounded numbers of executions?
- RQ3Is it possible to design a Hoare-style logic that supports synchronous reasoning over different branches of a program, even when the branches are structurally similar but not identical?
- RQ4Can such a logic be both sound and complete for all hyperproperties of terminating programs?
- RQ5How can existing proof principles—such as those for relational reasoning or incorrectness—be naturally embedded within a unified framework?
Key findings
- Hyper Hoare Logic is sound and complete for all hyperproperties of terminating programs, establishing a foundational result for reasoning about sets of executions.
- The logic can express and verify hyperproperties that no prior Hoare logic can, including properties involving the existence of bad execution combinations, such as the presence of a runtime error or non-determinism.
- The synchronous reasoning rule enables modular verification of programs with branching structures by allowing parallel reasoning over similar but distinct branches, improving proof efficiency.
- The formalization of the logic and its metatheory in Isabelle/HOL ensures correctness and provides a basis for tool integration and further verification tool development.
- The logic subsumes existing approaches: it supports overapproximate reasoning (e.g., for non-interference), underapproximate reasoning (e.g., for bug detection), and hybrid reasoning, all within one uniform framework.
- The paper demonstrates that reasoning about sets of states is sufficient to capture all hyperproperties, as shown by the completeness theorem (Theorem 10), which confirms the expressive power of the approach.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.