Prolog Tools

General Compilers

Small Footprint, Embedded

Source Code Documentation


On Jul 18, 2006, at 2:57 PM, Robert Rothenberg wrote:

I am looking for the best way to write documentation for some Prolog
libraries. Is there a Prolog-equivalent to POD (for Perl) or
Haddock (for
Haskel) that allows me to embed documentation in the source code?

Yes! There is PrologDocNG, see

(make sure you get the cvs version)

I have documented my modules here:

Here is an example module:

The source is here:

As you see it's more similar to a javadoc style

However, I have not get succeeded in getting pdoc working with swi- prolog 5.6.x, so my docs are a little out of date

I have also switched to a mixed style of documentation where I do verbose docs in the pldoc style, but for a typical exported predicate I will just try and provide as much metadata as possible as assertions. I haven't get figured out to get most of these assertions into the pdoc framework (I'm not the author of PrologDocNG, that's Salvador Fandino, I have just tweaked it in places)

Here is some other links:


PlDoc is the SWI-Prolog source-code documentation infrastructure. PlDoc is loosely based on JavaDoc, using structured comments to mix documentation with source-code. SWI-Prolog's PlDoc is entirely written in Prolog and well integrated with the environment. It can create HTML+CSS and LaTeX documentation files as well as act as a web-server for the loaded project during program development.

Databases with Prolog

Jelly View Technology, ReDaReS system,


Glue-Nail Deductive Database System.

Coral Deductive Database Systems with rich declarative language.

Prolog and Web Pages

Prolog Server Pages (PSP) is a server-side scripting language based on Prolog. PSP is embedded in HTML documents and interpreted as a Prolog program. The output is then sent to the client (i.e. browser) together with the native HTML code. Several version of PSP exist, with minor differences, see links below.

An example implementation:

Different PSP implementation comparison and review:

See also:

Editing Prolog Code

GNU emacs is the editor of choice for many, offering:

  • Ediprolog for Emacs – editing and executing prolog code in any buffer.
  • ETrace – Prolog tracer

Emacs is the extensible, customizable, self-documenting real-time display editor.

If this seems to be a bit of a mouthful, an easier explanation is Emacs is a text editor and more. At its core is an interpreter for Emacs Lisp (“elisp”, for short), a dialect of the Lisp programming language with extensions to support text editing. Some of the features of GNU Emacs include:

  • Content sensitive major modes for a wide variety of file types, from plain text to source code to HTML files, with syntax coloring.
  • Complete built-in documentation, including a tutorial for new users.
  • Highly extensible through the Emacs Lisp language.
  • Support for many languages and their scripts, including all the European “Latin” scripts, Russian, Greek, Japanese, Chinese, Korean, Thai, Vietnamese, Lao, Ethiopian, and some Indian scripts. (Sorry, Mayan hieroglyphs are not supported.)
  • A large number of extensions which add other functionality. The GNU Emacs distribution includes many extensions; many others are available separately—even a web browser

Emacs Web Site


ediprolog.el is an Emacs mode which lets you transparently interact with SWI Prolog. Syntax highlighting is included.

You can load and syntax-check Prolog programs and execute queries with minimal exposure to the toplevel. Queries start with '?-' or ':-', possibly preceded by '%' and whitespace.

To install, copy ediprolog.el to your home directory, and add to your .emacs:

  (load "~/ediprolog")
  (global-set-key [f10] 'ediprolog-dwim)

More info:

Tramp Emacs

Transparent Remote (file) Access, Multiple Protocol. This package provides remote file editing, similar to Ange-FTP. The difference is that Ange-FTP uses FTP to transfer files between the local and the remote host, whereas TRAMP uses a combination of rsh and rcp or other work-alike programs, such as ssh/scp

Emacs Goodies for Debian

The file you're currently reading is mostly meant as an introductory starter for the various goodies included in emacs-goodies-el. Consult the Info node `emacs-goodies-el' for more complete information.


Java and Prolog


JPL is a set of Java classes and C functions providing an interface between Java and Prolog. JPL uses the Java Native Interface (JNI) to connect to a Prolog engine through the Prolog Foreign Language Interface (FLI), which is more or less in the process of being standardized in various implementations of Prolog. JPL is not a pure Java implementation of Prolog; it makes extensive use of native implementations of Prolog on supported platforms. The current version of JPL only works with SWI-Prolog.

Currently, JPL only supports the embedding of a Prolog engine within the Java VM. Future versions may support the embedding of a Java VM within Prolog, so that, for example, one could take advantage of the rich class structure of the Java environment from within Prolog.

JPL is designed in two layers, a low-level interface to the Prolog FLI and a high-level Java interface for the Java programmer who is not concerned with the details of the Prolog FLI. The low-level interface is provided for C programmers who may wish to port their C implementations which use the FLI to Java with minimal fuss.

Some instructions regarding installing JPL for Linux.


InterProlog is an open source Java front-end and functional enhancement for standard Prologs, running on Windows, Linux and Mac OS X, and currently supporting the top open source logic engines: XSB Prolog from the USA (most declarative), SWI Prolog from the Netherlands (best environment) and YAP Prolog from Portugal (fastest). InterProlog comes with Prolog term visualization aids and programming examples, namely a graphical Sudoku puzzle editor and solver.

InterProlog provides Java with the ability to call any Prolog goal through a PrologEngine object, and for Prolog to invoke any Java method through a javaMessage predicate, while passing virtually any Java objects and Prolog terms between both languages with a single instruction.

Mutual recursion and (Java) multithreading are supported. Java Reflection and Serialization mechanisms, together with Prolog’s natural strengths, are used to give the combination great flexibility and dynamism. Rather than tasting like an objectified Prolog/C interfaces, InterProlog provides a higher-level API equating objects to terms, inducing a more concise and declarative programming style.

Java <-> Prolog via Sockets

An example of enabling a Java tic tac toe GUI to interact with the Prolog tic tac toe game agent, using a socket data connector:


mProlog is a sub-product of the 3APL-M project. It delivers a reduced Prolog engine, optimized for J2ME applications. The mProlog engine was developed based on the W-Prolog project from Michael Winikoff. The 3APL-M project a platform for building applications using Artificial Autonomous Agents Programming Language (3APL) as the enabling logic for the deliberation cycles and internal knowledge representation.

more reading at

JSP with Prolog

see a tutorial


PrologCafe is a Prolog-to-Java source-to-source translator system.


XML and Prolog

Prolog in Javascript

Prolog and Eclipse

The Prolog Development Tool - A Prolog IDE for Eclipse from their page: The PDT is a Prolog IDE provided as a plug-in for the Eclipse Platform . Current features include:

  • A comfortable Prolog editor offering code completion, syntax checking and highlighting, and an outline.
  • A Prolog console view offering bash-like completion and command history.
  • A reusable Java API for communiating with SWI-Prolog .
pl/prolog/prolog_tools.txt · ostatnio zmienione: 2017/07/17 08:08 (edycja zewnętrzna) Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0