A polymorphic type system with subtypes for Prolog

  • Roland Dietrich
  • Frank Hagl
3. Algebraic Specification And Type Concepts
Part of the Lecture Notes in Computer Science book series (LNCS, volume 300)


From a software engineering point of view, logic programming lacks many properties allowing secure development of large programs by many programmers. In this paper we try to improve these properties by proposing a polymorphic type system for Prolog. Our type system is able to deal with subtype relations if information about dataflow within clauses is available. This information can be given by a mode system. We give an outline of a type checking algorithm for this type system and discuss several problems which do not arise in type systems without subtypes.


Logic Program Type System Logic Programming Function Symbol Predicate Symbol 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


  1. M. Bruynooghe, Adding Redundancy to Obtain More Reliable and More Readable Prolog Programs, 1st International Conference on Logic Programming, Marseille, 1982.Google Scholar
  2. L. Cardelli, P. Wegner, On understanding Types, Data Abstraction, and Polymorphism, Computing Surveys, Vol. 17, No. 4, December 1985.Google Scholar
  3. R. Dietrich, Modes and Types for Prolog, Arbeitspapiere der GMD Nr. 285, January 1988.Google Scholar
  4. W. Drabent, Do Logic Programs Resemble Programs in Conventional Languages?, 4th IEEE Symposium on Logic Programming, San Francisco, 1987, 389–397.Google Scholar
  5. J. A. Goguen, J. Meseguer, Equality, Types, Modules, and Generics for Logic Programming, Proc. 2nd International Conference on Logic Programming, Uppsala, Sweden, 1984, 115–126.Google Scholar
  6. F. Hagl, Statische Analyse von Prolog Programmen mit Datenflu\-und Typangaben, Diplomarbeit, Universität Karlsruhe/GMD Karlsruhe, July 1987Google Scholar
  7. M. Huber, I. Varsek, Extended Prolog for Order-Sorted Resolution, 4th IEEE Symposium on Logic Programming, San Francisco, 1987, 34–45.Google Scholar
  8. J. W. Lloyd, Foundations of Logic Programming, Springer, 1984 (2nd Edition 1987).Google Scholar
  9. C. S.Mellish, Some Global Optimizations for a Prolog Compiler, J. Logic Programming 1985, No. 1, 43–66.Google Scholar
  10. R. Milner, A Theory of Type Polymorphism in Programming, J. Computer System Science 17(3), 1978, 348–375.Google Scholar
  11. P. Mishra, Towards a Theory of Types in Prolog, Proc. 1st IEEE International Symposium on Logic Programming, 1984, 289–298.Google Scholar
  12. A. Mycroft, R. A. O'Keefe, A Polymorphic Type System for Prolog, DAI Research Paper 211, Dept. of Artificial Intelligence, Edinburgh University, 1983.Google Scholar
  13. A. Mycroft, R. A. O'Keefe, A Polymorphic Type System for Prolog, Artificial Intelligence 23, 1984, 295–307.MathSciNetGoogle Scholar
  14. M. Schmidt-Schauß, Unification in a Many-Sorted Calculus with Declarations, Proc. 8th Conference on Automated Deduction, Oxford, UK., July 1986, LNCS 230, 538–552.Google Scholar
  15. G. Smolka, Making Control and Data Flow in Logic Programs Explicit, Proc. 1984 ACM Symposium on LISP and Functional Programming, Austin, Texas, August 1984.Google Scholar
  16. G. Smolka, W. Nutt, Order-Sorted Equational Computation, Proc. CREAS, Austin, Texas, May 1987.Google Scholar
  17. C. Walther, A Many-Sorted Calculus Based on Resolution and Paramodulation, Proc. 8th International Joint Conference on Artificial Intelligence, Karlsruhe, W. Germany, 1983, 882–891.Google Scholar
  18. D. H. D. Warren, Applied Logic — It's Use and Implementation as a Programming Tool, PhD Thesis, University of Edinburgh, 1977. Available as: Technical Note 290, June 1983, SRI International.Google Scholar
  19. D. H. D. Warren, An Abstract Prolog Instruction Set, Technical Note 309, Artificial Intelligence Center, SRI International, 1983.Google Scholar
  20. J. Zobel, Derivation of Polymorphic Types for Prolog Programs, Proc. 4th International Conference on Logic Programming, Melbourne, Australia, May 1987, 817–838.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1988

Authors and Affiliations

  • Roland Dietrich
    • 1
  • Frank Hagl
    • 1
  1. 1.GMD Forschungsstelle an der Universität Karlsruhe (German National Research Center for Computer Science)Karlsruhe

Personalised recommendations