A Behavioral Subtyping, Specification Inheritance, and Modular Reasoning

نویسندگان

  • GARY T. LEAVENS
  • DAVID A. NAUMANN
چکیده

Verification of a dynamically-dispatched method call, E .m(), seems to depend on E ’s dynamic type. To avoid case analysis and allow incremental development, object-oriented program verification uses supertype abstraction. That is, one reasons about E .m() using m’s specification for E ’s static type. Supertype abstraction is valid when each subtype in the program is a behavioral subtype. This paper formalizes supertype abstraction and behavioral subtyping for a Java-like sequential language with mutation, and proves that behavioral subtyping is both necessary and sufficient for the validity of supertype abstraction. Specification inheritance, as in JML, is also formalized and proved to entail behavioral subtyping.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

JML's Rich, Inherited Specifications for Behavioral Subtypes

The Java Modeling Language (JML) is used to specify detailed designs for Java classes and interfaces. It has a particularly rich set of features for specifying methods. This paper describes those features, with particular emphasis on the features related to specification inheritance. It shows how specification inheritance in JML forces behavioral subtyping, through a discussion of semantics and...

متن کامل

Behavioral Subtyping is Equivalent to Modular Reasoning for Object-oriented Programs

Behavioral subtyping is an established idea that enables modular reasoning about behavioral properties of object-oriented programs. It requires that syntactic subtypes are behavioral refinements. It validates reasoning about a dynamically-dispatched method call, say E .m(), using the specification associated with the static type of the receiver expression E . For languages with references and m...

متن کامل

Lazy Behavioral Subtyping

Inheritance combined with late binding allows flexible code reuse but complicates formal reasoning significantly, as a method call’s receiver class is not statically known. This is especially true when programs are incrementally developed by extending class hierarchies. This paper develops a novel method to reason about late bound method calls. In contrast to traditional behavioral subtyping, r...

متن کامل

Behavioral Subtyping in Object-Oriented Languages

Modularity and code reuse are two important features of object-oriented programming. Modularity means that adding new components does not require reveri cation or respeci cation of existing components. A common form of reuse in objectoriented programs is to add new subtypes to existing types and to invoke already existing procedures with objects of these new types. In such cases, behavior of pr...

متن کامل

Practical Strengthening of Preconditions

This paper takes a closer look at behavioral subtyping in the context of concurrency, by considering an example of subtyping of a concurrent datastructure taken from sensor networks. Akin to the extension of a state-machine, this example illustrates conflicts caused by the interference of concurrency and inheritance. In short, the extension consists in declaring additional fields in a subclass,...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2013