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.
- Ada 83 Reference Manual for the Ada Progrcunming Language, ANSI/MIL-STD 1815A, 1983.Google Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- Barnes 91 J. G. P. Barnes. Programming in Ada (third edition). Addison-Wesley, Wokingham, England, 1991.Google Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- 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 Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- Goldberg & Robson 83 Adele Goldberg and David Robson. Smalltalk-80: The Language and its implementation,.Addison- Wesley, Reading, Mass., 1983. Google ScholarDigital Library
- Goguen 84 Joseph A. Goguen. Parameterized Programming. In IEEE Transactions on Software Engineering 10(5), pp. 528-543, September, 1984.Google ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Leavens 91 Gary T. Leavens. Modular Specification and Verification of Object-Oriented Programs. IEEE Software 8(4), pp. 72-80, July, 1991. Google ScholarDigital Library
- 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 Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Meyer 88 Bertrand Meyer. Object-Oriented Software Construction. Prentice Hall, New York, 1998. Google ScholarDigital Library
- Meyer 92 Bertrand Meyer. Eiffel: The Language. Prentice Hall, New York, 1992. Google ScholarDigital Library
- Milner et al. 90 Robin Milner, Mads Tofte, and Robert Harper. The Definition of Standard ML. MIT Press, Cambridge, MA, 1990. Google ScholarDigital Library
- Mössenböck & Wirth 91 H. M6ssenb6ck and Niklaus Wirth. The Programming Language Oberon-2. Structured Programming 12(4), 1991.Google Scholar
- 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 ScholarDigital Library
- Nelson 91 Greg Nelson, editor. Systems Programming with Modula-3. Prentice Hall, Englewood Cliffs, NJ, 1991. Google ScholarDigital Library
- Paepcke 93 Andreas Paepcke. Object-Oriented Programming: The CLOS Perspective. MIT Press, 1993. Google ScholarDigital Library
- Palsberg & Schwartzbach 94 Jens Palsberg and Michael I. Schwartzbach. Object-Oriented Type Systems. John Wiley & Sons, 1994. Google ScholarDigital Library
- Parnas 71 D. L. Parnas. Information Distribution Aspects of Design Methodology. Proceedings of IFIP Congress 71. IFIP, 1971.Google Scholar
- 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 ScholarDigital Library
- Paulson 91 Laurence C. Paulson. MLfor the Working Programmer. Cambridge University Press, 1991. Google ScholarDigital Library
- Pierce & Turner 92 Benjamin C. Pierce and David N. Turner. Statically Typed Multi-Methods via Partially Abstract Types. Unpublished manuscript, October, 1992.Google Scholar
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- 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 ScholarDigital Library
- Steele 90 Guy L. Steele Jr. Common Lisp: The Language (second edition). Digital Press, Bedford, MA, 1990. Google ScholarDigital Library
- Stroustrup 91 Bjarne Stroustrup. The C++ Programming Language (second edition). Addison-Wesley, Reading, MA, 1991. Google ScholarDigital Library
- 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 ScholarDigital Library
- Touretzky 86 D. Touretzky. The Mathematics of Inheritance Systems. Morgan-Kaufmann, 1986. Google ScholarDigital Library
- 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 ScholarDigital Library
- Wirth 88 Niklaus Wirth. Programming in Modula-2 (fourth edition). Springer-Verlag, Berlin, 1988. Google ScholarDigital Library
Index Terms
- Typechecking and modules for multi-methods
Recommendations
Typechecking and modules for multi-methods
OOPSLA '94: Proceedings of the ninth annual conference on Object-oriented programming systems, language, and applicationsTwo 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. ...
Tridirectional typechecking
POPL '04In prior work we introduced a pure type assignment system that encompasses a rich set of property types, including intersections, unions, and universally and existentially quantified dependent types. This system was shown sound with respect to a call-by-...
Comments