Comparison of Prolog implementations

Last updated

Timeline of some early Prolog systems, up to the ISO Standard Early Prolog timeline.svg
Timeline of some early Prolog systems, up to the ISO Standard

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]

Contents

Portability

Prolog Heritage.
Systems with a dark gray background are not supported any more. Arrows denote influences and inspiration of systems. Quick legend: JIT = "Just in Time Compiler", JVM = "Java Virtual Machine", TOAM = "Tree-Oriented Abstract Machine" Prolog systems.svg
Prolog Heritage.
Systems with a dark gray background are not supported any more. Arrows denote influences and inspiration of systems. Quick legend: JIT = "Just in Time Compiler", JVM = "Java Virtual Machine", TOAM = "Tree-Oriented Abstract Machine"

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)

Main features

PlatformFeaturesToolkitProlog Mechanics
NameOSLicence
Native Graphics
Compiled Code
Unicode
Object Oriented
Native OS Control
Stand Alone Executable
C Interface [a]
Java Interface [a]
Interactive Interpreter
Debugger
Code Profiler
Syntax
AllegroProlog [4] Unix, Windows, Mac OS X Proprietary (limited free edition available)YesYesYesYes, via LispYesYes, via LispYes, via LispYesYesYes, via LispS-expressions. Full Common Lisp integration.
BProlog Unix, Windows, Mac OS X Proprietary (free for non-commercial uses)YesYesYesYesYesYesYesYesYesYesISO-Prolog, plus event-handling, CLP(FD), and tabling
Ciao Unix, Windows, Mac OS X GPL, LGPL YesYesYesYesYesYesYesYesYesISO-Prolog, plus extensions
DOS-Prolog [5] MS-DOS Proprietary YesYesYesYesYesYesEdinburgh Prolog
ECLiPSe Linux, Windows, Solaris, macOS MPL YesYesYesYesYesYesYesExtended Prolog, Multi-dialect, including ISO
GNU Prolog Unix, Windows, Mac OS X GPL, LGPL YesYesYesYesYesYesISO-Prolog
JIProlog [6] JVM, Android AGPL (commercial support available)YesYesYes via JavaYesYes via JavaYesYesYesISO-Prolog
JLog [7] JVM GPL YesYesYesYesISO-Prolog
JScriptLog [7] Web Browser GPL YesISO-Prolog
jTrolog [8] JVM LGPL YesYesYesYesISO-Prolog
WIN-Prolog [9] Windows Proprietary YesYesYesYesYesYesYesYesYesYesYesEdinburgh Prolog with extensions
Open Prolog [10] Mac OS System 7 Freeware Yes
Poplog Prolog Linux (32- and 64-bit), Unix, Windows Free Open SourceOnly through POP-11, on LinuxYesYesYesYesYesYesEdinburgh Prolog, with interfaces to Poplog Common Lisp and Pop-11
Scryer Prolog [11] Linux, Windows, macOS BSD License YesYesISO-Prolog
SICStus Prolog Unix, Linux, Windows, macOS Proprietary YesYesYesYesYesYesYesYesYesYesYes ISO-Prolog
Strawberry Prolog [12] Unix, Windows Freeware YesYesYesYesYesNot ISO-Prolog + extensions
SWI-Prolog Unix, Linux, Windows, macOS BSD License YesYesYesYesYesYesYesYesYesYesISO-Prolog, Edinburgh Prolog
tuProlog [13] JVM, Android LGPL YesYesYesYesYesYesISO-Prolog
Visual Prolog Windows Freeware YesYesYesYesYesYesYesYesYes
XSB Prolog Linux, Windows, Solaris, macOS LGPL YesYesYesYesYesYesYesYesYesISO-Prolog, tabled WFS
YAP-Prolog Linux, Windows, Solaris, Mac OS X, HP-UX GPL or Artistic (user choice)YesYesYesYesYesYesYesYesISO-Prolog, Edinburgh Prolog, Quintus and SICStus Prolog compatible
OS-relatedWeb-related
NameConditional compilationSocketsMulti-threadingTablingHTTP clientHTTP serverHTML ParserRDF Triple store
BProlog Yes
Ciao YesYesYesYesYesYesYes
ECLiPSe YesYesYesYesYes
GNU Prolog Yes
WIN-Prolog YesYesYesYes
Scryer Prolog YesYesYesYesYes
SICStus Prolog YesYesYes
SWI-Prolog YesYesYesYesYesYesYesYes
Visual Prolog YesYesYesYesYesYes
XSB YesYesYesYesYes
YAP-Prolog YesYesYesYes

