Modular Veriication of Object-oriented Programs with Subtypes Modular Veriication of Object-oriented Programs with Subtypes List of Figures 1.1 the Type Speciication
چکیده
Object-oriented programming languages like Smalltalk-80 have a message passing mechanism that allows code to work on instances of many diierent types. Techniques for the formal speciication of such polymorphic functions and abstract types are described, as well as a logic for verifying programs that use message passing but not object mutation or assignment. The reasoning techniques formalize informal methods based on the use of sub-types. A formal deenition of subtype relationships among abstract types whose objects have no time-varying state but may be nondeterministic or incompletely speciied is given. This deenition captures the intuition that each instance of a subtype behaves like some instance of that type's supertypes. Speciications of polymorphic functions are written by allowing instances of subtypes as arguments. Restrictions on the way that abstract types are speciied ensure that such function speciications are meaningful and do not have to be rewritten when new subtypes are speciied. Veriication consists of showing that the speciied relation among types has certain semantic properties, that each expression's value is an instance of a subtype of the expression's type, and a proof of correctness that ignores subtyping. 1.3 Implementation of the function inBothCLU in CLU, which demonstrates the code update problem. 3 1.4 Example of message