Towards Typed Prolog

  • Tom Schrijvers
  • Vítor Santos Costa
  • Jan Wielemaker
  • Bart Demoen
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5366)


Prolog is traditionally not statically typed. Since the benefits of static typing are huge, it was decided to grow a portable type system inside two widely used open source Prolog systems: SWI-Prolog and Yap. This requires close cooperation and agreement between the two systems. The type system is Hindley-Milner. The main characteristics of the introduction of types in SWI and Yap are that typing is not mandatory, that typed and untyped code can be mixed, and that the type checker can insert dynamic type checks at the boundaries between typed and untyped code. The basic decisions and the current status of the Typed Prolog project are described, as well as the remaining tasks and problems to be solved.


Logic Program Type System Logic Programming Type List Type Check 
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.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Milner, R.: A theory of type polymorphism in programming. Journal of Computer System Sciences 17, 348–375 (1978)MathSciNetCrossRefzbMATHGoogle Scholar
  2. 2.
    Mycroft, A., O’Keefe, R.A.: A polymorphic type system for prolog. Artif. Intell. 23(3), 295–307 (1984)MathSciNetCrossRefzbMATHGoogle Scholar
  3. 3.
    Hill, P.M., Lloyd, J.W.: The Gödel Programming Language. MIT Press, Cambridge (1994)zbMATHGoogle Scholar
  4. 4.
    Somogyi, Z., Henderson, F., Conway, T.: The execution algorithm of mercury: an efficient purely declarative logic programming language. Journal of Logic Programming 29, 17–64 (1996)CrossRefzbMATHGoogle Scholar
  5. 5.
    Pietrzak, P., Correas, J., Puebla, G., Hermenegildo, M.: A Practical Type Analysis for Verification of Modular Prolog Programs. In: ACM SIGPLAN 2008 Workshop on Partial Evaluation and Program Manipulation (PEPM 2008), pp. 61–70. ACM Press, New York (2008)Google Scholar
  6. 6.
    Prolog Development Center (Visual Prolog),
  7. 7.
    Hill, P.M., Topor, R.: A semantics for Typed Logic Programs. In: Pfenning, M. (ed.) Types in Logic Programming, pp. 1–62. MIT Press, Cambridge (1992)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2008

Authors and Affiliations

  • Tom Schrijvers
    • 1
  • Vítor Santos Costa
    • 2
  • Jan Wielemaker
    • 3
  • Bart Demoen
    • 1
  1. 1.Department of Computer ScienceK.U.LeuvenBelgium
  2. 2.CRACS & FCUPUniversidade do PortoPortugal
  3. 3.HCSUniversity of AmsterdamThe Netherlands

Personalised recommendations