15-09-2021

Windows and Mac:

SWI Prolog by Jan Wielemaker is probably the most comprehensive Prolog development environment. It has excellent development facilities. It sports a graphical debugging environment and a range of libraries that allow you to implement GUIs, use object-orientation easily implement an http server (or client), TCP/IP sockets and many other functionalities. PySwip is a Python - SWI-Prolog bridge enabling to query SWI-Prolog in your Python programs. It features an (incomplete) SWI-Prolog foreign language interface, a utility class that makes it easy querying with Prolog and also a Pythonic interface. Since PySwip uses SWI-Prolog as a shared library and ctypes to access it, it doesn't require. 1 Running a Prolog program. Running a Prolog program involves. Creating a file containing the program. Saving the file. Loading the file into Prolog (called compiling, consulting, or reconsulting, the file in Prolog jargon) finally, calling some goal defined in the program. The version of Prolog we will be using is one which runs on a variety. Last modified: Sat May 15 09:13:51 UTC 2021: Last modified by: tim.lebedk. Created: Wed Jan 27 17:12:01 UTC 2021: Created by: tim.lebedk. Automated tests.

  1. Download SWI-Prolog.

    • Windows: We recommend downloading the 64-bit edition!
  2. Install SWI-Prolog by following the installer instructions.

Linux (Ubuntu):

  1. Add the ppa ppa:swi-prolog/stable to your system’s software sources:

    • Open a terminal (Ctrl+Alt+T) and type:
      sudo add-apt-repository ppa:swi-prolog/stable

    • Afterwards, update the package information:
      sudo apt-get update

  2. Install SWI-Prolog through the package manager:

    • Open a terminal (Ctrl+Alt+T) and type:
      sudo apt-get install swi-prolog

Quick start (Linux):

  1. Write a prolog program as a text file with a .pl ending. For example, program.pl.
  2. Open a terminal (Ctrl+Alt+T) and navigate to the directory where you stored your program.
  3. Open SWI-Prolog by invoking swipl.
  4. In SWI-Prolog, type [program] to load the program, i.e. the file name in brackets, but without the ending.
  5. In order to query the loaded program, type goals and watch the output.
  6. Alternatively, you can also load the program by passing its name as a parameter to SWI-Prolog: swipl -s program.pl.
  7. To exit SWI-Prolog, type halt..

For more Getting started advice, please refer to the SWI-Prolog Tutorials.

SWI-Prolog
Original author(s)Jan Wielemaker
Developer(s)Jan Wielemaker, Anjo Anjewierden, etc
Initial release1987; 34 years ago
Stable release
Preview release
8.3.24 / 10 May 2021; 3 months ago
Written inC, Prolog
Operating systemCross-platform
Available inEnglish
TypeLogic programming
LicenseSimplified BSD, LGPL prior to version 7.3.33
Websiteswi-prolog.org

SWI-Prolog is a free implementation of the programming languageProlog, 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 Editor

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 is employed. The name of this group has changed to HCS (Human-Computer Studies).

Web framework[edit]

SWI-Prolog installs with a web framework based on definite clause grammars.[1]

Distributed computing[edit]

SWI-Prolog queries may be distributed over several servers and web pages through the Pengines system.[2]

XPCE[edit]

XPCE is a platform-independentobject-oriented[3]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[edit]

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.

Interface between Java and Prolog (JPL)[edit]

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

Swi-prolog Download

Constraint logic programming libraries (CLP)[edit]

Constraint logic programming functionality came rather late in the lifetime of SWI-Prolog, because it lacked the basic support.[6] 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.[7]

See also[edit]

References[edit]

  1. ^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. S2CID5404048.
  2. ^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. S2CID9949345.
  3. ^Programming in XPCE/Prolog.
  4. ^Paul Singleton, Fred Dushin, Jan Wielemaker (February 2004). 'JPL: A bidirectional Prolog/Java interface'. SWI-Prolog.CS1 maint: uses authors parameter (link)
  5. ^Paul Singleton (February 2004). 'JPL 3.x installation'. SWI-Prolog.
  6. ^Jan Wielemaker, Tom Schrijvers, Markus Triska, Torbjörn Lager: SWI-Prolog. TPLP 12(1–2): 67–96 (2012).
  7. ^Markus Triska: The Boolean Constraint Solver of SWI-Prolog (System Description). FLOPS 2016: 45–61.

External links[edit]

Swi-prolog

Swi-prolog Pdf Documentation

Retrieved from 'https://en.wikipedia.org/w/index.php?title=SWI-Prolog&oldid=1024175925'