| # Section 8.1.1.1: $NIL |

###### abstract class $NIL

#### 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 ;
$NIL = set of object_type
state
multi : $NIL
inv multi_types ==
forall obj in set multi_types & sub_type($NIL,obj)

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

This abstract class defines for an object sub-typing from it that there must be an iplementation of the concept of a distinguished value nil.

This class defines the following single feature.

#### nil

This feature is a value which is considered by the sub-typing class to be 'nil'. Any bit-pattern may be considered to be the 'nil' value. However, programs which rely upon some particular pattern are considered non-portable.

nil | : SAME

##### Formal Signature

Note that the formal name of the feature has been changed to prevent a clash with the vdm value nil.

nil_val(self : SAME) res : SAME

##### Pre-condition

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.

##### Post-condition

post is_nil(res)

This routine returns a 'nil' value for the object type. Note that the definition of what is a nil value is implementation-defined!

| Language Index |  | Library Index |  | Basic Index

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