Abstract
The traditional purpose of types in programming languages of providing correctness assurances at compile time is increasingly being supplemented by a direct role for them in the computational process. In the context of typed logic programming, this is manifest in their effect on the unification operation. Their influence takes two different forms. First, in a situation where polymorphism is permitted, type information is needed to determine if different occurrences of the same name in fact denote an identical constant. Second, type information may determine the form of bindings for variables. When types are needed for the second purpose as in the case of higher-order unification, these have to be available with every variable and constant. However, in situations such as first-order and higher-order pattern unification, types have no impact on the variable binding process. As a consequence, type examination is needed in these situations only for the first of the two purposes described and even here a careful preprocessing can considerably reduce their runtime footprint. We develop a scheme for treating types in these contexts that exploits this observation. Under this scheme, type information is elided in most cases and is embedded into term structure when this is not entirely possible. Our approach obviates types when properties known as definitional genericity and type preservation are satisfied and has the advantage of working even when these conditions are violated.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Hanus, M.: Horn clause programs with polymorphic types: Semantics and resolution. In: Díaz, J., Orejas, F. (eds.) TAPSOFT 1989 and CCIPL 1989. LNCS, vol. 352, pp. 225–240. Springer, Heidelberg (1989)
Hanus, M.: Polymorphic higher-order programming in Prolog. In: Levi, G., Martelli, M. (eds.) Proceedings of the Sixth International Logic Programming Conference, pp. 382–398. MIT Press, Cambridge (1989)
Huet, G.: A unification algorithm for typed λ-calculus. Theoretical Computer Science 1, 27–57 (1975)
Kwon, K., Nadathur, G., Wilson, D.S.: Implementing polymorphic typing in a logic programming language. Computer Languages 20(1), 25–42 (1994)
Lakshman, T.K., Reddy, U.S.: Typed Prolog: A semantic reconstruction of the Mycroft-O’Keefe type system. In: Saraswat, V., Ueda, K. (eds.) Proceedings of the International Logic Programming Symposium, pp. 202–217. MIT Press, Cambridge (1991)
Michaylov, S., Pfenning, F.: An empirical study of the runtime behavior of higher-order logic programs. In: Conference Record of the Workshop on the λProlog Programming Language, Philadelphia (July-August 1992)
Miller, D.: A logic programming language with lambda-abstraction, function variables, and simple unification. Journal of Logic and Computation 1(4), 497–536 (1991)
Miller, D., Nadathur, G., Pfenning, F., Scedrov, A.: Uniform proofs as a foundation for logic programming. Annals of Pure and Applied Logic 51, 125–157 (1991)
Mycroft, A., O’Keefe, R.A.: A polymorphic type system for Prolog. Artificial Intelligence 23, 295–307 (1984)
Nadathur, G., Linnell, N.: Practical higher-order pattern unification with on-the-fly raising. Technical Report 2005/2, Digital Technology Center (April 2005); to appear in the Proceedings of ICLP 2005
Nadathur, G., Mitchell, D.J.: System description: Teyjus—a compiler and abstract machine based implementation of λProlog. In: Ganzinger, H. (ed.) CADE 1999. LNCS (LNAI), vol. 1632, pp. 287–291. Springer, Heidelberg (1999)
Nadathur, G., Pfenning, F.: The type system of a higher-order logic programming language. In: Pfenning, F. (ed.) Types in Logic Programming, pp. 245–283. MIT Press, Cambridge (1992)
Nipkow, T.: Functional unification of higher-order patterns. In: Eighth Annual IEEE Symposium on Logic in Computer Science, June 1993, pp. 64–74. IEEE Computer Society Press, Los Alamitos (1993)
Pfenning, F.: Elf: A language for logic definition and verified metaprogramming. In: Fourth Annual Symposium on Logic in Computer Science, pp. 313–322. IEEE Computer Society Press, Los Alamitos (June 1989)
Tarditi, D., Morrisett, G., Cheng, P., Stone, C., Harper, R., Lee, P.: TIL: A type-directed optimizing compiler for ML. In: Proc. ACM SIGPLAN 1996 Conference on Programming Language Design and Implementation, pp. 181–192 (1996)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2005 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Nadathur, G., Qi, X. (2005). Optimizing the Runtime Processing of Types in Polymorphic Logic Programming Languages. In: Sutcliffe, G., Voronkov, A. (eds) Logic for Programming, Artificial Intelligence, and Reasoning. LPAR 2005. Lecture Notes in Computer Science(), vol 3835. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11591191_9
Download citation
DOI: https://doi.org/10.1007/11591191_9
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-30553-8
Online ISBN: 978-3-540-31650-3
eBook Packages: Computer ScienceComputer Science (R0)