Static analysis

NameType checkerDeterminacy checkerCall-pattern checker
Ciao YesYesYes
GNU Prolog
SICStus Prolog Yes
SWI-Prolog Yes
Visual Prolog YesYesYes
XSB
YAP-Prolog

Optimizations

Name Tail-Call Optimization Choice Point EliminationEnvironment Trimming Just-in-Time Indexing
Ciao YesYesYes ?
ECLiPSe YesYesYesmulti-argument (compile time)
GNU Prolog YesYesYes
SICStus Prolog YesYesYes
SWI-Prolog YesYesYesYes
Visual Prolog Yes (compile time)Yes (compile time)N/AN/A (compile time)
XSB YesYesYes ?
YAP-Prolog YesYesYesYes

Release

NameVersionDate
AllegroProlog1.1.22018-12-12
BProlog 8.12014-02-23
JIProlog 4.1.7.12021-08-26
Ciao 1.222022-09-28
DOS-Prolog8.0
ECLiPSe 7.12023-01-01
GNU Prolog 1.5.02023-02-21
JLog 1.3.62007-09-13
JScriptLog 0.7.5 beta2007-09-10
jTrolog
WIN-Prolog8.02022-07-14
Open Prolog
Poplog PrologV162020-01-06
Scryer Prolog 0.9.32023-11-02
SICStus Prolog 4.9.02023-12-18
Strawberry Prolog 6.12023-08-23
SWI-Prolog 9.1.182023-11-01
tuProlog 2P-Kt 0.31.182023-10-24
Visual Prolog 10, Build 10002021-04-15
XSB Prolog5.02022-05-15
YAProlog 7.1.02020-12-19

Benchmarks

Notes

  1. 1 2 C/Java interface can also be used for graphics and OS control.

References

  1. 1 2 Philipp Körner; Michael Leuschel; João Barbosa; Vítor Santos Costa; Verónica Dahl; Manuel V. Hermenegildo; Jose F. Morales; Jan Wielemaker; Daniel Diaz; Salvador Abreu; Giovanni Ciatto (November 2022), "Fifty Years of Prolog and Beyond", Theory and Practice of Logic Programming, 22 (6): 776–858, doi: 10.1017/S1471068422000102 , hdl: 10174/33387
  2. 1 2 3 4 Wielemaker, J.; Costa, V. T. S. (2011). "On the Portability of Prolog Applications". Practical Aspects of Declarative Languages. Lecture Notes in Computer Science. Vol. 6539. pp. 69–83. CiteSeerX   10.1.1.1030.9396 . doi:10.1007/978-3-642-18378-2_8. ISBN   978-3-642-18377-5.
  3. Jan Wielemaker and Vıtor Santos Costa: Portability of Prolog programs: theory and case-studies. CICLOPS-WLPE Workshop 2010 Archived 2010-07-16 at the Wayback Machine .
  4. Allegro Prolog
  5. "DOS-Prolog 8.0". Logic Programming Associates. 5 November 2023.
  6. JIProlog
  7. 1 2 "JLog Homepage". jlogic.sourceforge.net. Retrieved 2023-11-03.
  8. "Jtrolog — Java.net". 2012-11-13. Archived from the original on 2012-11-13. Retrieved 2023-11-03.
  9. "WIN-Prolog 8.0". Logic Programming Associates. 5 November 2023.
  10. Open Prolog Home Page
  11. Scryer Prolog
  12. Strawberry Prolog
  13. tuProlog
  14. B. Demoen, and P. Nguyen, About unnecessary performance differences between Prolog implementations, Proceedings of the Colloquium on Implementation of Constraint and Logic Programming Systems (CICLOPS 2001)
  15. Bothe, K. (1990). "A prolog space benchmark suite". ACM SIGPLAN Notices. 25 (12): 54–60. doi: 10.1145/122193.122197 .
  16. A Summary of XSB Performance (1993)
  17. Demoen, B.; Nguyen, P. L.; Vandeginste, R. (2002). "Copying Garbage Collection for the WAM: to Mark or Not to Mark?". Logic Programming. Lecture Notes in Computer Science. Vol. 2401. pp. 194–208. CiteSeerX   10.1.1.13.2586 . doi:10.1007/3-540-45619-8_14. ISBN   978-3-540-43930-1.