In this paper we present a theory for the refinement of shared-memory concurrent algorithms from specifications. Our approach avoids restrictive atomicity contraints. It provides a range of constructs for specifying concurrent programs and laws for refining these to code. We augment pre and post condition specifications with Jones' rely and guarantee conditions, which we encode as commands within a wide-spectrum language. Program components are specified using either partial and total correctness versions of end-to-end specifications. Operations on shared data structures and atomic machine operations (e.g. compare-and-swap) are specified using an atomic specification command. All the above constructs are defined in terms of a simple core language, based on four primitive commands and a handful of operators, and for which we have developed an extensive algebraic theory in Isabelle/HOL. For shared memory programs, expression evaluation is subject to fine-grained interference and we have avoided atomicity restrictions other than for read and write of primitive types (words). Expression evaluation and assignment commands are also defined in terms of our core language primitives, allowing laws for reasoning about them to be proven in the theory. Control structures such as conditionals, recursion and loops are all defined in terms of the core language. In developing the laws for refining to such structures from specifications we have taken care to develop laws that are as general as possible; our laws are typically more general than those found in the literature. In developing our concurrent refinement theory we have taken care to focus on the algebraic properties of our commands and operators, which has allowed us to reuse algebraic theories, including well-known theories, such as lattices and boolean algebra, as well as programming-specific algebras, such as our synchronous algebra.
翻译:在本文中,我们提出了一个理论,用于完善来自规格的共享模拟并行算法。我们的方法避免了限制性原子反向。它提供了一系列结构,用于为完善这些算法而具体指定并行的程序和法律。我们通过琼斯的依靠和保证条件来增加条件前和后规格,我们将这些条件编码为宽频语言中的指令。我们用端到端规格的局部和完全正确性版本来指定方案构成部分。关于共享数据结构和原子机器操作(例如比较和擦拭)的操作,使用原子规格指令来指定。所有上述构造都是用简单的核心语言来定义的,以四种原始指令和少数操作者为基础,我们为此在伊莎贝尔/HOL中制定了广泛的代数理论。对于共同记忆程序,表达评价会受到精细的干扰,我们避免了原子限制,而不是读和写原始类型(言词)的原子限制。表达评估和分配指令也可以用我们的核心语言原始语言术语来定义,允许用法律来解释它们,在理论中进行推理。 控制这些理论结构,例如修炼法,例如修炼法,我们一般的精细的精炼,我们一般的精炼法,我们从修的精炼法,我们从修的精炼到修的精炼法,我们有。 等的精炼法,我们从修的精细的精细的精细的精细的精细的精细的精细的精细的精细的精细的精细。