Skip to main content

Optimizing the Runtime Processing of Types in Polymorphic Logic Programming Languages

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNAI,volume 3835))

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.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   84.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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)

    Google Scholar 

  2. 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)

    Google Scholar 

  3. Huet, G.: A unification algorithm for typed λ-calculus. Theoretical Computer Science 1, 27–57 (1975)

    Article  MathSciNet  Google Scholar 

  4. Kwon, K., Nadathur, G., Wilson, D.S.: Implementing polymorphic typing in a logic programming language. Computer Languages 20(1), 25–42 (1994)

    Article  MATH  Google Scholar 

  5. 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)

    Google Scholar 

  6. 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)

    Google Scholar 

  7. Miller, D.: A logic programming language with lambda-abstraction, function variables, and simple unification. Journal of Logic and Computation 1(4), 497–536 (1991)

    Article  MATH  MathSciNet  Google Scholar 

  8. 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)

    Article  MATH  MathSciNet  Google Scholar 

  9. Mycroft, A., O’Keefe, R.A.: A polymorphic type system for Prolog. Artificial Intelligence 23, 295–307 (1984)

    Article  MATH  MathSciNet  Google Scholar 

  10. 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

    Google Scholar 

  11. 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)

    Chapter  Google Scholar 

  12. 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)

    Google Scholar 

  13. 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)

    Chapter  Google Scholar 

  14. 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)

    Chapter  Google Scholar 

  15. 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)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics