{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

003 - < It relates two types a and I each of whose...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: <. It relates two types, a and I each of whose specifications respectively preserves its invariant, lo and IT , and.satisfies its constraint, Co and Cr. In the methods and constraint rules, since x is an object of type o_, its value (xpre or xpost) is a member of S and 1 therefore cannot be used directly in the predicates about 1 objects (which are in terms of values in T). The abstraction function A is, used to translate these values so that the predicates about I objects make sense. According to them, with the constraint approach users cannot use the history rule to deduce history properties. Their second approach allows them to do so. It requires that we “explain” each extra method in terms of existing methods. If such explanations are possible, the extra methods do not add any behavior that could not have been effected in their absence. Therefore, all supertype properties, including history properties, are preserved. In their second definition, to show that a is a subtype of r they have come up with a new technique called an extension map that is defined for all extra methods introduced by the subtype. The extension map “explains” the behavior of each extra method as a program expressed in terms of ,non-extra methods. Interesting explanations are needed only for mutators; non-mutator's always have the “empty" explanation, 2. Since the extension map is defined just for the extra methods, it is possible for a subtype to redefine a supertype’s (non—extra) method in a way that causes a violation of a history property of the supertype. Infiater sections they have summarized these two specifications and applied their specifications to many different examples.- According to them, having an explicit constraint is appealing because the subtype relation is simple, it allows to state properties of type families declaratiyely, and the constraint acts as a check on the correctness of a ...
View Full Document

{[ snackBarMessage ]}