Abstract

This paper presents an algebraic compositional semantics for a schema of an object-oriented syntax which models many existing features as class hierarchies, polymorphism and concurrency, using a pattern which could be applied to different concrete languages (in what follows O-O stands for “object-oriented”). The semantics is defined in a classical denotational style, ie giving an abstract syntax, the semantic domains and the interpretation of the syntactic operators. From this point of view the paper yields a formalization of the model which underlies an O-O notation as done for example in [Wo] for Smalltalk-80. However our approach is different from the traditional one for at least two reasons. First, the given semantics is algebraic in the sense that the value denoted by a class (the basic language unit in an O-O notation) is in general a class of algebras described by an algebraic specification. In particular, we use the algebraic specification language ASL ([Wi]). This approach allows to model in a natural way some typical O-O features related to combining classes. A class combinator (eg inheritance) is semantically interpreted in this framework as a function which handles classes of algebras or, in an equivalent way, since we use an algebraic specification language, as a specification combinator (see [Wi] for foundations). Moreover, our schema of semantic definition allows to model also concurrent features of the O-O language if any, by underlying an approach to concurrency based on algebraic transition systems (see for example [AR] for foundations and [AGRZ] for a recent survey with already some hints on the treatment of objects). In this respect our aim is not to present a particular language but to give a general framework in which different concurrent features, like synchronization primitives between active objects or mutual exclusion, can easily be inserted. A formal semantics for a particular parallel O-O language in a classical denotational style may be found for example in [ABKR]. In this paper we consider a schema of programming languages. This means that the description of a class includes an implementation part containing method bodies where method is the O-O notion which corresponds to the function/procedure notion in Pascal-like languages. Its semantic counter-part is a set of axioms in the specification associated with the class, each one corresponding to a method body. However the overall approach presented here also works in a framework in which properties of methods are specified by more general axioms. In this sense the O-O syntax presented in the paper, if we do not consider method bodies, can be viewed as a starting point for an O-O specification language, following an idea of [GM]. A paper in this direction is in preparation ([BZ2]). Due to the lack of space, this paper is mainly devoted to illustrate the main ideas of our semantics, trying to avoid as much as possible technicalities and details. It is organized in a top-down way. Sect. 1 presents the syntax and semantics of class combinators, showing how they are modelled by compositionality; this section is concerned with structuring classes and is independent from the kind of dynamics of the system (sequential or concurrent). Sect. 2 shows how the treatment of concurrency is inserted into the framework. Sect. 3 is concerned with method implementations; this part is illustrated by an example. For the formalization of this part the reader may refer to a more detailed version in [BZ1]; a revised full version of this paper with also other examples of applications is in preparation. This paper has been written largely as a result of the experience gained by the authors during the work in the Esprit project DRAGON, in which one of the tasks is the development of an object-oriented notation particularly suitable for reuse and distribution ([DRAGON]).

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.