Kleene algebra with tests (KAT) is a foundational equational framework for reasoning about programs, which has found applications in program transformations, networking and compiler optimizations, among many other areas. In his seminal work, Kozen proved that KAT subsumes propositional Hoare logic, showing that one can reason about the (partial) correctness of while programs by means of the equational theory of KAT. In this work, we investigate the support that KAT provides for reasoning about \emph{incorrectness}, instead, as embodied by Ohearn's recently proposed incorrectness logic. We show that KAT cannot directly express incorrectness logic. The main reason for this limitation can be traced to the fact that KAT cannot express explicitly the notion of codomain, which is essential to express incorrectness triples. To address this issue, we study Kleene algebra with Top and Tests (TopKAT), an extension of KAT with a top element. We show that TopKAT is powerful enough to express a codomain operation, to express incorrectness triples, and to prove all the rules of incorrectness logic sound. This shows that one can reason about the incorrectness of while-like programs by means of the equational theory of TopKAT.
翻译:Kleene 代数与测试( KAT) 是程序推理的基础方程框架, 它发现程序转换、 网络和编译优化等许多领域的应用。 Kozen 在他的开创性工作中, Kozen 证明了KAT 的子虚构的Hoare 逻辑, 表明人们可以通过 KAT 的方程式理论来解释程序( 部分) 的正确性。 在这项工作中, 我们调查 KAT 提供的关于\ emph{ ins 更正的推理的支持, 而正如 Ohearn 最近提出的不正确逻辑所体现的那样。 我们显示, KAT 不能直接表达不正确性逻辑。 这种限制的主要原因可以追溯到 KAT 无法明确表达 Codomain 的概念, 这对于表达不正确性至关重要。 为了解决这个问题, 我们用Top and Test (TopKAT) 的扩展来研究 Kleenegebra 。 我们显示TopKAT 具有足够的力量来表达 Codomain 操作, 表达不正确性三进度, 并同时证明最高逻辑原理的正确性, 能够证明最高逻辑原理。