Towards a formalization of programming-by-difference

  • I. Maung
  • J. R. Howse
  • R. J. Mitchell
Part of the Lecture Notes in Computer Science book series (LNCS, volume 873)


Programming-by-difference is a popular technique for incremental object-oriented programming, whereby a new class is built from an existing class using the inheritance mechanism. We give a formalization of this technique using model-based class specifications. This formalization is given in terms of a relation, as-a, between class specifications. We compare this relation with the established reification relation and with the is-a relation, and give some examples.


inheritance incremental programming design-by-contract subtype contravariance 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. America, P (1991) A behavioural approach to subtyping in object-oriented programming languages, in Lenzerini, Maurizio, Nardi, Daniele and Simi Maria (Editors), Inheritance hierarchies in knowledge representation and programming languages, Wiley, pp 173–190.Google Scholar
  2. America, P and de Boer, F (1990) A sound and complete proof system for SPOOL. Philips Research Labs, Eindhoven.Google Scholar
  3. Cook, WR (1989) A proposal for making Eiffel type-safe, The Computer Journal, 32.Google Scholar
  4. Cook, WR and Palsberg, J (1989) A Denotational Semantics of Inheritance and its Correctness, OOPSLA'89, ACM Press.Google Scholar
  5. Demmers, JWE and Kleingeld, P (1991) SPOOL-S: an object-oriented language with behavioural subtyping, MS Thesis, University of Utrecht.Google Scholar
  6. Dijkstra, EW and Scholten, CS (1989) Predicate Calculus and Program Semantics, Springer-Verlag.Google Scholar
  7. Haughton and Lano (1992) Reasoning and refinement in object-oriented specification languages, ECOOP'92.Google Scholar
  8. Hoare, CAR (1994) How did software get so reliable without proof? presented at the Workshop: From Science to Engineering... Formal Methods for the Next Millenium, Heriot-Watt University, Edinburgh.Google Scholar
  9. Howse, JR, Maung, I, Mitchell, RJ (1994) As-a: a formal relation justifying code reuse by inheritance, Technical Report, Computing Dept, Brighton University.Google Scholar
  10. Johnson, RE and Foote, B (1988) Designing reusable classes, Journal of Objectoriented Progamming, Vol 1, No 2, pp 22–35.Google Scholar
  11. Jones, CB (1990) Systematic software development with VDM, Prentice-Hall.Google Scholar
  12. Lano, K and Haughton, H (eds.) (1993) Object-oriented Specification Case studies, Prentice-Hall.Google Scholar
  13. Leavens, G and Weihl, W (1990) Reasoning about object oriented programs that use subtypes. OOPSLA'90, ACM Press.Google Scholar
  14. Liskov, B (1987) Data abstraction and hierarchy. OOPSLA'87, ACM Press.Google Scholar
  15. Liskov, B and Wing, J (1993) Family Values: A behavioural notion of Subtyping, Technical Report CMU-CS-93-187, Carnegie-Mellon University, July 1993, revised version of OOPSLA'93 and ECOOP'93 papers.Google Scholar
  16. Maung, I, Howse, JR and Mitchell, RJ (1994) Formalising programming by difference, Technical Report, Computing Dept, Brighton University.Google Scholar
  17. Meyer, B (1988) Object-oriented software construction, Prentice-Hall.Google Scholar
  18. Meyer, B (1992) Applying “Design by Contract”, IEEE Computer, October 1992.Google Scholar
  19. Mitchell, RJ, Howse, JR and Maung, I (1994) As-a: a relationship to support code reuse, accepted for publication in JOOP.Google Scholar
  20. Morgan, C, Robinson, K and Gardiner, P (1988) On the Refinement Calculus. Technical Monograph PRG-70, Oxford University Computing Lab.Google Scholar
  21. Porter, HH (1992) Separating the subtype hierarchy from the inheritance of implementation, JOOP, Vol 4, No 9, pp 20–29.Google Scholar
  22. Stepney, S, Barden, R and Cooper, D (editors) (1992) Object Orientation in Z, Workshops in Computing, Springer-Verlag.Google Scholar
  23. Turski, W and Maibaum, T (1987) The Specification of Computer Programs, Addison-Wesley.Google Scholar
  24. Utting, M (1992) An Object-Oriented Refinement Calculus with Modular Reasoning, PhD thesis, University of New South Wales, Australia.Google Scholar
  25. van Emden, M (1992) Rhetoric versus modernism in computing. Editorial, Journal of Logic and Computation, Vol. 2, No. 5, pp. 551–555.Google Scholar
  26. Wegner, P and Zdonik, SB (1988) Inheritance as an incremental modification mechanism or what like is and isn't like, Lecture Notes in Computer Science, Vol 322, Springer Verlag, pp 55–77.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1994

Authors and Affiliations

  • I. Maung
    • 1
  • J. R. Howse
    • 1
  • R. J. Mitchell
    • 1
  1. 1.Departments of Computing and Mathematical SciencesUniversity of BrightonBrightonEngland

Personalised recommendations