Horn clause programs with polymorphic types: Semantics and resolution

  • Michael Hanus
Part of the Lecture Notes in Computer Science book series (LNCS, volume 352)


This paper presents a Horn clause logic where functions and predicates are declared with polymorphic types. Types are parameterized with type variables. This leads to an ML-like polymorphic type system. A type declaration of a function or predicate restricts the possible use of this function or predicate so that only certain terms are allowed to be arguments for this function or predicate. The semantic models for polymorphic Horn clause programs are defined and a resolution method for this kind of logic programs is given. It will be shown that several optimizations in the resolution method are possible for specific kinds of programs. Moreover, it is shown that higher-order programming techniques can be applied in our framework.


Logic Program Logic Programming Horn Clause Type Constructor Type Annotation 
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. [AN86]
    H. Aït-Kaci and R. Nasr. LOGIN: A Logic Programming Language with Built-In Inheritance. Journal of Logic Programming (3), pp. 185–215, 1986.Google Scholar
  2. [AvE82]
    K.R. Apt and M.H. van Emden. Contributions to the Theory of Logic Programming. Journal of the ACM, Vol. 29, No. 3, pp. 841–862, 1982.CrossRefGoogle Scholar
  3. [BC83]
    M. Bidoit and J. Corbin. A Rehabilitation of Robinson's Unification Algorithm. In Proc. IFIP '83, pp. 909–914. North-Holland, 1983.Google Scholar
  4. [BG86]
    W. Bosco and E. Giovannetti. IDEAL: An Ideal Deductive Applicative Language. In Proc. IEEE Internat. Symposium on Logic Programming, pp. 89–94, Salt Lake City, 1986.Google Scholar
  5. [Chu40]
    A. Church. A formulation of the simple theory of types. Journal of Symbolic Logic, Vol. 5, pp. 56–68, 1940.Google Scholar
  6. [CM87]
    W.F. Clocksin and C.S. Mellish. Programming in Prolog. Springer, third rev. and ext. edition, 1987.Google Scholar
  7. [DH88]
    R. Dietrich and F. Hagl. A polymorphic type system with subtypes for Prolog. In Proc. ESOP 88, Nancy, pp. 79–93. Springer LNCS 300, 1988.Google Scholar
  8. [DM82]
    L. Damas and R. Milner. Principal type-schemes for functional programs. In Proc. 9th POPL, pp. 207–212, 1982.Google Scholar
  9. [EM85]
    H. Ehrig and B. Mahr. Fundamentals of Algebraic Specification 1: Equations and Initial Semantics, volume 6 of EATCS Monographs on Theoretical Computer Science, Springer, 1985.Google Scholar
  10. [GM84]
    J.A. Goguen and J. Meseguer. Completeness of Many-Sorted Equational Logic. Report No. CSLI-84-15, Stanford University, 1984.Google Scholar
  11. [GM86]
    J.A. Goguen and J. Meseguer. Eqlog: Equality, Types, and Generic Modules for Logic Programming. In D. DeGroot and G. Lindstrom, editors, Logic Programming, Functions, Relations, and Equations, pp. 295–363. Prentice Hall, 1986.Google Scholar
  12. [Gol81]
    W. Goldfarb. The Undecidability of the Second-Order Unification Problem. Theoretical Computer Science 13, pp. 225–230, 1981.CrossRefGoogle Scholar
  13. [GTW78]
    J.A. Goguen, J.W. Thatcher, and E.G. Wagner. An Initial Algebra Approach to the Specification, Correctness, and Implementation of Abstract Data Types. In R. Yeh, editor, Current Trends in Programming Methodology, volume 4, pp. 80–149. Prentice Hall, Englewood Cliffs NJ, 1978.Google Scholar
  14. [Han88a]
    M. Hanus. Formal Specification of a Prolog Compiler. In Proc. of the Workshop on Programming Language Implementation and Logic Programming, Orléans, 1988. To appear in Springer LNCS.Google Scholar
  15. [Han88b]
    M. Hanus. Horn Clause Programs with Polymorphic Types. Technical Report 248, FB Informatik, Univ. Dortmund, 1988.Google Scholar
  16. [Hue75]
    G.P. Huet. A Unification Algorithm for Typed λ-Calculus. Theoretical Computer Science, Vol. 1, pp. 27–57, 1975.CrossRefGoogle Scholar
  17. [HV87]
    M. Huber and I. Varsek. Extended Prolog with Order-Sorted Resolution. In Proc. 4th IEEE Internat. Symposium on Logic Programming, pp. 34–43, San Francisco, 1987.Google Scholar
  18. [JL87]
    J. Jaffar and J.-L. Lassez. Constraint Logic Programming. In Proc. of the 14th ACM Symposium on Principles of Programming Languages, pp. 111–119, Munich, 1987.Google Scholar
  19. [KH85]
    T. Kanamori and K. Horiuchi. Type Inference in Prolog and Its Application. In Proc. 9th IJCAI, pp. 704–707. W. Kaufmann, 1985.Google Scholar
  20. [Klu87]
    F. Kluźniak. Type Synthesis for Ground Prolog. In Proc. Fourth International Conference on Logic Programming (Melbourne), pp. 788–816. MIT Press, 1987.Google Scholar
  21. [Lau86]
    S. Launay. Complétion de systèmes de réécriture types dont les fonctions sont polymorphes (Thèse de 3ème cycle). Technical Report 86-5, C.N.R.S. Université Paris VII, 1986.Google Scholar
  22. [Llo87]
    J.W. Lloyd. Foundations of Logic Programming. Springer, second, extended edition, 1987.Google Scholar
  23. [Mis84]
    P. Mishra. Towards a theory of types in Prolog. In Proc. IEEE Internat. Symposium on Logic Programming, pp. 289–298, Atlantic City, 1984.Google Scholar
  24. [MM82]
    A. Martelli and U. Montanari. An Efficient Unification Algorithm. ACM Transactions on Programming Languages and Systems, Vol. 4, No. 2, pp. 258–282, 1982.CrossRefGoogle Scholar
  25. [MN86]
    D.A. Miller and G. Nadathur. Higher-Order Logic Programming. In Proc. Third International Conference on Logic Programming (London), pp. 448–462. Springer LNCS 225, 1986.Google Scholar
  26. [MO84]
    A. Mycroft and R.A. O'Keefe. A Polymorphic Type System for Prolog. Artificial Intelligence, Vol. 23, pp. 295–307, 1984.MathSciNetGoogle Scholar
  27. [Myc87]
    A. Mycroft. Private Communication, 1987.Google Scholar
  28. [Poi86]
    A. Poigné. On Specifications, Theories, and Models with Higher Types. Information and Control, Vol. 68, No. 1–3, 1986.Google Scholar
  29. [PW78]
    M.S. Paterson and M.N. Wegman. Linear Unification. Journal of Computer and System Sciences, Vol. 17, pp. 348–375, 1978.CrossRefGoogle Scholar
  30. [Rob65]
    J.A. Robinson, A Machine-Oriented Logic Based on the Resolution Principle. Journal of the ACM, Vol. 12, No. 1, pp. 23–41, 1965.CrossRefGoogle Scholar
  31. [Smo86]
    G. Smolka. Order-Sorted Horn Logic: Semantics and Deduction. SEKI Report SR-86-17, FB Informatik, Univ. Kaiserslautern, 1986.Google Scholar
  32. [Smo88]
    G. Smolka. TEL (Version 0.9) Report and User Manual. SEKI Report SR-87-11, FB Informatik, Univ. Kaiserslautern, 1988.Google Scholar
  33. [SS85]
    M. Schmidt-Schauss. A Many Sorted Calculus with Polymorphic Functions Based on Resolution and Paramodulation. In Proc. 9th IJCAI. W. Kaufmann, 1985.Google Scholar
  34. [War82]
    D.H.D. Warren. Higher-order extensions to PROLOG: are they needed? In Machine Intelligence 10, pp. 441–454, 1982.Google Scholar
  35. [War83]
    D.H.D. Warren. An Abstract Prolog Instruction Set. Technical Note 309, SRI International, Stanford, 1983.Google Scholar
  36. [YS87]
    E. Yardeni and E. Shapiro. A Type System for Logic Programs. Technical Report CS87-05, The Weizmann Institute of Science, 1987.Google Scholar
  37. [Zob87]
    J. Zobel. Derivation of Polymorphic Types for Prolog Programs. In Proc. Fourth International Conference on Logic Programming (Melbourne), pp. 817–838. MIT Press, 1987.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1989

Authors and Affiliations

  • Michael Hanus
    • 1
  1. 1.Fachbereich InformatikUniversität DortmundDortmund 50W. Germany

Personalised recommendations