Program logics for bug-finding (such as the recently introduced Incorrectness Logic) have framed correctness and incorrectness as dual concepts requiring different logical foundations. In this paper, we argue that a single unified theory can be used for both correctness and incorrectness reasoning. We present Outcome Logic (OL), a novel generalization of Hoare Logic that is both monadic (to capture computational effects) and monoidal (to reason about outcomes and reachability). OL expresses true positive bugs, while retaining correctness reasoning abilities as well. To formalize the applicability of OL to both correctness and incorrectness, we prove that any false OL specification can be disproven in OL itself. We also use our framework to reason about new types of incorrectness in nondeterministic and probabilistic programs. Given these advances, we advocate for OL as a new foundational theory of correctness and incorrectness.
翻译:错误调查的程序逻辑(例如最近引入的错误逻辑)将正确性和不正确性描述为需要不同逻辑基础的双重概念。 在本文中,我们主张,一个单一的统一理论可以用于正确性和不正确性推理。我们提出了结果逻辑(OL),这是Hoare逻辑的一种新的普遍化,它既是月经(以捕捉计算效果),也是单相向(以计算结果和可达性为根据)。OL表示真正的正错误,同时保留正确性推理能力。为了正式确定OL对正确性和不正确性的适用性,我们证明任何错误的OL规格都可以在OL本身中解脱。我们还利用我们的框架来解释非确定性和概率性方案的新类型的不正确性。鉴于这些进步,我们主张OL是正确性和不正确性的新基础理论。</s>