arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 1311.7181cs.LO
收藏

面向接口编程程序的形式化验证

Formal Verification of `Programming to Interfaces' Programs

Jianhua Zhao, Xuandong LI

摘要:

本文提出了一种形式化的方法来指定和验证面向对象的程序编写的“编程接口”的范式。除了客户端调用的方法外,接口还声明了一组抽象函数/谓词符号,以及对这些符号的一组约束。对于此接口中声明的每个方法,都会使用这些抽象符号给出一个规范模板。实现这个接口的类可以为抽象符号提供自己的定义,只要满足所有约束即可。该类实现接口中声明的所有方法,以便满足接口中声明的方法规范模板。这个类中抽象函数符号的定义。基于对抽象符号的约束,可以精确地指定和验证使用接口的客户端代码,而无需知道哪些类实现这些接口。如果提供了关于实现类的更多信息,客户端代码的规范可以被专门化为更精确的规范,而无需重新验证客户端代码。几个常用的接口和它们的实现(包括迭代器,观察者,比较,和比较器)被用来证明在本文中的方法是精确和灵活的。

英文摘要:

This paper presents a formal approach to specify and verify object-oriented programs written in the `programming to interfaces' paradigm. Besides the methods to be invoked by its clients, an interface also declares a set of abstract function/predicate symbols, together with a set of constraints on these symbols. For each method declared in this interface, a specification template is given using these abstract symbols. A class implementing this interface can give its own definitions to the abstract symbols, as long as all the constraints are satisfied. This class implements all the methods declared in the interface such that the method specification templates declared in the interface are satisfied w.r.t. the definitions of the abstract function symbols in this class. Based on the constraints on the abstract symbols, the client code using interfaces can be specified and verified precisely without knowing what classes implement these interfaces. Given more information about the implementing classes, the specifications of the client code can be specialized into more precise ones without re-verifying the client code. Several commonly used interfaces and their implementations (including Iterator, Observer, Comparable, and Comparator) are used to demonstrate that the approach in this paper is both precise and flexible.

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

↑