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.
翻译:基于程序逻辑(即Floyd-Hoare逻辑家族)的降低核查技术是基于程序逻辑(即Floyd-Hoare逻辑家族)的一种强有力的程序推理方法。最近出现了一种趋势,即通过增加规则的附加信息来增加这些逻辑的表达力,从而增加其规则的表达力,从而解释程序副作用。例如,一般程序逻辑通过成本分析而得到加强,概率计算逻辑通过估计措施得到加强,而隐私差异性和不区别性界限的逻辑则得到加强。在这项工作中,我们通过从功能计算学和语义学世界改编的分级模式将这些不同方法统一起来。我们提出“GHoare Logic”(GHL),这是一个可用于增强程序逻辑逻辑的可参数框架,同时进行预先排序单项分析。我们为GHL(GHL)模型、逻辑论(前和后条件)和必要语言的基本效果语义的语义结合。我们框架的核心是通过等级分类的概念,我们在此扩展一个分级分类的类别,我们引入了分级语言和立式的逻辑学,从而将逻辑推介了整个程序。