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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Aiken, A., Lakshman, T.K.: Directional type checking of logic programs. In: LeCharlier, B. (ed.) SAS 1994. LNCS, vol. 864. Springer, Heidelberg (1994)
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)
Beierle, C., Meyer, G.: Run-time type computations in the Warren Abstract Machine. The Journal of Logic Programming 18(2), 123–148 (1994)
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)
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)
Cardelli, L., Wegner, P.: On understanding types, data abstraction, and polymorphism. ACM Computing Surveys 17, 471–522 (1986)
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)
Hanus, M.: Horn clause programs with polymorphic types: Semantics and resolution. Theoretical Computer Science 89, 63–106 (1991)
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)
Hanus, M.: Logic programming with type specifications. In: Pfenning, F. (ed.) [24], ch. 3, pp. 91–140
Hill, P., Lloyd, J.: The Gödel Programming Language. Logic programming series. The MIT Press, Cambridge (1994)
Hill, P.M., Topor, R.W.: A semantics for typed logic programs. In: Pfenning, F. (ed.) [24], ch. 1, pp. 1–62
Höhfeld, M., Smolka, G.: Definite relations over constraint languages. IWBS Report 53, IBM Scientific Center, Stuttgart, Germany (October 1988)
Kifer, M., Wu, J.: A first-order theory of types and polymorphism in logic programming. Techn. Rep. 90/23, SUNY, New York (July 1990)
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)
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/
Meyer, G.: On Types and Type Consistency in Logic Programming. PhD thesis, FernUniversität Hagen, Germany (1999) (to appear)
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)
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)
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)
Mycroft, A., O’Keefe, R.A.: A polymorphic type system for Prolog. Artificial Intelligence 23, 295–307 (1984)
Naish, L.: Types and intended meaning. In: Pfenning, F. (ed.) [24], ch. 6, pp. 189–216.
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)
Pfenning, F. (ed.): Types in Logic Programming. Logic Programming Series. The MIT Press, Cambridge (1992)
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)
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)
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)
Smolka, G.: Logic Programming over Polymorphically Order-Sorted Types. PhD thesis, Universität Kaiserslautern, Germany (1989)
Somogyi, Z.: The Mercury project (1995), http://www.cs.mu.oz.au/~/mercury.html
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)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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