Abstract
Multiple inheritance and multiple dispatching are two sources of ambiguities in object-oriented languages. Solving ambiguities can be performed automatically, using techniques such as totally ordering the supertypes of each type or taking the order of the methods' arguments into account. Such implicit disambiguation has the drawback of being difficult to understand by the programmer and hiding programming errors. Conversely, solving ambiguities can be left up to the explicit intervention of the programmer. The most common explicit disambiguation technique in existing systems consists in defining new methods for ambiguous invocations. However, finding ambiguities and adding as few methods as possible is a difficult task, especially in multi-method systems. In this paper, we propose a tool to help the programmer solve multi-methods ambiguities. We show that there always exists a unique minimal set of method redefinitions that explicitly disambiguate a set of multi-methods. The tool offers two modes: batch, directly yielding the disambiguation set, or interactive, one signature of the disambiguation set at a time, allowing the programmer to either accept the method redefinition or to solve the ambiguity in any other way, which restarts the disambiguation algorithm. In both modes, for each method that is to be added, the programmer is given the set of methods that caused the ambiguity as an explanation.
Preview
Unable to display preview. Download preview PDF.
References
O. Agesen, L. Bak, C. Chambers, B.-W. Chang, U. Hölzle, J. Maloney, R. B. Smith, D. Ungar, and M. Wolcsko. The Self 3.0 Programmer's Reference Manual. Sun Microsystems and Stanford University, 1993. Available by ftp from self.stanford.edu as /pub/Self-3.0/manuals/progRef.ps.gz.
E. Amiel, M.-J. Bellosta, E. Dujardin, and E. Simon. Supporting exceptions to schema consistency to ease schema evolution. In Proc. Intl. Conf. on VLDB, 1994.
A. Albano, R. Bergamini, G. Ghelli, and R. Orsini. An object data model with roles. In Proc. Intl. Conf. on Very Large Data Bases, 1993.
R. Agrawal, L. G. DeMichiel, and B. G. Lindsay. Static type checking of multi-methods. In Proc. OOPSLA, 1991.
E. Amiel, O. Gruber, and E. Simon. Optimizing multi-methods dispatch using compressed dispatch tables. In Proc. OOPSLA, 1994.
Apple Computer. Dylan Reference Manual, draft, September 1995. Available from the Dylan Home Page on the World-Wide Web at address http://www.cambridge.apple.com/dylan/dylan.html.
D. G. Bobrow, L. G. DeMichiel, R. P. Gabriel, S. Keene, G. Kiczales, and D. A. Moon. Common Lisp Object System specification. SIGPLAN Notices, 23, Sept. 1988.
A. H. Borning and D. H. H. Ingalls. Multiple inheritance in Smalltalk-80. In Proc. AAAI, 1982.
D. G. Bobrow, K. Kahn, G. Kiczales, L. Masinter, M. Stefik, and F. Zdybel. Common-Loops: Merging Lisp and object-oriented programming. In Proc. OOPSLA, 1986.
J. Banerjee, W. Kim, H.J. Kim, and H. F. Korth. Semantics and implementation of schema evolution in object-oriented databases. In Proc. ACM SIGMOD Intl. Conf. on Management Of Data, 1987.
Yves Caseau. Efficient handling of multiple inheritance hierarchies. In Proc. OOPSLA, 1993.
G. Curry, L. Baer, D. Lipkie, and B. Lee. Traits: An approach to multiple-inheritance subclassing. In Proc. ACM SIGOA Conference on Office Automation Systems, 1982.
B. Carré and J.-M. Geib. The point of view notion for multiple inheritance. In Proc. ECOOP/OOPSLA, 1990.
C. Chambers. Object-oriented multi-methods in Cecil. In Proc. ECOOP, 1992.
C. Chambers. The Cecil language, specification and rationale. Technical Report 93-03-05, Dept of Computer Science and Engineering, FR-35, University of Washington, March 1993.
Yves Caseau and Laurent Perron. Attaching second-order types to methods in an object-oriented language. In Proc. ECOOP, 1993.
C. Chambers, D. Ungar, B.-W. Chang, and U. Hoelzle. Parents are shared parts of objects: inheritance and encapsulation in SELF. Lisp and Symbolic Computation, 4(3), 1991.
L. G. DeMichiel, D. D. Chamberlin, B. G. Lindsay, R. Agrawal, and M. Arya. Polyglot: Extensions to relational databases for sharable types and functions in a multi-language environment. In Proc. Intl. Conf. on Data Engineering, 1993.
R. Ducournau and M. Habib. La multiplicité de l'héritage dans les langages à objets. Technique et Science Informatiques, January 1989.
R. Ducournau, M. Habib, M. Huchard, and M.L. Mugnier. Monotonic conflict resolution mechanisms for inheritance. In Proc. OOPSLA, 1992.
R. Ducournau, M. Habib, M. Huchard, and M.L. Mugnier. Proposal for a monotonic multiple inheritance linearization. In Proc. OOPSLA, 1994.
S. Danforth and E. Simon. The Next Generation of Information Systems — from Data to Knowledge, chapter A Data and Operation Model for Advanced Database Systems. Springer Verlag, 1992.
M. A. Ellis and B. Stroustrup. The annotated C++ reference manual. Addison-Wesley, Reading, Mass., 1992.
D. Knuth. The Art of Computer Programming, Fundamental Algorithms, Second Edition. Addison-Wesley, 1973.
C. Lecluse and P. Richard. Manipulation of structured values in object-oriented databases. In Proc. Intl. Workshop on Database Programming Languages, 1989.
B. Meyer. EIFFEL: The Language. Prentice Hall Intl., 1992.
José Meseguer, Joseph Goguen, and Gert Smolka. Order-sorted unification. Journal of Symbolic Computation, 8:383–413, 1989.
W. B. Mugridge, J. Hamer, and J. G. Hosking. Multi-methods in a statically-typed programming language. In Proc. ECOOP, 1991.
D. A. Moon. Object-oriented programming with Flavors. In Proc. OOPSLA, 1986.
O2 Technology. The O 2 User's Manual, 1992.
M. Stefik and D. G. Bobrow. Object-oriented programming: Themes and variations. The AI Magazine, 6(4), 1986.
C. Schaffert, T. Cooper, B. Bullis, M. Kilian, and C. Wilpot. An introduction to Trellis/Owl. In Proc. OOPSLA, 1986.
Self 3.0 — about this release. Available by ftp from self.stanford.edu as /pub/Self3.0/manuals/aboutThisRelease.ps.gz, 1993.
A. Snyder. CommonObjects: An overview. Sigplan Notices, 21(10), 1986.
A. Snyder. Encapsulation and inheritance in object-oriented programming languages. In Proc. OOPSLA, 1986.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1996 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Amiel, E., Dujardin, E. (1996). Supporting explicit disambiguation of multi-methods. In: Cointe, P. (eds) ECOOP ’96 — Object-Oriented Programming. ECOOP 1996. Lecture Notes in Computer Science, vol 1098. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0053061
Download citation
DOI: https://doi.org/10.1007/BFb0053061
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-61439-5
Online ISBN: 978-3-540-68570-8
eBook Packages: Springer Book Archive