Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to main content

Using Types as Approximations for Type Checking Prolog Programs

  • Conference paper
Functional and Logic Programming (FLOPS 1999)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 1722))

Included in the following conference series:

Abstract

Subtyping tends to undermine the effects of parametric polymorphism as far as the static detection of type errors is concerned. Starting with this observation we present a new approach for type checking logic programs to overcome these difficulties. The two basic ideas are, first, to interpret a predicate type declaration as an approximation for the success set of the predicate. Second, declarations are extended with type constraints such that they can be more refined than in other conventional type systems. The type system has been implemented in a system called Typical which provides a type checker for Standard Prolog enriched with type annotations.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.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

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. Aiken, A., Lakshman, T.K.: Directional type checking of logic programs. In: LeCharlier, B. (ed.) SAS 1994. LNCS, vol. 864. Springer, Heidelberg (1994)

    Google Scholar 

  2. Beierle, C.: Type inferencing for polymorphic order-sorted logic programs. In: Sterling, L. (ed.) Proc. of the 12th Int. Conf. on Logic Programming, Tokyo (June 1995)

    Google Scholar 

  3. Beierle, C., Meyer, G.: Run-time type computations in the Warren Abstract Machine. The Journal of Logic Programming 18(2), 123–148 (1994)

    Article  MATH  MathSciNet  Google Scholar 

  4. Boye, J., Maluszyńsky, J.: Two aspects of directional types. In: Sterling, L. (ed.) Logic Programming, Proceedings of the Twelfth International Conference on Logic Programming, Tokio, pp. 747–761. MIT Press, Cambridge (1995)

    Google Scholar 

  5. Bronsard, F., Lakshman, T., Reddy, U.S.: A framework of directionality for proving termination of logic programs. In: Apt, K.R. (ed.) Logic Programming: Proceedings of 1992 Joint International Conference and Symposium, pp. 321–335. The MIT Press, Cambridge (1992)

    Google Scholar 

  6. Cardelli, L., Wegner, P.: On understanding types, data abstraction, and polymorphism. ACM Computing Surveys 17, 471–522 (1986)

    Article  Google Scholar 

  7. Codish, M., Demoen, B.: Deriving polymorphic type dependencies for logic programs using multiple incarnations of Prop. In: LeCharlier, B. (ed.) SAS 1994. LNCS, vol. 864, pp. 281–296. Springer, Heidelberg (1994)

    Google Scholar 

  8. Hanus, M.: Horn clause programs with polymorphic types: Semantics and resolution. Theoretical Computer Science 89, 63–106 (1991)

    Article  MATH  MathSciNet  Google Scholar 

  9. Hanus, M.: Parametric order-sorted types in logic programming. In: Abramsky, S. (ed.) TAPSOFT 1991, CCPSD 1991, and ADC-Talks 1991. LNCS, vol. 494, pp. 181–200. Springer, Heidelberg (1991)

    Google Scholar 

  10. Hanus, M.: Logic programming with type specifications. In: Pfenning, F. (ed.) [24], ch. 3, pp. 91–140

    Google Scholar 

  11. Hill, P., Lloyd, J.: The Gödel Programming Language. Logic programming series. The MIT Press, Cambridge (1994)

    MATH  Google Scholar 

  12. Hill, P.M., Topor, R.W.: A semantics for typed logic programs. In: Pfenning, F. (ed.) [24], ch. 1, pp. 1–62

    Google Scholar 

  13. Höhfeld, M., Smolka, G.: Definite relations over constraint languages. IWBS Report 53, IBM Scientific Center, Stuttgart, Germany (October 1988)

    Google Scholar 

  14. Kifer, M., Wu, J.: A first-order theory of types and polymorphism in logic programming. Techn. Rep. 90/23, SUNY, New York (July 1990)

    Google Scholar 

  15. Lakshman, T.K., Reddy, U.S.: Typed Prolog: A semantic reconstruction of the Mycroft-O’Keefe type system. In: Saraswat, V., Ueda, K. (eds.) Int. Symp. On Logic Programming, ILPS 1991, San Diego, pp. 202–217 (1991)

    Google Scholar 

  16. Meyer, G.: Type checking and type inferencing for logic programs with subtypesand parametric polymorphism. Informatik Berichte 200, FernUniversität Hagen (June 1996), available via http://www.fernuni-hagen.de/pi8/typical/

  17. Meyer, G.: On Types and Type Consistency in Logic Programming. PhD thesis, FernUniversität Hagen, Germany (1999) (to appear)

    Google Scholar 

  18. Meyer, G., Beierle, C.: Dimensions of types in logic programming. In: Bibel, W., Schmitt, P.H. (eds.) Automated Deduction - A Basis for Applications, ch. 10. Kluwer Academic Publishers, Netherlands (1998)

    Google Scholar 

  19. Mishra, P.: Towards a theory of types in Prolog. In: Proceedings of the 1984 Symposium on Logic Programming, Atlantic City, New Jersey, pp. 289–298 (1984)

    Google Scholar 

  20. Mitchell, J.: Type inference and type containment. In: Plotkin, G., MacQueen, D.B., Kahn, G. (eds.) Semantics of Data Types 1984. LNCS, vol. 173, pp. 257–277. Springer, Heidelberg (1984)

    Google Scholar 

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

    Article  MATH  MathSciNet  Google Scholar 

  22. Naish, L.: Types and intended meaning. In: Pfenning, F. (ed.) [24], ch. 6, pp. 189–216.

    Google Scholar 

  23. Naish, L.: A declarative view of modes. In: Maher, M. (ed.) Proc. of the 1996 Joint International Conference and Symposium on Logic Programming, Bonn, pp. 185–199. The MIT Press, Cambridge (1996)

    Google Scholar 

  24. Pfenning, F. (ed.): Types in Logic Programming. Logic Programming Series. The MIT Press, Cambridge (1992)

    MATH  Google Scholar 

  25. Pyo, C., Reddy, U.S.: Inference of polymorphic types for logic program. In: Lusk, E., Overbeck, R. (eds.) Logic Programming, Proc. of the North American Conference, pp. 1115–1132 (1989)

    Google Scholar 

  26. Reddy, U.S.: Notions of polymorphism for predicate logic programs. In: Int. Conf. on Logic Programming (addendum, distributed at conference), pp. 17–34. The MIT Press, Cambridge (1988)

    Google Scholar 

  27. Rouzaud, Y., Nguyen-Phuong, L.: Integrating modes and subtypes into a prolog type-checker. In: Apt, K. (ed.) Logic Programming, Proc. of JICSLP, Cambridge, Mass., pp. 85–97 (1992)

    Google Scholar 

  28. Smolka, G.: Logic Programming over Polymorphically Order-Sorted Types. PhD thesis, Universität Kaiserslautern, Germany (1989)

    Google Scholar 

  29. Somogyi, Z.: The Mercury project (1995), http://www.cs.mu.oz.au/~/mercury.html

  30. Wu, J.J.: A First-order Theory of Types and Polymorphism in Logic Programming. PhD thesis, State University of New York at Stony Brook (1992)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 1999 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Beierle, C., Meyer, G. (1999). Using Types as Approximations for Type Checking Prolog Programs. In: Middeldorp, A., Sato, T. (eds) Functional and Logic Programming. FLOPS 1999. Lecture Notes in Computer Science, vol 1722. Springer, Berlin, Heidelberg. https://doi.org/10.1007/10705424_17

Download citation

  • DOI: https://doi.org/10.1007/10705424_17

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-66677-6

  • Online ISBN: 978-3-540-47950-5

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics