skip to main content
article
Free Access

Typechecking and modules for multi-methods

Authors Info & Claims
Published:01 October 1994Publication History
Skip Abstract Section

Abstract

Two major obstacles hindering the wider acceptance of multi-methods are concerns over the lack of encapsulation and modularity and the absence of static typechecking in existing multi-method-based languages. This paper addresses both of these problems. We present a polynomial-time static typechecking algorithm that checks the conformance, completeness, and consistency of a group of method implementations with respect to declared message signatures. This algorithm improves on previous algorithms by handling separate type and inheritance hierarchies, abstract classes, and graph-based method lookup semantics. We also present a module system that enables independently-developed code to be fully encapsulated and statically typechecked on a per-module basis. To guarantee that potential conflicts between independently-developed modules have been resolved, a simple well-formedness condition on the modules comprising a program is checked at link-time. The typechecking algorithm and module system are applicable to a range of multi-method-based languages, but the paper uses the Cecil language as a concrete example of how they can be applied.

References

  1. Ada 83 Reference Manual for the Ada Progrcunming Language, ANSI/MIL-STD 1815A, 1983.Google ScholarGoogle Scholar
  2. Agrawal et al. 91 Rakesh Agrawal, Linda G. DeMichiel, and Bruce G. Lindsay. Static Type Checking of Multi-Methods. in OOPSLA 91 Conference Proceedings, pp. 113-128, Phoenix, AZ, October, 1991. Published as SIGPLAN Notices 26(11), November, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. America 87 Pierre America. Inheritance and Subtyping in a Parallel Object-Oriented Language. In ECOOP '87 Conference Proceedings, pp. 234-242, Paris, France, June, 1987. Published as Lecture Notes in Computer Science 276, Springer-Verlag, Berlin, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. America & van der Linden 90 Pierre America and Frank van der Linden. A Parallel Object-Oriented Language with inheritance and Subtyping. In OOPS1.A/ECOOP '90 Conference Proceedings, pp. 161-168, Ottawa, Canada, October, 1990. Published as SIGPLAN Notices 25(10), October, 1990. Google ScholarGoogle Scholar
  5. Amiel et al. 94 Eric Amiel, Olivier Gruber, and Eric Simon. Optimizing Multi-Method Dispatch Using Compressed Dispatch Tables. In OOPSLA '94 Conference Proceedings, Portland, OR, October, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Barnes 91 J. G. P. Barnes. Programming in Ada (third edition). Addison-Wesley, Wokingham, England, 1991.Google ScholarGoogle Scholar
  7. Bobrow et al. 88 D. G. Bobrow, L. G. DeMichiel, R. P. Gabriel, S. E. Keene, G. Kiczales, D. A. Moon. Common Lisp Object System Specification X3J13. In SIGPLAN Notices 23(Special Issue), September, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Bracha & Griswold 93 Gilad Bracha and David Griswold. Strongtalk: Typechecking Smalltalk in a Production Environment. In OOPSLA '93 Conference Proceedings, pp. 215- 230, Washington, D.C., September, 1993. Published as SIGPLAN Notices 28(10), October, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Bruce et al. 93 Kim B. Bruce, Jon Crabtree, Thomas P. Murtagh, Robert van Gent, Allyn Dimock, and Robert Muller. Safe and Decidable Type Checking in an Object-Oriented Language. In OOPSLA '93 Conference Proceedings, pp. 29-46, Washington, D.C., September, 1993. Published as SIGPLAN Notices 28(10), October, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Canning et al. 89 Peter S. Canning, William R. Cook, Walter L. Hill, and Walter G. Olthoff. Interfaces for Strongly-Typed Object- Oriented Programming. In OOPSLA '89 Conference Proceedings, .pp. 457-467, New Orleans, LA, October, 1989. Published as SIGPLAN Notices 24(10), October, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Cardelli & Wegner 85 Luca Cardelli and Peter Wegner. On Understanding Types, Data Abstraction, and Polymorphism. In Computing Surveys 17(4), pp. 471-522, December, 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Cardelli & Mitchell 89 Luca Cardelli and John C. Mitchell. Operations on Records. In Proceedings of the International Conference on the Mathematical Foundation of Programming Semantics, New Orleans, LA, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Castagna et al. 92 Giuseppe Castagna, Giorgio Ghelli, and Giuseppe Longo. A Calculus for Overloaded Functions with Subtyping. In Proceedings of the 1992 ACM Conference on Lisp and Functional Progrcunming, pp. 182-192, San Francisco, June, 1992. Published as Lisp Pointers 5(1), January-March, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Chambers 92 Craig Chambers. Object-Oriented Multi-Methods in Cecil. In ECOOP '92 Conference Proceedings, pp. 33-56, Utrecht, the Netherlands, June/July, 1992. Published as Lecture Notes in Computer Science 615, Springer-Verlag, Berlin, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Chambers 93 Craig Chambers. The Cecil Language: Specification and Rationale. Technical report #93-03-05, Department of Computer Science and Engineering, University of Washington, March, 1993.Google ScholarGoogle Scholar
  16. Chambers & Leavens 94 Craig Chambers and Gary T. Leavens. Type.checking and Modules for Multi-Methods. Technical report #94-03-01, Department of Computer Science and Engineering, University of Washington, March, 1994.Google ScholarGoogle Scholar
  17. Chen & Turau 94 Weimin Chen and Volker Turau. Efficient Dynamic Look-Up Strategy for Multi-Methods. In ECOOP '94 Conference Proceedings, Bologna, Italy, July, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Cook et al. 90 William Cook, Walter Hill, and Peter Canning. Inheritance is not Subtyping. In Conference Record of the 17th Annual A CM Symposium on Principles of Progrtunming Languages, San Francisco, CA, January, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Cook 90 William Cook. Object-Oriented Programming versus Abstract Data Types. In Proceedings of the Workshop on the Foundations of Object-Oriented Languages, pp. 151-178, Noordwijkerhout, the Netherlands, May/June, 1990. Published as Lecture Notes in Computer Science 489, Springer-Verlag, New York, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Dean et al. 94 Jeffrey Dean, Craig Chambers, and David Grove. Identifying Profitable Specialization in Object-Oriented Languages. In Proceedings of the ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation, Orlando, FL, June, 1994. Available as Technical Report 94/9, Department of Computer Science, University of Melbourne, 1994.Google ScholarGoogle Scholar
  21. Ghelli 91 Giorgio Ghelli. A Static Type System for Message Passing. In OOPSLA '91 Conference Proceedings, pp. 129-145, Phoenix, AZ, October, 1991. Published as SIGPLAN Notices 26(11), November, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Goldberg & Robson 83 Adele Goldberg and David Robson. Smalltalk-80: The Language and its implementation,.Addison- Wesley, Reading, Mass., 1983. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Goguen 84 Joseph A. Goguen. Parameterized Programming. In IEEE Transactions on Software Engineering 10(5), pp. 528-543, September, 1984.Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Harrison & Ossher 93 William HalTison and Harold Ossher. Subject-Oriented Programming (A Critique of Pure Objects). In OOPSLA '93 Conference Proceedings, pp. 411-428, Washington, D.C., September, 1993. Published as SIGPLAN Notices 28(10), October, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Hölzle 93 Urs H61zle. Integrating Independently-Developed Components in Object-Oriented Languages. In ECOOP '93 Conference Proceedings, pp. 36~56, Kaiserslautem, Germany, July, 1993. Published as Lecture Notes in Computer Science 707, Springer-Verlag, Berlin, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Hudak et al. 92 Paul Hudak, Simon Peyton Jones, Philip Wadler, Brian Boutel, Jon Fairbairn, Joseph Fasel, Mar/a M. Guzm,'in, Kevin Hammond, John Hughes, Thomas Johnsson, Dick Kieburtz, Rishiyur Nikhil, Will Partain, and John Peterson. Report on the Programming Language Haskell: A Non-strict, Purely Functional Language. Version 1.2. In SIGPLAN Notices 27(5), May, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Leavens 91 Gary T. Leavens. Modular Specification and Verification of Object-Oriented Programs. IEEE Software 8(4), pp. 72-80, July, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Leavens & Weihl 90 Gary T. Leavens and William E. Weihl. Reasoning about Object-Oriented Programs that use Subtypes. In OOPSZA/ECOOP "90 Conference Proceedings, pp. 212-223, Ottawa, Canada, October, 1990. Published as SIGPLAN Notices 25(10), October, 1990. Google ScholarGoogle Scholar
  29. Liskov et al. 77 Barbara Liskov, Alan Snyder, Russell Atkinson, and J. Craig Schaffert. Abstraction Mechanisms in CLU. In Communications of the ACM 20(8), pp. 564-576, August, 1977. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Liskov et al. 81 Barbara Liskov, Russell Atkinson, Toby Bloom, Eliot Moss, J. Craig Schaffert, Robert Scheifler, and Alan Snyder. CLU Reference Manual. Lecture Notes in Computer Science, volume 114, Springer-Verlag, New York, NY, 1981.Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Liskov & Zilles 74 Barbara H. Liskov and Stephen N. Zilles. Programming with Abstract Data Types. In Proceedings of the ACM SIGPLAN Conference on Very High Level Langl~ages, pp. 50-59, April, 1974. Published as SIGPLAN Notices 9(4), 1974. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Meyer 88 Bertrand Meyer. Object-Oriented Software Construction. Prentice Hall, New York, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Meyer 92 Bertrand Meyer. Eiffel: The Language. Prentice Hall, New York, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Milner et al. 90 Robin Milner, Mads Tofte, and Robert Harper. The Definition of Standard ML. MIT Press, Cambridge, MA, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Mössenböck & Wirth 91 H. M6ssenb6ck and Niklaus Wirth. The Programming Language Oberon-2. Structured Programming 12(4), 1991.Google ScholarGoogle Scholar
  36. Mugridge et al. 91 W. B. Mugridge, J. G. Hosking, and J. Hamer. Multi-Methods in a Statically-Typed Programming Language. Technical report #50, Department of Computer Science, University of Auckland, 1991. Also appears in ECOOP '91 Conference Proceedings, Geneva, Switzerland, July, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Nelson 91 Greg Nelson, editor. Systems Programming with Modula-3. Prentice Hall, Englewood Cliffs, NJ, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. Paepcke 93 Andreas Paepcke. Object-Oriented Programming: The CLOS Perspective. MIT Press, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. Palsberg & Schwartzbach 94 Jens Palsberg and Michael I. Schwartzbach. Object-Oriented Type Systems. John Wiley & Sons, 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Parnas 71 D. L. Parnas. Information Distribution Aspects of Design Methodology. Proceedings of IFIP Congress 71. IFIP, 1971.Google ScholarGoogle Scholar
  41. Parnas 72 D. L. Parnas. On the Criteria to be Used in Decomposing Systems into Modules. In Communications ofthe ACM 15(5), pp. 330-336, May, 1972. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Paulson 91 Laurence C. Paulson. MLfor the Working Programmer. Cambridge University Press, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Pierce & Turner 92 Benjamin C. Pierce and David N. Turner. Statically Typed Multi-Methods via Partially Abstract Types. Unpublished manuscript, October, 1992.Google ScholarGoogle Scholar
  44. Rouaix 90 Francois Rouaix. Safe Run-Tune Overloading. In Conference Record of the 17th Annual A CM Symposium on Principles of Progranm~ing Languages, pp. 355-366, San Francisco, CA, January, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Schaffert et al. 86 Craig Schaffert, Topher Cooper, Bruce Bullis, Mike Kilian, and Carrie Wilpolt. An Introduction to TreUis/Owl. In OOPSLA '86 Conference Proceedings, pp. 9-16, Portland, OR, September, 1986. Published as SIGPLAN Notices 21(11), November, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Snyder 86 Alan Snyder. Encapsulation and Inheritance in Object- Oriented Programming Languages. In OOPSLA '86 Conference Proceedings, pp. 38-45, Portland, OR, September, 1986. Published as SIGPLAN Notices 21(11), November, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. Steele 90 Guy L. Steele Jr. Common Lisp: The Language (second edition). Digital Press, Bedford, MA, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. Stroustrup 91 Bjarne Stroustrup. The C++ Programming Language (second edition). Addison-Wesley, Reading, MA, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. Szyperski 92 Clemens A. Szyperski. Import is Not Inheritance - Why We Need Both: Modules and Classes. In ECOOP '92 Conference Proceedings, pp. 19-32, Utrecht, the Netherlands, June/July, 1992. Published as Lecture Notes in Computer Science 615, Springer-Verlag, Berlin, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. Touretzky 86 D. Touretzky. The Mathematics of Inheritance Systems. Morgan-Kaufmann, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. Wirfs-Brock & Wilkerson 88 Allen Wiffs-Brock and Brian Wilkerson. An Overview of Modular Smalltalk. In OOPSLA '88 Conference Proceedings, pp. 123-134, San Diego, CA, October, 1988. Published as SIGPLAN Notices 23(11), November, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. Wirth 88 Niklaus Wirth. Programming in Modula-2 (fourth edition). Springer-Verlag, Berlin, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Typechecking and modules for multi-methods

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Published in

          cover image ACM SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 29, Issue 10
          Oct. 1994
          473 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/191081
          Issue’s Table of Contents
          • cover image ACM Conferences
            OOPSLA '94: Proceedings of the ninth annual conference on Object-oriented programming systems, language, and applications
            October 1994
            476 pages
            ISBN:0897916883
            DOI:10.1145/191080

          Copyright © 1994 ACM

          Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 1 October 1994

          Check for updates

          Qualifiers

          • article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader