Wrapper semantics of an object-oriented programming language with state

  • Andreas V. Hense
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 526)

Abstract

The semantics of class inheritance has first been given in operational form (method-lookup-semantics). While this semantics is well suited for implementing object-oriented programming languages, it may conceal the true nature of inheritance. The development of denotational semantics for object-oriented languages has culminated in object creation as fixed point operation. Cook gave a semantics on this basis, using so called wrappers. This semantics abstracts from the internal state of objects (instance variables).

In this paper we show how wrapper semantics can be extended to an object-oriented programming language with state while keeping the structure of the original definitions. For this purpose we define a direct denotational semantics of a small example language. The insertion of state into class definitions can be done before or after the related fixed point operation. The choice of the alternative considerably influences the semantic domains and clauses.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [1]
    H. Abelson, G. J. Sussman, and J. Sussman. Structure and Interpretation of Computer Programs. MIT Press, 1985.Google Scholar
  2. [2]
    H. P. Barendregt. The Lambda Calculus — Its Syntax and Semantics. Volume 103 of Studies in Logic and The Foundations of Mathematics, North-Holland, revised 1984 edition, 1981.Google Scholar
  3. [3]
    W. Cook and J. Palsberg. A denotational semantics of inheritance and its correctness. In Object-Oriented Programming Systems, Languages and Applications, pages 433–444, ACM, Oct. 1989.Google Scholar
  4. [4]
    W. R. Cook. A Denotational Semantics of Inheritance. Technical Report CS-89-33, Brown University, Dept. of Computer Science, Providence, Rhode Island 02912, May 1989.Google Scholar
  5. [5]
    M. Felleisen. On the expressive power of programming languages. Lecture Notes in Computer Science, 432:134–151, 1990. European Symposium on Programming.Google Scholar
  6. [6]
    A. Goldberg and D. Robson. Smalltalk-80: the Language. Addison-Wesley, 1989.Google Scholar
  7. [7]
    M. Gordon. The Denotational Description of Programming Languages: An Introduction. Springer-Verlag, New York/Heidelberg/Berlin, 1979.Google Scholar
  8. [8]
    A. Hense. The Denotational Semantics of an Object Oriented Programming Language. Technical Report A 01/90, Universität des Saarlandes, Fachbereich 14, Jan. 1990.Google Scholar
  9. [9]
    J. Hindley and J. Seldin. Introduction to Combinators and λ-Calculus. Volume 1 of London Mathematical Society Student Texts, Cambridge University Press, 1986.Google Scholar
  10. [10]
    S. Kamin. Inheritance in Smalltalk-80. In Symposium on Principles of Programming Languages, pages 80–87, ACM, Jan. 1988.Google Scholar
  11. [11]
    R. Milner. A proposal for standard ML. In Symposium on Lisp and Functional Programming, pages 184–197, ACM, Austin Texas, 1984.Google Scholar
  12. [12]
    U. S. Reddy. Objects as closures: abstract semantics of object-oriented languages. In Symposium on Lisp and Functional Programming, pages 289–297, ACM, 1988.Google Scholar
  13. [13]
    D. Scott. Data types as lattices. SIAM J. Comput., 5:522–587, 1976.Google Scholar
  14. [14]
    A. Snyder. Encapsulation and inheritance in object-oriented programming languages. In Object-Oriented Programming Systems, Languages and Applications, pages 38–45, ACM, Sep. 1986.Google Scholar
  15. [15]
    J. E. Stoy. Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory. MIT press, 1977.Google Scholar
  16. [16]
    A. Tarski. A lattice-theoretical fixed point theorem and its applications. Pacific Journal of Mathematics, 5:285–309, 1955.Google Scholar
  17. [17]
    D. Turner. Miranda: a non-strict functional language with polymorphic types. Lecture Notes in Computer Science, 201:1–16, 1985. Functional Programming Languages and Computer Architecture.Google Scholar
  18. [18]
    P. Wadler. Comprehending monads. In Symposium on Lisp and Functional Programming, pages 61–78, ACM, 1990.Google Scholar
  19. [19]
    P. Wegner. The object-oriented classification paradigm. In B. Shriver and P. Wegner, editors, Research Directions in Object Oriented Programming, pages 479–560, MIT Press, 1987.Google Scholar
  20. [20]
    P. Wegner and S. Zdonik. Inheritance as an incremental modification mechanism or what like is and isn't like. Lecture Notes in Computer Science, 322:55–77, Aug. 1988. European Conference on Object-Oriented Programming.Google Scholar
  21. [21]
    M. Wolczko. Encapsulation, delegation and inheritance in object-oriented languages. 1990. (submitted for publication).Google Scholar
  22. [22]
    M. Wolczko. Semantics of Smalltalk-80. Lecture Notes in Computer Science, 276:108–120, 1987. European Conference on Object-Oriented Programming.Google Scholar

Copyright information

© Springer-Verlag 1991

Authors and Affiliations

  • Andreas V. Hense
    • 1
  1. 1.LS Programmiersprachen u. Übersetzerbau FB 14, InformatikUniversität des SaarlandesSaarbrücken 11Fed. Rep. of Germany

Personalised recommendations