Abstract
This paper introduces a notion of partial type assignment on left linear applicative term rewriting systems that is based on the extension defined by Mycroft of Curry's type assignment system. The left linear applicative TRS we consider are extensions to those suggested by most functional programming languages in that they do not discriminate against the varieties of function symbols that can be used in patterns. As such there is no distinction between function symbols (such as append and plus) and constructor symbols (such as cons and succ). Terms and rewrite rules will be written as trees, and type assignment will consist of assigning types to function symbols, nodes and edges between nodes. The only constraints on this system are imposed by the relation between the type assigned to a node and those assigned to its incoming and out-going edges. We will show that every typeable term has a principal type, and formulate a needed and sufficient condition typeable rewrite rules should satisfy in order to gain preservance of types under rewriting. As an example we will show that the optimisation function performed after bracket abstraction is typeable. Finally we will present a type check algorithm that checks if rewrite rules are correctly typed, and finds the principal pair for typeable terms.
Supported by the Esprit Basic Research Action 3074 “Semagraph”.
Partially supported by the Netherlands Organisation for the advancement of pure research (N.W.O.).
Preview
Unable to display preview. Download preview PDF.
References
H. Barendregt. The lambda calculus: its syntax and semantics. North-Holland, Amsterdam, revised edition, 1984.
H. Barendregt, M. Coppo, and M. Dezani-Ciancaglini. A filter lambda model and the completeness of type assignment. The Journal of Symbolic Logic, 48(4):931–940, 1983.
H.P. Barendregt, M.C.J.D. van Eekelen, J.R.W. Glauert, J.R. Kennaway, M.J. Plasmeijer, and M.R. Sleep. Term graph rewriting. In Proceedings of PARLE, Parallel Architectures and Languages Europe, Eindhoven, The Netherlands, volume 259-II of Lecture Notes in Computer Science, pages 141–158. Springer-Verlag, 1987.
T. Brus, M.C.J.D. van Eekelen, M.O. van Leer, and M.J. Plasmeijer. Clean — A Language for Functional Graph Rewriting. In Proceedings of the Third International Conference on Functional Programming Languages and Computer Architecture, Portland, Oregon, USA, volume 274 of Lecture Notes in Computer Science, pages 364–368. Springer-Verlag, 1987.
H.B. Curry and R. Feys. Combinatory Logic, volume 1. North-Holland, Amsterdam, 1958.
L.M.M. Damas. Type Assignment in Programming Languages. PhD thesis, University of Edinburgh, Department of Computer Science, Edinburgh, 1985. Thesis CST-33-85.
K. Futatsugi, J. Goguen, J.P. Jouannaud, and J. Meseguer. Principles of OBJ2. In Proceedings 12th ACM Symposium on Principles of Programming Languages, pages 52–66, 1985.
J.R. Hindley. The principal type scheme of an object in combinatory logic. Transactions of the American Mathematical Society, 146:29–60, 1969.
J.W. Klop. Term Rewriting Systems. Report CS-R9073, Centre for Mathematics and Computer Science, Amsterdam, 1990.
A.J. Kfoury, J. Tiuryn, and P. Urzyczyn. A proper extension of ML with an effective type-assignment. In Proceedings of the Fifteenth Annual ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages, pages 58–69, San Diego, California, 1988.
R. Milner. A theory of type polymorphism in programming. Journal of Computer and System Sciences, 17:348–375, 1978.
A. Mycroft. Polymorphic type schemes and recursive definitions. In Proceedings of the International Symposium on Programming, Toulouse, volume 167 of Lecture Notes Computer Science, pages 217–239. Springer-Verlag, 1984.
E.G.J.M.H. Nöcker, J.E.W. Smetsers, M.C.J.D. van Eekelen, and M.J. Plasmeijer. Concurrent Clean. In Proceedings of PARLE '91, Parallel Architectures and Languages Europe, Eindhoven, The Netherlands, volume 506-II of Lecture Notes in Computer Science, pages 202–219. Springer-Verlag, 1991.
F. Pfenning. Partial Polymorphic Type Inference and Higher-Order Unification. In Proceedings of the conference on Functional Programming Languages and Computer Architecture, volume 201 of Lecture Notes in Computer Science, pages 1–16. Springer-Verlag, 1985.
J.A. Robinson. A machine-oriented logic based on the resolution principle. Journal of the ACM, 12(1):23–41, 1965.
D.A. Turner. Miranda: A non-strict functional language with polymorphic types. In Proceedings of the conference on Functional Programming Languages and Computer Architecture, volume 201 of Lecture Notes in Computer Science, pages 1–16. Springer-Verlag, 1985.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1992 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
van Bakel, S., Smetsers, S., Brock, S. (1992). Partial type assignment in left linear applicative term rewriting systems. In: Raoult, J.C. (eds) CAAP '92. CAAP 1992. Lecture Notes in Computer Science, vol 581. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-55251-0_17
Download citation
DOI: https://doi.org/10.1007/3-540-55251-0_17
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-55251-2
Online ISBN: 978-3-540-46799-1
eBook Packages: Springer Book Archive