SWI-Prolog
Original authorJan Wielemaker
DevelopersJan Wielemaker, Anjo Anjewierden, etc
Initial release1987; 39 years ago (1987)
Stable release
10.0.0[1] Edit this on Wikidata / 3 December 2025; 6 months ago (3 December 2025)
Written inC, Prolog
Operating systemCross-platform
Available inEnglish
TypeLogic programming
LicenseSimplified BSD, LGPL prior to version 7.3.33
Websitewww.swi-prolog.org Edit this on Wikidata
Repository

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 (including an IDE with a GUI debugger and GUI profiler), and extensive documentation.

SWI-Prolog runs on Unix, Windows, Macintosh and Linux platforms.

SWI-Prolog has been under continuous development since 1987. Its main author is Jan Wielemaker.

The name SWI is derived from Sociaal-Wetenschappelijke Informatica ("Social Science Informatics"), the former name of the group at the University of Amsterdam, where Wielemaker was employed when he initiated the development of SWI-Prolog.[2]

Execution model

edit

SWI-Prolog is not based on the Warren Abstract Machine execution model of Prolog.

Instead, it is based on an extended version of the ZIP virtual machine, a minimal virtual machine for Prolog implementing a simple language consisting of only seven instructions. SWI-Prolog-specific extensions aim at improving performance in several ways: ad hoc instructions are introduced to support unification, predicate invocation, some frequently used built-in predicates, arithmetic, control flow, and negation as failure. Prolog can easily be compiled into this language, and the abstract machine code is easily decompiled back into Prolog. This feature is often exploited to interleave compiled and interpreted code execution.[3]

Constraint logic programming

edit

Constraint logic programming functionality came rather late in the lifetime of SWI-Prolog, because it lacked the basic support.[4] This changed early in 2004, when attributed variables were added to the language. The Leuven CHR library was then the first CLP library to be ported to SWI-Prolog. We mention SWI-Prolog's INCLP(R) library (De Koninck et al. 2006), which provides non-linear constraints over the reals and was implemented on top of CHR. Later came a port of Christian Holzbaur's CLP(QR) library and a finite-domain CLP(FD) solver. Finally, a boolean CLP(B) solver was added.[5]

Extensions for SWI-Prolog

edit

SWI-Prolog installs with a web framework based on definite clause grammars.[6] SWI-Prolog queries may be distributed over several servers and web pages through the Pengines system.[7]

XPCE

edit

XPCE is a platform-independent object-oriented[8] GUI toolkit for SWI-Prolog, Lisp and other interactive and dynamically typed languages. Although XPCE was designed to be language-independent, it has gained popularity mostly with Prolog. The development XPCE graphic toolkit started in 1987, together with SWI-Prolog. It supports buttons, menus, sliders, tabs and other basic GUI widgets. XPCE is available for all platforms supported by SWI-Prolog.

PceEmacs is a SWI-Prolog builtin editor. PceEmacs is an Emacs clone implemented in Prolog (and XPCE). It supports proper indentation, syntax highlighting, full syntax checking by calling the SWI-Prolog parser, warning for singleton variables and finding predicate definitions based on the source information from the Prolog database.

Interfaces

edit

JPL is a bidirectional interface between Java and Prolog.[9] It requires both SWI-Prolog and Java SDK.[10] It is installed as a part of SWI-Prolog.

See also

edit

References

edit
  1. ^ "Ann: SWI-Prolog 10.0.0 (Stable)". 3 December 2025. Retrieved 5 December 2025.
  2. ^ Tate, Bruce (2022). "Logic Programming Basics (Chapter 1)". Programmer Passport: Prolog. Pragmatic Bookshelf. ISBN 9781680509359.
  3. ^ Körner, Philipp; Leuschel, Michael; Barbosa, João; Costa, Vítor Santos; Dahl, Verónica; Hermenegildo, Manuel V.; Morales, Jose F.; Wielemaker, Jan; Diaz, Daniel; Abreu, Salvador; Ciatto, Giovanni (2022). "Fifty Years of Prolog and Beyond". Theory and Practice of Logic Programming. 22 (6): 776–858. doi:10.1017/S1471068422000102. hdl:10174/33387. ISSN 1471-0684. This article incorporates text from this source, which is available under the CC BY 4.0 license.
  4. ^ Jan Wielemaker, Tom Schrijvers, Markus Triska, Torbjörn Lager: SWI-Prolog. TPLP 12(1–2): 67–96 (2012).
  5. ^ Markus Triska: The Boolean Constraint Solver of SWI-Prolog (System Description). FLOPS 2016: 45–61.
  6. ^ Wielemaker, Jan; Huang, Zhisheng; van der Meij, Lourens (2008). "SWI-Prolog and the Web" (PDF). Theory and Practice of Logic Programming. 8 (3): 363–392. doi:10.1017/S1471068407003237. S2CID 5404048.
  7. ^ Wielemaker, Jan; Lager, Torbjorn (14 May 2014). "Pengines: WebLogic Programming Made Easy". Theory and Practice of Logic Programming. 14 (special issue 4–5): 539–552. arXiv:1405.3953. doi:10.1017/S1471068414000192. S2CID 9949345.
  8. ^ Programming in XPCE/Prolog.
  9. ^ Paul Singleton; Fred Dushin; Jan Wielemaker (February 2004). "JPL: A bidirectional Prolog/Java interface". SWI-Prolog.
  10. ^ Paul Singleton (February 2004). "JPL 3.x installation". SWI-Prolog. Archived from the original on 2011-07-16. Retrieved 2010-06-20.
edit

📚 Artikel Terkait di Wikipedia

AS-1000

The AS-1000 was a Brazilian clone of the Sinclair ZX81 introduced by Engebrás Eletrônica e Informática Ltda in October 1983. The main differences regarding

Czerweny Electrónica

Plus". Museo de Informática de la República Argentina (in Spanish). Retrieved 2023-01-16. Owen, Chris (2003). "South American clones". Planet Sinclair

TK80

Eletrônica. A clone of the Sinclair ZX80, it was introduced along with the TK82 in 1981 during the "I Feira Internacional de Informática". There were two

Gradiente Expert

presented to the public at the 5th International Computing Fair, nicknamed "Informatica '85". The event took place at Anhembi Convention Center in the city of

TK95

The TK 95 microcomputer was a 1986 ZX Spectrum clone by Microdigital Eletrônica, a company located at São Paulo, Brazil. It was an evolution of the TK90X

TK82

introduced along with the TK80 in 1981, during the "I Feira Internacional de Informática". In the January 1982 issue of Micro Sistemas magazine, Tomas Roberto

Prológica CP-400

COLOR was launched in 1984 by Prológica, a Brazilian company which made clone versions of various computers, under the general designation of "CP" (for

Andrew S. Tanenbaum

with the Centrum Wiskunde & Informatica, produced the distributed operating system Amoeba. In 1987, Tanenbaum wrote a clone of UNIX, called MINIX (MINi-unIX)