# Section 7.1.2:
$REFERENCE

###### abstract class $REFERENCE

#### Formal Definitions

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 ;
$REFERENCE = set of object_type
state
references : $REFERENCE
inv ref_types ==
forall obj in set ref_types sub_type($REFERENCE,obj)

NOTE | See the important note about vdm state in the notes on vdm-sl usage in this specification.

This pervasive class defines for a program the concept of an opaque reference to an entity provided by the program execution environment which may subsequently be used by the program to refer to the entity concerned. The life of such a reference is determined by the execution environment.

NOTE | The references provided by the program environment may not be globally unique. They may come from disjoint sets of entities (eg files and execution threads) for which the reference is an identical bit-pattern. The programmer should take account of this when coding. The Sather system cannot do this explicitly or implicitly for the user.

This class defines no features.

Example - a program which opens a file of some kind is provided with a reference which it may use when sending/obtaining data to/from that file. Such a reference would normally be expected to sub-type from this abstract class.

| Language Index |  | Library Index |  | Section 7 Index

Comments or enquiries should be made to Keith Hopper . Page last modified: Thursday, 18 May 2000. |