![]() |
Section 8.1.1.9:
|
![]() |
This abstract class defines a state component which is a set of all instantiations of objects of any class sub-typing from this class in addition to the vdm model types used wherever this class name is used. Note that SAME has to be an instantiated class, not an abstract one.
types SAME = object_type ; $COPY = set of object_type state multi : $COPY inv multi_types == forall obj | obj in set multi_types & sub_type($COPY,obj)
NOTE | See the important note about vdm state in the notes on vdm-sl usage in this specification. |
This abstract class defines the concept of an object of which a copy may be made. It provides the single feature defined below.
This feature provides for the production of an exact copy of the object concerned.
copy | SAME |
copy(self : SAME) res : SAME
Note that in contrast to a pre-condition written in Sather source code, in vdm-sl the type SAME is not an optional type and therefore self must exist, leading to the pre-condition being vacuously true.
This post-condition equality is not the Sather object equality which would imply that self and res were the same object. Vdm-sl equality means equality of value.
post res = self
This feature returns a new object which has the same contents as self.
![]() |
Language Index | ![]() |
Library Index | ![]() |
Basic Index |
Comments
or enquiries should be made toKeith Hopper. Page last modified: Thursday, 29 March 2001. |
![]() |