For the predicates used for installing a Pack into SWI-Prolog local install see prolog_pack.pl – A package manager for Prolog.
To see the list of all available packs:
?- pack_list(''). % Contacting server at https://www.swi-prolog.org/pack/query ... ok p firstname.lastname@example.org - Collection of tools to make writing scripts in Prolog easier. p aleph@5 - Aleph Inductive Logic Programming system p email@example.com - Interface to Amazon APIs ... p firstname.lastname@example.org - XML Schema validation with Prolog A email@example.com(0.0.2) - Extended Tools for SWI-Prolog p firstname.lastname@example.org - YAML parser
If you need to capture the list because it is to large to scroll back try:
?- pwd. % c:/users/groot/documents/ true. ?- tell('.\packs.txt'),pack_list(''),told.
To see list of all installed Packs.
?- pack_list_installed. Installed packages (66): i email@example.com - Computational biology data analytics. i firstname.lastname@example.org - Access, use and manage big, biological datasets. i email@example.com - Data package for bio_db. ... i firstname.lastname@example.org - Weighted graphs, with plotting via Real i email@example.com - Extended Libraries for Prolog i firstname.lastname@example.org - Extended Tools for SWI-Prolog true.
To search for a
NB The resulting list will indicate if the
pack is installed. (ref)
?- pack_search(cli). % Contacting server at https://www.swi-prolog.org/pack/query ... ok p email@example.com - Pretty unicode tables for the CLI with Prolog p firstname.lastname@example.org - Consul Client p email@example.com - Hook up to an existing IRC Client called an Eggdrop p firstname.lastname@example.org - SWI-Prolog code for "Login with Google" ... p email@example.com - STOMP client p firstname.lastname@example.org - SWI-Prolog interface to C/C++/.NET/Mono/Objective-C p email@example.com - Easy web client true.
To install a pack
?- pack_install(chess_db). % Contacting server at https://www.swi-prolog.org/pack/query ... ok Install firstname.lastname@example.org from http://stoics.org.uk/~nicos/sware/packs/chess_db/chess_db-0.3.tgz Y/n? % Contacting server at https://www.swi-prolog.org/pack/query ... ok % "chess_db-0.3.tgz" was downloaded 15 times Package: chess_db Title: PGN and chess game databases. Installed version: 0.3 Author: Nicos Angelopoulos <http://stoics.org.uk/~nicos> Maintainer: Nicos Angelopoulos <http://stoics.org.uk/~nicos> Packager: Nicos Angelopoulos <http://stoics.org.uk/~nicos> Home page: http://stoics.org.uk/~nicos/sware/chess_db Download URL: http://stoics.org.uk/~nicos/sware/packs/chess_db/chess_db-*.tgz Install "chess_db-0.3.tgz" (415,114 bytes) Y/n? true.
ERROR: Cannot find MinGW and/or MSYS.
It is not uncommon to find packs designed for Unix. Often these packs will work on Windows with MSYS/MinGW installed.
Another option instead of installing MinGW is to use WSL. Basically create a local Linux install that sits in a Virtual Machine. Then install SWI-Prolog on Linux and run SWI-Prolog on Linux. See: Using WSL on Windows with SWI-Prolog and Wiki Discussion: Using WSL on Windows with SWI-Prolog
- On Windows, packs are installed into the directory
Packs are manually installed after SWI-Prolog is installed as seen using the commands from the earlier section.
Packages are optional during the install of SWI-Prolog and typically installed by default. In other words when you are installing SWI-Prolog (Windows, Linux, Mac, etc.) that is when a package is installed. I don’t know if you can install a package after SWI-Prolog is installed without reinstalling SWI-Prolog; I have always reinstalled SWI-Prolog to add/remove a package.
Not all of the available Packs are listed in the documentation.
When a pack is installed the
path aliasesis updated, e.g.
?- file_search_path(library, 'c:/users/groot/appdata/local/swi-prolog/pack/chess_db/prolog'). true ; false.