Parametric polymorphism for typed Prolog and λProlog

  • Pascale Louvet
  • Olivier Ridoux
Typing and Structuring Systems
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1140)


Typed Prolog and λProlog are logic programming languages with a strict typing discipline which is based on simple types with variables. Experiments show that this discipline does not handle properly common logic programming practices used in Prolog. For instance, the usual transformation for computing the Clark completion of a Prolog program does not work well with some typed programs. We observe that the so-called head-condition is at the heart of these problems, and conclude that it should be enforced. We propose a second-order scheme which is compatible with usual practices. It allows quantifying types and terms, passing type and term parameters to goals and terms, and to express type guards for selecting goals. We give its syntax and deduction rules, and propose a solution to keep the concrete notation of programs close to the usual one.


Logic programming typing polymorphism second-order λ-Calculus 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    H. Barendregt and K. Hemerik. Types in lambda calculi and programming languages. In N. Jones, editor, European Symp. on Programming, LNCS 432, pages 1–35, Springer-Verlag, 1990.Google Scholar
  2. 2.
    P. Brisset and O. Ridoux. The architecture of an implementation of AProlog: Prolog/Mali. In Workshop on λProlog, Philadelphia, PA, USA, 1992. Scholar
  3. 3.
    K.L. Clark. Negation as failure. In H. Gallaire and J. Minker, editors, Logic and Data Bases, pages 293–322, Plenum Press, New-York, USA, 1978.Google Scholar
  4. 4.
    C.M. Elliott. Higher-order unification with dependent function types. In N. Derschowitz, editor, 3rd Int. Conf. Rewriting Techniques and Applications, LNCS 355, pages 121–136, Springer-Verlag, 1989.Google Scholar
  5. 5.
    C.M. Elliott and F. Pfenning. A semi-functional implementation of a higher-order logic programming language. In P. Lee, editor, Topics in Advanced Language Implementation, pages 289–325, MIT Press, 1991.Google Scholar
  6. 6.
    J.-Y. Girard. Interprétation fonctionelle et élimination des coupures dans l'arithmétique d'ordre supérieur. Thèse de doctorat d'état, Université de Paris VII, 1972.Google Scholar
  7. 7.
    M. Hanus. Horn clause programs with polymorphic types: semantics and resolution. In TAPSOFT'89, LNCS 352, pages 225–240, Springer-Verlag, 1989.Google Scholar
  8. 8.
    M. Hanus. Polymorphic higher-order programming in Prolog. In G. Levi and M. Martelli, editors, 6th Int. Conf. Logic Programming, pages 382–397, MIT Press, 1989.Google Scholar
  9. 9.
    P.M. Hill and J.W. Lloyd. The Gödel Programming Language. MIT Press, 1994.Google Scholar
  10. 10.
    P.M. Hill and R.W. Topor. A semantics for typed logic programs. In F. Pfenning, editor, Types in Logic Programming, pages 1–62, MIT Press, 1992.Google Scholar
  11. 11.
    J. Reynolds. Towards a theory of type structure. In Colloque sur la Programmation, LNCS 19, pages 408–425, Springer-Verlag, 1974.Google Scholar
  12. 12.
    T.K. Lakshman and U.S. Reddy. Typed Prolog: a semantic reconstruction of the Mycroft-O'Keefe type system. In Int. Logic Programming Symp., pages 202–217, 1991.Google Scholar
  13. 13.
    D.A. Miller. A logical analysis of modules in logic programming. J. Logic Programming, 6(1–2):79–108, 1989.Google Scholar
  14. 14.
    D.A. Miller and G. Nadathur. Higher-order logic programming. In E. Shapiro, editor, 3rd Int. Conf. Logic Programming, LNCS 225, pages 448–462, Springer-Verlag, 1986.Google Scholar
  15. 15.
    D.A. Miller, G. Nadathur, F. Pfenning, and A. Scedrov. Uniform proofs as a foundation for logic programming. Annals of Pure and Applied Logic, 51:125–157, 1991.Google Scholar
  16. 16.
    R. Milner. A theory of type polymorphism in programming. J. Computer and System Sciences, 17:348–375, 1978.Google Scholar
  17. 17.
    A. Mycroft and R.A. O'Keefe. A polymorphic type system for Prolog. Artificial Intelligence, 23:295–307, 1984.Google Scholar
  18. 18.
    G. Nadathur. A Higher-Order Logic as the Basis for Logic Programming. Ph.D. Thesis, University of Pennsylvania, 1987.Google Scholar
  19. 19.
    G. Nadathur and F. Pfenning. The type system of a higher-order logic programming language. In F. Pfenning, editor, Types in Logic Programming, pages 245–283, MIT Press, 1992.Google Scholar
  20. 20.
    F. Pfenning. Partial polymorphic type inference and higher-order unification. In ACM Conf. LISP and Functional Programming, pages 153–163, ACM Press, 1988.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1996

Authors and Affiliations

  • Pascale Louvet
    • 1
  • Olivier Ridoux
    • 1
  1. 1.IRISA, Campus Universitaire de BeaulieuRennes CedexFrance

Personalised recommendations