Sather Home Page

Section 8.1.2.1:
ELT_NIL

class ELT_NIL{ETP}

Formal Types

The type definitions in this generic class specification fall into two groups :-

  1. The definition of ELT_NIL{ETP} itself (including SAME).
  2. The auxiliary vdm type needed to define the Sather type argument used in the feature definitions which follow.
types

SAME = ELT_NIL_ETP ;

-- Auxiliary Types

Element_Type = @ETP

elt_nil

This feature provides the nil value of the element type which is the class argument.

elt_nil : ETP
Formal Signature
elt_nil(self : SAME) res : [ETP]
Pre-condition

Since the sole argument is not optional then this pre-condition is vacuously true.

Post-condition
post (sub_type($NIL,Element_Type)
         and (res = Element_Type.nil))
      or res = nil

This feature returns the appropriate nil value if ther argument type is a sub-type of $NIL, otherwise void.


is_elt_nil

This feature returns true if and only if the given element is of a type which sub-types from $NIL and has that nil value.

is_elt_nil : BOOL
elem : ETP
) : BOOL
Formal Signature
is_elt_nil(self : SAME, elem : ETP) res : BOOL
Pre-condition

Since neither argument is optional then this pre-condition is vacuously true.

Post-condition
post res = (sub_type($NIL,Element_Type)
         and (res = Element_Type.nil))

This feature returns true if and only if the given element belongs to a type which sub-types from $NIL and has that nil value, otherwise false.


Language Index Library Index Basic Index
Comments or enquiries should be made toKeith Hopper.
Page last modified: Thursday, 29 March 2001.
Produced with Amaya