一句话:提出允许断言求值期间持有超过完整权限的无界分离逻辑语义,统一语义与语法乘法并恢复分配、提取与合并性质。
许多分离逻辑用分数权限区分堆位置的读/写访问,并将分数乘法扩展到(余)归纳谓词和 magic wand 等复合断言。典型证明要求乘法满足分配性、可提取性和可合并性。已有语义定义通过模型定义乘法,导致 magic wand 等关键资源断言不满足这些性质,且无法从分离合取中提取分数;自动验证器则采用语法定义,其性质是否普遍成立尚不清楚。本文提出一种新的断言语义:在断言求值期间允许状态持有超过完整权限,并在语句边界重新施加每个位置权限的上界,从而保留框架规则等关键性质。该语义统一了语义乘法与语法乘法,使分配性、可提取性和可合并性成立,调和了分离逻辑理论与工具之间的差异。我们已在 Isabelle/HOL 中形式化该语义并证明其性质。
Many separation logics support fractional permissions to distinguish between read and write access to a heap location, for instance, to allow concurrent reads while enforcing exclusive writes. Fractional permissions extend to composite assertions such as (co)inductive predicates and magic wands by allowing those to be multiplied by a fraction. Typical separation logic proofs require that this multiplication has three key properties: it needs to distribute over assertions, it should permit fractions to be factored out from assertions, and two fractions of the same assertion should be combinable into one larger fraction. Existing formal semantics incorporating fractional assertions into a separation logic define multiplication semantically (via models), resulting in a semantics in which distributivity and combinability do not hold for key resource assertions such as magic wands, and fractions cannot be factored out from a separating conjunction. By contrast, existing automatic separation logic verifiers define multiplication syntactically, resulting in a different semantics for which it is unknown whether distributivity and combinability hold for all assertions. In this paper, we present a novel semantics for separation logic assertions that allows states to hold more than a full permission to a heap location during the evaluation of an assertion. By reimposing upper bounds on the permissions held per location at statement boundaries, we retain key properties of separation logic, in particular, the frame rule. Our assertion semantics unifies semantic and syntactic multiplication and thereby reconciles the discrepancy between separation logic theory and tools and enjoys distributivity, factorisability, and combinability. We have formalised our semantics and proved its properties in Isabelle/HOL.
@article{paperbot1441,
title = {Fractional resources in unbounded separation logic},
author = {Thibault Dardinier and Peter Müller and Alexander J. Summers},
journal = {Proceedings of the ACM on Programming Languages},
volume = {6},
number = {OOPSLA2},
year = {2022},
doi = {10.1145/3563326}
}