论文标题
分级Hoare逻辑及其分类语义
Graded Hoare Logic and its Categorical Semantics
论文作者
论文摘要
基于程序逻辑(即弗洛伊德 - 霍尔逻辑家族)的演绎验证技术是程序推理的强大方法。最近,通过使用其他信息来推理程序副作用,从而提高了这种逻辑的表达能力的趋势。例如,通过成本分析对一般程序逻辑进行了增强,概率计算的逻辑已通过估计措施增强,并具有差异性隐私的逻辑,并具有无法区分的性范围。在这项工作中,我们通过分级的范式统一了这些各种方法,该方法是根据功能计算和语义的世界改编而成的。我们提出了分级Hoare Logic(GHL),这是一个可通过预分析单体分析来增强程序逻辑的参数框架。我们开发了一个用于建模GHL的语义框架,使得分级,逻辑主张(前后条件和后条件)以及命令式语言的基本有效语义可以集成在一起。我们框架的核心是我们在此处扩展的分级类别的概念,引入了分级的弗雷德类别,这些类别提供了一种语义,可以解释文献中增强程序逻辑的许多示例。我们利用相干纤维化来对基本断言语言进行建模,因此总体设置也是纤维化的。
Deductive verification techniques based on program logics (i.e., the family of Floyd-Hoare logics) are a powerful approach for program reasoning. Recently, there has been a trend of increasing the expressive power of such logics by augmenting their rules with additional information to reason about program side-effects. For example, general program logics have been augmented with cost analyses, logics for probabilistic computations have been augmented with estimate measures, and logics for differential privacy with indistinguishability bounds. In this work, we unify these various approaches via the paradigm of grading, adapted from the world of functional calculi and semantics. We propose Graded Hoare Logic (GHL), a parameterisable framework for augmenting program logics with a preordered monoidal analysis. We develop a semantic framework for modelling GHL such that grading, logical assertions (pre- and post-conditions) and the underlying effectful semantics of an imperative language can be integrated together. Central to our framework is the notion of a graded category which we extend here, introducing graded Freyd categories which provide a semantics that can interpret many examples of augmented program logics from the literature. We leverage coherent fibrations to model the base assertion language, and thus the overall setting is also fibrational.