一句话:提出带动态分配对象语言的关系霍尔逻辑,以状态化框架条件统一封装、隐藏与实现耦合。
本文结合 Hoare 关于不变量隐藏、模拟以及程序逻辑的思想,研究如何为带动态分配的对象语言进行关系推理。作者提出一种关系霍尔逻辑,使用状态化框架条件来形式化封装、不变量隐藏,以及关联两个实现的耦合关系;断言用一阶逻辑表达。该逻辑可描述条件等价、带解密的非干扰等关系性质,证明规则通过便利的对齐支持关系推理,并相对于传统操作语义被证明可靠。文中还导出一条用于链接程序等价的规则,直接体现表示独立性,并通过基于 SMT 的实现展示在代表性例子上的适用性。
Dedicated to Tony Hoare. In a paper published in 1972, Hoare articulated the fundamental notions of hiding invariants and simulations. Hiding: invariants on encapsulated data representations need not be mentioned in specifications that comprise the API of a module. Simulation: correctness of a new data representation and implementation can be established by proving simulation between the old and new implementations using a coupling relation defined on the encapsulated state. These results were formalized semantically and for a simple model of state, though the paper claimed this could be extended to encompass dynamically allocated objects. In recent years, progress has been made toward formalizing the claim, for simulation, though mainly in semantic developments. In this article, hiding and simulation are combined with the idea in Hoare’s 1969 paper: a logic of programs. For an object-based language with dynamic allocation, we introduce a relational Hoare logic with stateful frame conditions that formalizes encapsulation, hiding of invariants, and couplings that relate two implementations. Relations and other assertions are expressed in first-order logic. Specifications can express a wide range of relational properties such as conditional equivalence and noninterference with declassification. The proof rules facilitate relational reasoning by means of convenient alignments and are shown sound with respect to a conventional operational semantics. A derived proof rule for equivalence of linked programs directly embodies representation independence. Applicability to representative examples is demonstrated using an SMT-based implementation.
@article{paperbot1600,
title = {A Relational Program Logic with Data Abstraction and Dynamic Framing},
author = {Anindya Banerjee and Ramana Nagasamudram and David A. Naumann and Mohammad Nikouei},
journal = {ACM Transactions on Programming Languages and Systems},
volume = {44},
number = {4},
year = {2022},
doi = {10.1145/3551497}
}