The GNU Prolog web site

The GNU Prolog logo
Current stable version is gprolog-1.5.0

Table of contents

What is GNU Prolog

GNU Prolog is a free Prolog compiler with constraint solving over finite domains developed by Daniel Diaz.
GNU Prolog accepts Prolog+constraint programs and produces native binaries (like gcc does from a C source). The obtained executable is then stand-alone. The size of this executable can be quite small since GNU Prolog can avoid to link the code of most unused built-in predicates. The performances of GNU Prolog are very encouraging (comparable to commercial systems).

Beside the native-code compilation, GNU Prolog offers a classical interactive interpreter (top-level) with a debugger.

The Prolog part conforms to the ISO standard for Prolog with many extensions very useful in practice (global variables, OS interface, sockets,...).

GNU Prolog also includes an efficient constraint solver over Finite Domains (FD). This opens contraint logic programming to the user combining the power of constraint programming to the declarativity of logic programming.


  • Prolog system:
  • Compiler:
  • Constraint solver:
  • How does GNU Prolog work ?

    The GNU Prolog compiler is based on the Warren Abstract Machine (WAM). It first compiles a Prolog program to a WAM file which is then translated to a low-level machine independent language called mini-assembly specifically designed for GNU Prolog. The resulting file is then translated to the assembly language of the target machine (from which an object is obtained). This allows GNU Prolog to produce a native stand alone executable from a Prolog source (similarly to what does a C compiler from a C program). The main advantage of this compilation scheme is to produce native code and to be fast. Another interesting feature is that executables are small. Indeed, the code of most unused built-in predicates can be excluded from the executables at link-time.

    GNU Prolog also includes an efficient constraint solver over Finite Domains (FD). The key feature of the GNU Prolog solver is the use of a single (low-level) primitive to define all (high-level) FD constraints. There are many advantages of this approach: constraints can be compiled, the user can define his own constraints (in terms of the primitive), the solver is open and extensible (as opposed to black-box solvers like CHIP),...Moreover, the GNU Prolog solver is rather efficient, often more than commercial solvers.


    GNU Prolog is inspired by two systems developed by the same author:
    The development of GNU Prolog started in January 1996 under the name Calypso.

    Supported Platforms & Last Changes

    Currently the following architectures are supported: If you are interested in porting GNU Prolog to another architecture read the PORTING file in src.

    You can consult the following files:


    This manual is available in the following formats:


    We provide both source and binary distributions for GNU Prolog.

    Source distributions:

    Binary distributions: Other versions: Some of these files can also be downloaded from the primary GNU ftp site or from any mirror.

    The GIT repository is hosted by GitHub.

    For windows users, a Notepad++ User Defined Lanuage (UDL) profile file for GNU Prolog (also available from the Notepad++ wiki about UDL). To install: launch Notepad++, in the "Language" menu, chose "Define your own language", click on "Import" and select the downloaded .xml file. Then close and restart Notepad++. Files suffixed with ".pl" and ".pro" should be now recognized as Prolog files (else select "Prolog (GNU)" from the "Languages" menu). For more information see the Notepad++ wiki.

    GNU Prolog is present on the Black Duck Open Hub site.

    Contributions and related developments

    Contributions are welcome. If you want to include your contribution please post a mail to (for more information on this list click here). Here is a list of available contributions:

    Mailing lists

    The mailing list is for communicating with other GNU Prolog users and/or implementors:
    The mailing list is for reporting bugs:
  • To inform other uses send a mail to
  • To (un)subscribe to this list send a mail to with (un)subscribe in the subject line.
  • You can also (un)subscribe via the web at

  • From the same site you can also browse the archive.

    Reporting Bugs

    Bug reports are crucial for our work. If we don't know about problems, we cannot fix them. On the other hand it is a waste of time to read/check/answer for bugs which are not bugs ! Please consult the manual (an on-line version is available). If you can try to check if the bug occurs with the last unstable version (all unstable versions are here). If you already use the last unstable version try the last stable version. When you are sure you have discovered a bug, please report it to (for more information on this list click here).

    Your report should include all these things:

    Copyright (C) 1999-2021 Daniel Diaz

    Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.