arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2101.06087cs.LOcs.PL
收藏

带过程程序的抽象契约理论

An Abstract Contract Theory for Programs with Procedures

Christian Lidström, Dilian Gurov

摘要:

当开发复杂的软件和系统时,契约通过以分层的方式在系统的组件之间划分责任来提供控制复杂性的手段。在特定的应用领域,专门的契约理论以最好地支持该领域系统开发的方式正式化了契约的概念和对契约的操作。另一方面,契约元理论试图通过公理化各种契约理论的期望属性来提供一个系统的观点。然而,在Benveniste等人最著名的契约元理论,它专注于嵌入式和网络物理系统的设计,以及在开发通用软件时使用合同的既定方式,遵循Meyer的合同设计方法。这个差距的核心似乎是过程的概念:虽然它是软件开发中的一个核心组成单元,但元理论并没有提出一种将过程视为组件的明显方式。在本文中,我们提供了第一步的合同理论,以程序作为基本的积木,并在同一时间的元理论的实例。为此,我们提出了一个抽象的合同理论的顺序程序设计语言的过程,基于指称语义。我们表明,一方面,在霍尔逻辑中的过程的合同的规格说明,和他们的过程模块化验证,可以在我们的抽象合同理论的框架内自然地铸造。另一方面,我们也展示了我们的契约理论来满足元理论的公理。通过这种方式,我们为元理论的效用提供了进一步的证据,并为将我们的实例与其他已经存在的实例相结合奠定了基础。

英文摘要:

When developing complex software and systems, contracts provide a means for controlling the complexity by dividing the responsibilities among the components of the system in a hierarchical fashion. In specific application areas, dedicated contract theories formalise the notion of contract and the operations on contracts in a manner that supports best the development of systems in that area. At the other end, contract meta-theories attempt to provide a systematic view on the various contract theories by axiomatising their desired properties. However, there exists a noticeable gap between the most well-known contract meta-theory of Benveniste et al., which focuses on the design of embedded and cyber-physical systems, and the established way of using contracts when developing general software, following Meyer's design-by-contract methodology. At the core of this gap appears to be the notion of procedure: while it is a central unit of composition in software development, the meta-theory does not suggest an obvious way of treating procedures as components. In this paper, we provide a first step towards a contract theory that takes procedures as the basic building block, and is at the same time an instantiation of the meta-theory. To this end, we propose an abstract contract theory for sequential programming languages with procedures, based on denotational semantics. We show that, on the one hand, the specification of contracts of procedures in Hoare logic, and their procedure-modular verification, can be cast naturally in the framework of our abstract contract theory. On the other hand, we also show our contract theory to fulfil the axioms of the meta-theory. In this way, we give further evidence for the utility of the meta-theory, and prepare the ground for combining our instantiation with other, already existing instantiations.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