arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1101.0114cs.SEcs.LO
收藏

通过类型化断言实现行为子类型化

Behavioral subtyping through typed assertions

Herbert Toth

摘要:

本文提出了一个流行的方法,以确保Liskov替换原则在类层次结构(如契约式设计(TM),规范继承)的关键讨论。它将被证明,他们有一些不足之处,这是由于如何有效的约束计算子类方法。一个新的机制,称为客户端一致性,需要考虑到客户端的程序状态的观点更正确地介绍:客户端的静态类型确定的上下文中,推理程序状态是要做的。这是服务器方法的运行时断言检查(RAC)必须适当适应的上下文。在逐步论证中,我们展示了RAC的改进,这些改进可以按照这种方法以自然的方式实现,保留渗透模式机制:客户端既不会遇到不安全或意外的执行,也不会遇到服务器方法的意外失败。

英文摘要:

This paper presents a critical discussion of popular approaches to ensure the Liskov substitution principle in class hierarchies (e.g. Design by Contract(TM), specification inheritance). It will be shown that they have some deficiencies which are due to the way how effective constraints are calculated for subclass methods. A new mechanism, called client conformance, is introduced that takes the client's view on the program state into account more properly: The client's static type determines the context in which reasoning about program state is to be done. This is the context to which the runtime assertion checking (RAC) of server methods must be adapted appropriately. In a stepwise argumentation we show the improvements for RAC that can be reached following this approach in a natural way, preserving the percolation pattern mechanism: Clients will neither be confronted with unsafe or surprising executions, nor with surprising failures of server methods.

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

↑