Abstract
In functional programming environments, one can use types as search keys in program libraries, if one disregards trivial differences in argument order or currying. A way to do this is to identify types that are isomorphic in every Cartesian closed category; simpler put, types should be identified if they are equal under an arithmetic interpretation, with Cartesian product as multiplication and function space as exponentiation. When the type system is polymorphic, one may also want to retrieve identifiers of types more general than the query. This paper describes a method to do both, that is, an algorithm for pattern matching modulo canonical CCC-isomorphism. The algorithm returns a finite complete set of matchers. An implementation shows that satisfactory speed can be achieved for library search.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
L. Augustsson and T. Johnsson. The Chalmers Lazy-ML compiler. The Computer Journal, 32(2), 1989.
F. Fages and G. Huet. Complete sets of unifiers and matchers in equational theories. Theoretical Comp. Sci., 43:189–200, 1986.
P. Hancock. A type-checker. In S.L. Peyton Jones, The Implementation of Functional Programming Languages, chapter 9. Prentice-Hall, 1987.
J.M. Hullot. Associative commutative pattern matching. In Sixth Int. Joint Conf. on Artificial Intelligence, Tokyo, 1979.
B. Lang. Matching with multiplication and exponentiation, May 1978. Author's current address: INRIA, Domaine de Voluceau, Rocquencourt, B.P. 105, F-78153 Le Chesnay Cedex, France. E-mail: lang@inria.fr
G. Longo, A. Asperti, and R. Di Cosmo. Coherence and valid isomorphism in closed categories. In D.H. Pitt et al., eds., Category Theory and Computer Science, Manchester, 1989. LNCS 389, Springer-Verlag.
C.F. Martin. Equational Theories of Natural Numbers and Transfinite Ordinals. PhD thesis 1973. University of California, Berkeley, CA 94720, USA. See also Notices of the Am. Math. Soc., 19(7):A-778-779, Abstract 698-E1, 1972.
R. Milner. A theory of type polymorphism in programming. J. of Comp. and System Sci., 17(3):348–375, 1978.
P. Narendran, F. Pfenning, and R. Statman. On the unification problem for Cartesian closed categories, 1989. Addresses: P. Narendran, State Univ. of New York at Albany, USA. F. Pfenning and R. Statman, Carnegie Mellon Univ., Pittsburgh, USA. E-mail: dran@cssun.albany.edu, fp@cs.cmu.edu, statman@c.cs.cmu.edu
G.E. Peterson and M.E. Stickel. Complete sets of reductions for some equational theories. JACM, 28(2):233–264, April 1981.
P.W. Purdom, Jr. and C.A. Brown. Fast many-to-one matching algorithms. In J.-P. Jouannaud, ed., Rewriting Techniques and Applications, Dijon, France, 1985. LNCS 202, Springer-Verlag.
C. Reade. Elements of Functional Programming. Addison-Wesley, 1989.
M. Rittri. Using types as search keys in function libraries. In Fourth Int. Conf. on Functional Programming Languages and Computer Architecture, London, 1989. ACM Press, Addison-Wesley. (Part B of [14] is a revised version.)
M. Rittri. Searching Program Libraries by Type and Proving Compiler Correctness by Bisimulation. PhD thesis, 1990. Dept. of Comp. Sci., Chalmers U. of Tech. and U. of Göteborg, S-412 96 Göteborg, Sweden. E-mail: rittri@cs.chalmers.se
C. Runciman and I. Toyn. Retrieving re-usable software components by polymorphic type. In Fourth Int. Conf. on Functional Programming Languages and Computer Architecture, London, 1989. ACM Press, Addison-Wesley.
M. Schmidt-Schauß. Unification in a combination of arbitrary disjoint equational theories. J. of Symbolic Computation, 8:51–99, 1989.
J.H. Siekmann. Unification theory. J. of Symbolic Computation, 7:207–274, 1989.
S.V. Solov'ev. The category of finite sets and Cartesian closed categories. J. of Soviet Math., 22(3):1387–1400, 1983.
M.E. Stickel. A unification algorithm for associative-commutative functions. JACM, 28(3):423–434, July 1981.
E. Tidén. First-Order Unification in Combinations of Equational Theories. PhD thesis, 1986. Dept. of Num. Anal. and Comp. Sci., The R. Inst. of Technol., Stockholm, Sweden.
D.A. Turner. Miranda: A non-strict functional language with polymorphic types. In J.-P. Jouannaud, ed., Functional Programming Languages and Computer Architecture, Nancy, France, 1985. LNCS 201, pages 1–16, Springer-Verlag.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1990 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Rittri, M. (1990). Retrieving library identifiers via equational matching of types. In: Stickel, M.E. (eds) 10th International Conference on Automated Deduction. CADE 1990. Lecture Notes in Computer Science, vol 449. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-52885-7_117
Download citation
DOI: https://doi.org/10.1007/3-540-52885-7_117
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-52885-2
Online ISBN: 978-3-540-47171-4
eBook Packages: Springer Book Archive