A Core Calculus of Classes and Mixins

  • Viviana Bono
  • Amit Patel
  • Vitaly Shmatikov
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1628)

Abstract

We develop an imperative calculus that provides a formal model for both single and mixin inheritance. By introducing classes and mixins as the basic object-oriented constructs in a λ-calculus with records and references, we obtain a system with an intuitive operational semantics. New classes are produced by applying mixins to superclasses. Objects are represented by records and produced by instantiating classes. The type system for objects uses only functional, record, and reference types, and there is a clean separation between subtyping and inheritance.

Keywords

Object-oriented language mixin class inheritance calculus operational semantics type system 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [1]
    M. Abadi and L. Cardelli. A Theory of Objects. Springer-Verlag, 1996.Google Scholar
  2. [2]
    D. Ancona and E. Zucca. An algebraic approach to mixins and modularity. In Proc. Algebraic and Logic Programming (ALP), pages 179–193. LNCS 1139, Springer-Verlag, 1996.Google Scholar
  3. [3]
    K. Arnold and J. Gosling. The Java Programming Language. Addison-Wesley, 1996.Google Scholar
  4. [4]
    V. Bono and M. Bugliesi. Matching for the lambda calculus of objects. Theoretical Computer Science, 1998. To appear.Google Scholar
  5. [5]
    V. Bono and K. Fisher. An imperative, first-order calculus with object extension. In Proc. ECOOP’ 98, pages 462–497. LNCS 1445, Springer-Verlag, 1998. Preliminary version appeared in FOOL 5 proceedings.Google Scholar
  6. [6]
    V. Bono and L. Liquori. A subtyping for the Fisher-Honsell-Mitchell lambda calculus of objects. In Proc. CSL’ 94, pages 16–30. LNCS 933, Springer-Verlag, 1995.Google Scholar
  7. [7]
    V. Bono, A. Patel, V. Shmatikov, and J. C. Mitchell. A core calculus of classes and objects. In Proc. 15th Conference on the Mathematical Foundations of Programming Semantics (MFPS’ 99), 1999. To appear.Google Scholar
  8. [8]
    V. Bono, A. Patel, V. Shmatikov, and J. C. Mitchell. A core calculus of object, classes, and mixins. Technical Report, The University of Birmingham and Stanford University, 1999. Forthcoming.Google Scholar
  9. [9]
    N. Boyen, C. Lucas, and P. Steyaert. Generalized mixin-based inheritance to support multiple inheritance. Technical Report vub-prog-tr-94-12, Vrije Universiteit Brussel, 1994.Google Scholar
  10. [10]
    G. Bracha. The Programming Language Jigsaw: Mixins, Modularity and Multiple Inheritance. PhD thesis, University of Utah, 1992.Google Scholar
  11. [11]
    G. Bracha and W. Cook. Mixin-based inheritance. In Proc. OOPSLA’ 90, pages 303–311, 1990.Google Scholar
  12. [12]
    G. Bracha and G. Lindstrom. Modularity meets inheritance. In Proc. International Conference on Computer Languages (ICCL’ 92), pages 282–290, 1992.Google Scholar
  13. [13]
    K.B. Bruce. Safe type checking in a statically-typed object-oriented programming language. In Proc. POPL’ 93, pages 285–298, 1993.Google Scholar
  14. [14]
    K.B. Bruce. A paradigmatic object-oriented language: design, static typing and semantics. J. Functional Programming, 4(2):127–206, 1994.CrossRefGoogle Scholar
  15. [15]
    K.B. Bruce, L. Cardelli, G. Castagna, The Hopkins Object Group, G. Leavens, and B. C. Pierce. On binary methods. Theory and Practice of Object Systems, 1(3):217–238, 1995.Google Scholar
  16. [16]
    K.B. Bruce, L. Cardelli, and B. C. Pierce. Comparing object encodings. In Proc. TACS’ 97, pages 415–438. LNCS 1281, Springer-Verlag, 1997.Google Scholar
  17. [17]
    K.B. Bruce, L. Petersen, and A. Finch. Subtyping is not a good “match” for object-oriented languages. In Proc. ECOOP’ 97, pages 104–127. LNCS 1241, Springer-Verlag, 1997.Google Scholar
  18. [18]
    K.B. Bruce, A. Schuett, and R. van Gent. PolyTOIL: A type-safe polymorphic object-oriented language. In Proc. ECOOP’ 95, pages 26–51. LNCS 952, Springer-Verlag, 1995.Google Scholar
  19. [19]
    L. Cardelli and P. Wegner. On understanding types, data abstraction, and polymorphism. Computing Surveys, 17(4):471–522, 1985.CrossRefGoogle Scholar
  20. [20]
    W. Cook, W. Hill, and P. Canning. Inheritance is not subtyping. In Proc. POPL’ 90, pages 125–135, 1990.Google Scholar
  21. [21]
    W. R. Cook. A Denotational Semantics of Inheritance. PhD thesis, Brown University, 1989.Google Scholar
  22. [22]
    E. Crank and M. Felleisen. Parameter-passing and the lambda calculus. In Proc. POPL’ 91, pages 233–244, 1991.Google Scholar
  23. [23]
    J. Eifrig, S. Smith, and V. Trifonov. Sound polymorphic type inference for objects. In Proc. OOPSLA’ 95, pages 169–184, 1995.Google Scholar
  24. [24]
    M. Felleisen and R. Hieb. The revised report on the syntactic theories of sequential control and state. Theoretical Computer Science, 103(2):235–271, 1992.MATHCrossRefMathSciNetGoogle Scholar
  25. [25]
    R. Findler and M. Flatt. Modular object-oriented programming with units and mixins. In Proc. ICFP’ 98, pages 94–104, 1998.Google Scholar
  26. [26]
    K. Fisher. Type Systems for Object-Oriented Programming Languages. PhDthesis, Stanford University, 1996.Google Scholar
  27. [27]
    K. Fisher, F. Honsell, and J. C. Mitchell. A lambda-calculus of objects and method specialization. Nordic J. of Computing, 1(1):3–37, 1994. Preliminary version appeared in Proc. LICS’ 93, pp. 26–38.MathSciNetGoogle Scholar
  28. [28]
    K. Fisher and J. C. Mitchell. A delegation-based object calculus with subtyping. In Proc. 10th International Conference on Fundamentals of Computation Theory (FCT’ 95), pages 42–61. LNCS 965, Springer-Verlag, 1995.Google Scholar
  29. [29]
    K. Fisher and J. C. Mitchell. On the relationship between classes, objects, and data abstraction. Theory and Practice of Object Systems, 4(1):3–26, 1998. Preliminary version appeared in Marktoberdorf’ 97 proceedings.CrossRefMathSciNetGoogle Scholar
  30. [30]
    M. Flatt, S. Krishnamurthi, and M. Felleisen. Classes and mixins. In Proc. POPL’ 98, pages 171–183, 1998.Google Scholar
  31. [31]
    M. Hofmann and B. C. Pierce. Positive subtyping. Information and Computation, 126(1):11–33, 1996. Preliminary version appeared in Proc. POPL’ 95.CrossRefMathSciNetGoogle Scholar
  32. [32]
    S. Kamin and U. Reddy. Two semantic models of object-oriented languages. In C. Gunther and J. C. Mitchell, editors, Theoretical Aspects of Object-Oriented Programming. MIT Press, 1994.Google Scholar
  33. [33]
    S. Keene. Object-Oriented Programming in Common Lisp. Addison-Wesley, 1989Google Scholar
  34. [34]
    X. Leroy, D. Rémy, J. Vouillon, and D. Doligez. The Objective Caml system, documentation and user’s guide. http://caml.inria.fr/ocaml/htmlman/, 1999.
  35. [35]
    M. Van Limberghen and T. Mens. Encapsulation and composition as orthogonal operators on mixins: a solution to multiple inheritance problems. Object Oriented Systems, 3(1):1–30, 1996.Google Scholar
  36. [36]
    O. Lehrmann Madsen, B. Moller-Pedersen, and K. Nygaard. Object-Oriented Programming in the BETA Language. Addison-Wesley, 1993.Google Scholar
  37. [37]
    I. Mason and C. Talcott. Programming, transforming, and proving with function abstractions and memories. In Proc. ICALP’ 89, pages 574–588. LNCS 372, Springer-Verlag, 1989.Google Scholar
  38. [38]
    D. Moon. Object-oriented programming with Flavors. In Proc. OOPSLA’ 86, pages 1–8, 1986.Google Scholar
  39. [39]
    B. C. Pierce and D. N. Turner. Simple type-theoretic foundations for object-oriented programming. J. Functional Programming, 4(2):207–248, 1994. Preliminary version appeared in Proc. POPL’ 93 under the title Object-Oriented Programming Without Recursive Types.MATHGoogle Scholar
  40. [40]
    U. Reddy. Objects as closures: Abstract semantics of object-oriented languages. In Proc. Conference on Lisp and Functional Programming, pages 289–297, 1988.Google Scholar
  41. [41]
    Y. Smaragdakis and D. Batory. Implementing layered designs with mixin layers. In Proc. ECOOP’ 98, pages 550–570, 1998.Google Scholar
  42. [42]
    B. Stroustrup. The C++ Programming Language (3rd ed.). Addison-Wesley, 1997.Google Scholar
  43. [43]
    M. VanHilst and D. Notkin. Using role components to implement collaboration-based designs. In Proc. OOPSLA’ 96, pages 359–369, 1996.Google Scholar
  44. [44]
    M. Wand. Type inference for objects with instance variables and inheritance. In C. Gunther and J. C. Mitchell, editors, Theoretical Aspects of Object-Oriented Programming. MIT Press, 1994.Google Scholar
  45. [45]
    A. Wright and M. Felleisen. A syntactic approach to type soundness. Information and Computation, 115(1):38–94, 1994.MATHCrossRefMathSciNetGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1999

Authors and Affiliations

  • Viviana Bono
    • 1
    • 2
  • Amit Patel
    • 3
  • Vitaly Shmatikov
    • 3
  1. 1.School of Computer ScienceThe University of BirminghamBirminghamUK
  2. 2.Dipartimento di Informatica dell’Università di TorinoTorinoItaly
  3. 3.Computer Science DepartmentStanford UniversityStanfordUSA

Personalised recommendations