具有历史和主观性的并行算法
Specifying and Verifying Concurrent Algorithms with Histories and Subjectivity
摘要:
我们提出了一个轻量级的方法,以霍尔式规范的细粒度并发,基于时间戳的历史,抽象捕捉原子的程序状态的变化的概念。我们的关键观察是,历史形成了一个部分交换幺半群,并发资源的表示的基本结构。这种洞察力为我们提供了一种统一的机制,使我们能够像对待分离逻辑中的堆一样对待历史。例如,两者都服从相同的断言逻辑和推理规则(例如,框架规则)。此外,通常适用于堆的所有权转移的概念在历史学中也有对应的概念。它可以用来正式表示帮助-一个并发算法的重要设计模式,一个线程可以代表另一个线程执行代码。历史方面的规范自然地抽象了粒度,在这个意义上,复杂的细粒度算法可以被赋予与简化的粗粒度算法相同的规范,使它们同样方便客户端推理。我们说明了我们的方法上的一些例子,并验证所有的Coq。
英文摘要:
We present a lightweight approach to Hoare-style specifications for fine-grained concurrency, based on a notion of time-stamped histories that abstractly capture atomic changes in the program state. Our key observation is that histories form a partial commutative monoid, a structure fundamental for representation of concurrent resources. This insight provides us with a unifying mechanism that allows us to treat histories just like heaps in separation logic. For example, both are subject to the same assertion logic and inference rules (e.g., the frame rule). Moreover, the notion of ownership transfer, which usually applies to heaps, has an equivalent in histories. It can be used to formally represent helping---an important design pattern for concurrent algorithms whereby one thread can execute code on behalf of another. Specifications in terms of histories naturally abstract granularity, in the sense that sophisticated fine-grained algorithms can be given the same specifications as their simplified coarse-grained counterparts, making them equally convenient for client-side reasoning. We illustrate our approach on a number of examples and validate all of them in Coq.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。