We have seen that the role of the DEFINITION MODULE in Modula-2 is to provide users with information on the type(s) and operations available to them. The operations specified in the DEFINITION MODULE are available to users of the abstract data type and allow them to manipulate values of the data type in any application program. However, it is these and only these operations, as stated in the DEFINITION MODULE which are available to the user. The representation of the abstract data type and the implementation of the operations are explicitly programmed in the corresponding IMPLEMENTATION MODULE by the implementor of the abstract data type which is hidden from the user.
In contrast, for an algebraic specification of an abstract data type, there is no implementation - the algebraic specification provides a complete mathematical description of both the syntax and semantics of an abstract data type. Hence, in a sense, the implementation is now shielded not only from the user but from everyone !
The virtue of the algebraic approach to specification is that unlike its Modula-2 and Ada analogues, it also provides a means for specifying the semantics of an abstract data type in a formal manner. This is achieved by the use of equations or axioms which express relations between the operations in terms of compositions (applications) of two (or more) corresponding functions. Let us now examine the structure of an algebraic specification. An algebraic specification of an abstract data type provides a user with