Abstract
Palsberg and Zhao [17] presented an O(n 2) time algorithm for matching two recursive types. In this paper, we present an O(n log n) algorithm for the same problem. Our algorithm works by reducing the type matching problem to the well-understood problem of finding a size-stable partition of a graph. Our result may help improve systems, such as Polyspin and Mockingbird, that are designed to facilitate interoperability of software components.We also discuss possible applications of our algorithm to Java. Issues related to subtyping of recursive types are also discussed.
Palsberg was supported by an NSF CAREER award, CCR-9734265, and by IBM.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
Roberto M. Amadio and Luca Cardelli. Subtyping recursive types. ACM Transactions on Programming Languages and Systems, 15(4):575–631, 1993. Also in Proceedings of POPL’91.
Joshua Auerbach, Charles Barton, and Mukund Raghavachari. Type isomorphisms with recursive types. Research report RC 21247, IBM Research Division, T. J. Watson Research Center, Yorktown Heights, NY, August 1998.
Joshua Auerbach and Mark C. Chu-Carroll. The mockingbird system: A compiler-based approach to maximally interoperable distributed programming. Research report RC 20718, IBM Research Division, T. J. Watson Research Center, Yorktown Heights, NY, February 1997.
Daniel J. Barrett, Alan Kaplan, and Jack C. Wileden. Automated support for seamless interoperability in polylingual software systems. In ACMSIGSOFT’96, Fourth Symposium on the Foundations of Software Engineering, San Francisco, California, October 1996.
B. Boehm and B. Scherlis. Megaprogramming. In Proceedings of DARPA Software Technology Conference, April 28–30, Meridien Corporation, Arlington, VA 1992.
Michael Brandt and Fritz Henglein. Coinductive axiomatization of recursive type equality and subtyping. In Proceedings of TLCA’97, 3rd International Conference on Typed Lambda Calculus and Applications, 1997.
Kim B. Bruce, Roberto Di Cosmo, and Giuseppe Longo. Provable isomorphisms of types. Mathematical Structures in Computer Science, 2(2):231–247, 1992.
Luca Cardelli and Peter Wegner. On understanding types, data abstraction, and polymorphism. ACM Computing Surveys, 17(4):471–522, December 1985.
Mario Coppo. Type inference with recursive type equations. In Proceedings of FOSSACS’01, Foundations of Software Science and Computation Structures, pages 184–198. Springer-Verlag (LNCS 2030), 2001.
Roberto Di Cosmo. Isomorphisms of Types: from λ-calculus to information retrieval and language design. Birkhäuser, 1995.
Bruno Courcelle. Fundamental properties of infinite trees. Theoretical Computer Science, 25(1):95–169, 1983.
Trevor Jim and Jens Palsberg. Type inference in systems of recursive types with subtyping. Manuscript, 1997.
Dexter Kozen, Jens Palsberg, and Michael I. Schwartzbach. Efficient recursive subtyping. Mathematical Structures in Computer Science, 5(1):113–125, 1995. Preliminary version in Proceedings of POPL’93, Twentieth Annual SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 419-428, Charleston, South Carolina, January 1993.
Paliath Narendran, Frank Pfenning, and Richard Statman. On the unification problem for Cartesian closed categories. In Proceedings, Eighth Annual IEEE Symposium on Logic in Computer Science, pages 57–63. IEEE Computer Society Press, 1993.
OMG. The common object request broker: Architecture and specification. Technical report, Object Management Group, 1999. Version 2.3.1.
Robert Paige and Robert Tarjan. Three partition refinement algorithms. SIAM Journal on Computing, 16(6):973–989, December 1987.
Jens Palsberg and Tian Zhao. Efficient and flexible matching of recursive types. Information and Computation, to appear. Preliminary version in Proceedings of LICS’00, Fifteenth Annual IEEE Symposium on Logic in Computer Science, pages 388–398, Santa Barbara, California, June 2000.
Mikael Rittri. Retrieving library identifiers via equational matching of types. In M. E. Stickel, editor, Proceedings of the 10th International Conference on Automated Deduction, volume 449 of LNAI, pages 603–617, Kaiserslautern, FRG, July 1990. Springer Verlag.
Mikael Rittri. Using types as search keys in function libraries. Journal of Functional Programming, 1(1):71–89, 1991.
Mikael Rittri. Retrieving library functions by unifying types modulo linear isomorphism. RAIRO Theoretical Informatics and Applications, 27(6):523–540, 1993.
Sergei V. Soloviev. The category of finite sets and cartesian closed categories. Journal of Soviet Mathematics, 22:1387–1400, 1983.
G. Wiederhold, P. Wegner, and S. Ceri. Towards Megaprogramming: A paradigm for component-based programming. Communications of the ACM, 35(11):89–99, November 1992.
A. M. Zaremski and J. M. Wing. Signature matching: a tool for using software libraries. ACM Transactions on Software Engineering Methodology, 4(2):146–170, April 1995.
A. M. Zaremski and J. M. Wing. Specification matching of software components. In Proceedings of 3rd ACM SIGSOFT Symposium on the Foundation of Software Engineering, pages 6–17, 1995.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2002 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Jha, S., Palsberg, J., Zhao, T. (2002). Efficient Type Matching. In: Nielsen, M., Engberg, U. (eds) Foundations of Software Science and Computation Structures. FoSSaCS 2002. Lecture Notes in Computer Science, vol 2303. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45931-6_14
Download citation
DOI: https://doi.org/10.1007/3-540-45931-6_14
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-43366-8
Online ISBN: 978-3-540-45931-6
eBook Packages: Springer Book Archive