| # Section 8.1.2.2: ELT_EQ |

###### class ELT_EQ{ETP}

#### Formal Types

types
SAME = ELT_EQ_ETP ;

This class provides the equality comparison function for elements of type ETP. If no other method has been provided then a default system-defined equality is used.

It should be noted that it cannot be a partial class because of the rule that a call into a partial class cannot be made from within another partial class.

#### elt_eq

This is the sole predicate provided by this class. Depending upon whether or not the class ETP has defined equality then that operation is used or, if not, the object equality test is used.

elt_eq | (
| first : ETP,
| second : ETP
| ) : BOOL

##### Formal Signature

is_eq(first, second : ETP) res : BOOL

##### Pre-condition

Since this operation is a predicate the only pre-condition has to be true.

##### Post-condition

The formal post-condition is expressed as being equality in vdm terms. This is true if the argument type has defined equality, otherwise it must be informally recognised as implying object equality as defined by the language.

post res = (first = second)

This predicate returns true if and only if the two arguments are equal. The equality relation uses the user defined is_eq routine if the argument type is a subtype of $IS_EQ, otherwise it uses the system defined equality routine.

| Language Index |  | Library Index |  | Basic Index

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