Modelling inheritance in an algebraic specification language
Dieter Nazareth · 1993
This paper points at the retract problem that arises, when using subsorting 1 in a not necessarily executable algebraic specification language. We show how this problem can be circumvented in many important cases by the use of conditionally polymorphic functions. Further, we will see that this sorting facility is well-suited to model inheritance in a smart way. We give a simple example which demonstrates this approach in the specification language Spectrum. 1 Subsorting in a Specification Language Statically sorted languages help to increase the perceivability of programs. Many errors can be detected and corrected at compile time. Sometimes, however, the sort system is too rigid and therefore restricts the expressiveness of the language. One concept to weaken the strength of the sort system is to allow subsort relations between sorts. The partial ordering on the set of sorts is interpreted as set inclusion on the domains. The most well-known programming language with a subsort...