The following Comparison of Prolog implementations provides a reference for the relative feature sets and performance of different implementations of the Prolog computer programming language. A comprehensive discussion of the most significant Prolog systems is presented in an article published in the 50-years of Prolog anniversary issue of the journal Theory and Practice of Logic Programming (TPLP). [1]
There are Prolog implementations that are radically different, with different syntax and different semantics (e.g. Visual Prolog) [2] and sub-communities have developed around different implementations. [2]
Code that strictly conforms to the ISO-Prolog core language is portable across ISO-compliant implementations. However, the ISO standard for modules is an extension which was not fully adopted in most Prolog systems. [2] [1]
Factors that can adversely affect portability include: use of bounded vs. unbounded integer arithmetic, additional types such as string objects, advanced numeric types (rationals, complex), feature extensions such as Unicode, threads, and tabling. [3] Use of libraries unavailable in other implementations and library organisation: [2]
Currently, the way predicates are spread over the libraries and system built-ins differs enormously. [...] Fortunately, there are only few cases where we find predicates with the same name but different semantics (e.g.
delete/3
)
Platform | Features | Toolkit | Prolog Mechanics | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Name | OS | Licence | Native Graphics | Compiled Code | Unicode | Object Oriented | Native OS Control | Stand Alone Executable | C Interface [lower-alpha 1] | Java Interface [lower-alpha 1] | Interactive Interpreter | Debugger | Code Profiler | Syntax |
AllegroProlog | Unix, Windows, Mac OS X | Proprietary (limited free edition available) | Yes | Yes | Yes | Yes, via Lisp | Yes | Yes, via Lisp | Yes, via Lisp | Yes | Yes | Yes, via Lisp | S-expressions. Full Common Lisp integration. | |
BProlog | Unix, Windows, Mac OS X | Proprietary (free for non-commercial uses) | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ISO-Prolog, plus event-handling, CLP(FD), and tabling | |
Ciao | Unix, Windows, Mac OS X | GPL, LGPL | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ISO-Prolog, plus extensions | ||
DOS-Prolog [4] | MS-DOS | Proprietary | Yes | Yes | Yes | Yes | Yes | Yes | Edinburgh Prolog | |||||
ECLiPSe | Linux, Windows, Solaris, macOS | MPL | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Extended Prolog, Multi-dialect, including ISO | ||||
GNU Prolog | Unix, Windows, Mac OS X | GPL, LGPL | Yes | Yes | Yes | Yes | Yes | Yes | ISO-Prolog | |||||
JIProlog | JVM, Android | AGPL (commercial support available) | Yes | Yes | Yes via Java | Yes | Yes via Java | Yes | Yes | Yes | ISO-Prolog | |||
JLog [5] | JVM | GPL | Yes | Yes | Yes | Yes | ISO-Prolog | |||||||
JScriptLog [5] | Web Browser | GPL | Yes | ISO-Prolog | ||||||||||
jTrolog [6] | JVM | LGPL | Yes | Yes | Yes | Yes | ISO-Prolog | |||||||
WIN-Prolog [7] | Windows | Proprietary | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Edinburgh Prolog with extensions |
Open Prolog | Mac OS | Freeware | Yes | |||||||||||
Poplog Prolog | Linux (32- and 64-bit), Unix, Windows | Free Open Source | Only through POP-11, on Linux | Yes | Yes | Yes | Yes | Yes | Yes | Edinburgh Prolog, with interfaces to Poplog Common Lisp and Pop-11 | ||||
Scryer Prolog | Linux, Windows, macOS | BSD License | Yes | Yes | ISO-Prolog | |||||||||
SICStus Prolog | Unix, Linux, Windows, macOS | Proprietary | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ISO-Prolog |
Strawberry Prolog | Windows, Unix | Freeware | Yes | Yes | Yes | Yes | Yes | Not ISO-Prolog + extensions | ||||||
SWI-Prolog | Unix, Linux, Windows, macOS | BSD License | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ISO-Prolog, Edinburgh Prolog | |
tuProlog | JVM, Android | LGPL | Yes | Yes | Yes | Yes | Yes | Yes | ISO-Prolog | |||||
Visual Prolog | Windows | Freeware | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | |||
XSB Prolog | Linux, Windows, Solaris, macOS | LGPL | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | ISO-Prolog, tabled WFS | ||
YAP-Prolog | Linux, Windows, Solaris, Mac OS X, HP-UX | GPL or Artistic (user choice) | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Edinburgh, ISO-Prolog, Quintus and SICStus Prolog compatible |
OS-related | Web-related | |||||||
---|---|---|---|---|---|---|---|---|
Name | Conditional compilation | Sockets | Multi-threading | Tabling | HTTP client | HTTP server | HTML Parser | RDF Triple store |
BProlog | Yes | |||||||
Ciao | Yes | Yes | Yes | Yes | Yes | Yes | Yes | |
ECLiPSe | Yes | Yes | Yes | Yes | Yes | |||
GNU Prolog | Yes | |||||||
WIN-Prolog | Yes | Yes | Yes | Yes | ||||
Scryer Prolog | Yes | Yes | Yes | Yes | Yes | |||
SICStus Prolog | Yes | Yes | Yes | |||||
SWI-Prolog | Yes | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
Visual Prolog | Yes | Yes | Yes | Yes | Yes | Yes | ||
XSB | Yes | Yes | Yes | Yes | Yes | |||
YAP-Prolog | Yes | Yes | Yes | Yes |
Name | Type checker | Determinacy checker | Call-pattern checker |
---|---|---|---|
Ciao | Yes | Yes | Yes |
GNU Prolog | |||
SICStus Prolog | Yes | ||
SWI-Prolog | Yes | ||
Visual Prolog | Yes | Yes | Yes |
XSB | |||
YAP-Prolog |
Name | Tail-Call Optimization | Choice Point Elimination | Environment Trimming | Just-in-Time Indexing |
---|---|---|---|---|
Ciao | Yes | Yes | Yes | ? |
ECLiPSe | Yes | Yes | Yes | multi-argument (compile time) |
GNU Prolog | Yes | Yes | Yes | |
SICStus Prolog | Yes | Yes | Yes | |
SWI-Prolog | Yes | Yes | Yes | Yes |
Visual Prolog | Yes (compile time) | Yes (compile time) | N/A | N/A (compile time) |
XSB | Yes | Yes | Yes | ? |
YAP-Prolog | Yes | Yes | Yes | Yes |
Name | Version | Date |
---|---|---|
AllegroProlog | 1.1.2 | 2018-12-12 |
BProlog | 8.1 | 2014-02-23 |
JIProlog | 4.1.7.1 | 2021-08-26 |
Ciao | 1.22 | 2022-09-28 |
DOS-Prolog | 8.0 | |
ECLiPSe | 7.1 | 2023-01-01 |
GNU Prolog | 1.5.0 | 2023-02-21 |
JLog | 1.3.6 | 2007-09-13 |
JScriptLog | 0.7.5 beta | 2007-09-10 |
jTrolog | ||
WIN-Prolog | 8.0 | 2022-07-14 |
Open Prolog | ||
Poplog Prolog | V16 | 2020-01-06 |
Scryer Prolog | 0.9.3 | 2023-11-02 |
SICStus Prolog | 4.9.0 | 2023-12-18 |
Strawberry Prolog | 6.1 | 2023-08-23 |
SWI-Prolog | 9.1.18 | 2023-11-01 |
tuProlog | 2P-Kt 0.31.18 | 2023-10-24 |
Visual Prolog | 10, Build 1000 | 2021-04-15 |
XSB Prolog | 5.0 | 2022-05-15 |
YAProlog | 7.1.0 | 2020-12-19 |
Logic programming is a programming, database and knowledge representation paradigm based on formal logic. A logic program is a set of sentences in logical form, representing knowledge about some problem domain. Computation is performed by applying logical reasoning to that knowledge, to solve problems in the domain. Major logic programming language families include Prolog, Answer Set Programming (ASP) and Datalog. In all of these languages, rules are written in the form of clauses:
Prolog is a logic programming language that has its origins in artificial intelligence, automated theorem proving and computational linguistics.
The Z notation is a formal specification language used for describing and modelling computing systems. It is targeted at the clear specification of computer programs and computer-based systems in general.
Datalog is a declarative logic programming language. While it is syntactically a subset of Prolog, Datalog generally uses a bottom-up rather than top-down evaluation model. This difference yields significantly different behavior and properties from Prolog. It is often used as a query language for deductive databases. Datalog has been applied to problems in data integration, networking, program analysis, and more.
In computer science, the occurs check is a part of algorithms for syntactic unification. It causes unification of a variable V and a structure S to fail if S contains V.
SWI-Prolog is a free implementation of the programming language Prolog, commonly used for teaching and semantic web applications. It has a rich set of features, libraries for constraint logic programming, multithreading, unit testing, GUI, interfacing to Java, ODBC and others, literate programming, a web server, SGML, RDF, RDFS, developer tools, and extensive documentation.
Constraint Handling Rules (CHR) is a declarative, rule-based programming language, introduced in 1991 by Thom Frühwirth at the time with European Computer-Industry Research Centre (ECRC) in Munich, Germany. Originally intended for constraint programming, CHR finds applications in grammar induction, type systems, abductive reasoning, multi-agent systems, natural language processing, compilation, scheduling, spatial-temporal reasoning, testing, and verification.
ECLiPSe is a software system for the development and deployment of constraint logic programming applications, e.g., in the areas of optimization, planning, scheduling, resource allocation, timetabling, transport, etc. It is also suited for teaching most aspects of combinatorial problem solving, e.g., problem modeling, constraint programming, mathematical programming, and search techniques. It contains constraint solver libraries, a high-level modeling and control language, interfaces to third-party solvers, an integrated development environment and interfaces for embedding into host environments.
Programming languages are used for controlling the behavior of a machine. Like natural languages, programming languages follow rules for syntax and semantics.
In computer science, the well-founded semantics is a three-valued semantics for logic programming, which gives a precise meaning to general logic programs.
XSB is the name of a dialect of the Prolog programming language and its implementation developed at Stony Brook University in collaboration with the Katholieke Universiteit Leuven, the New University of Lisbon, Uppsala University and software vendor XSB, Inc.
Logtalk is an object-oriented logic programming language that extends and leverages the Prolog language with a feature set suitable for programming in the large. It provides support for encapsulation and data hiding, separation of concerns and enhanced code reuse. Logtalk uses standard Prolog syntax with the addition of a few operators and directives.
Prolog++ is an object-oriented toolkit for the Prolog logic programming language. It allows classes and class hierarchies to be created within Prolog programs.
YAP is an open-source, high-performance implementation of the Prolog programming language developed at LIACC/Universidade do Porto and at COPPE Sistemas/UFRJ. Its Prolog engine is based in the WAM, with several optimizations for better performance. YAP follows the Edinburgh tradition, and is largely compatible with the ISO-Prolog standard and with Quintus Prolog and SICStus Prolog. YAP has been developed since 1985. The original version was written in assembly, C and Prolog, and achieved high performance on m68k-based machines.
In computer science, a rule-based system is a computer system in which domain-specific knowledge is represented in the form of rules and general-purpose reasoning is used to solve problems in the domain.
HiLog is a programming logic with higher-order syntax, which allows arbitrary terms to appear in predicate and function positions. However, the model theory of HiLog is first-order. Although syntactically HiLog strictly extends first order logic, HiLog can be embedded into this logic.
SICStus Prolog is a proprietary, ISO-conforming implementation of the logic programming language Prolog. It is developed by the Swedish Institute of Computer Science since 1985 and puts a strong focus on performance and scalability.
Rulelog is an expressive semantic rule-based knowledge representation and reasoning (KRR) language. It underlies knowledge representation languages used in systems such as Flora-2, SILK and others. It extends well-founded declarative logic programs with features for higher-order syntax, frame syntax, defeasibility, general quantified expressions both in the bodies of the rules and their heads, user-defined functions, and restraint bounded rationality.
Tabling is a technique first developed for natural language processing, where it was called Earley parsing. It consists of storing in a table partial successful analyses that might come in handy for future reuse.
Quintus Prolog is a proprietary implementation of the Prolog programming language based on the Warren Abstract Machine. Originally developed by Quintus Computer Science, it is currently maintained by SICS. It was long known as the most highly-performing implementation of Prolog, and the early 1990s, it defined a de facto standard for Prolog implementations.