Go to the first, previous, next, last section, table of contents.

The Prolog Library

The Prolog library comprises a number of packages which are thought to be useful in a number of applications. Note that the predicates in the Prolog library are not built-in predicates. One has to explicitly load each package to get access to its predicates. The following packages are provided:

arrays
provides an implementation of extendible arrays with logarithmic access time.
assoc
uses AVL trees to implement "association lists", i.e. extendible finite mappings from terms to terms.
atts
provides a means of associating with variables arbitrary attributes, i.e. named properties that can be used as storage locations as well as hooks into Prolog's unification.
heaps
implements binary heaps, the main application of which are priority queues.
lists
provides basic operations on lists.
terms
provides a number of operations on terms.
ordsets
defines operations on sets represented as lists with the elements ordered in Prolog standard order.
queues
defines operations on queues (FIFO stores of information).
random
provides a random number generator.
system
provides access to operating system services.
trees
uses binary trees to represent non-extendible arrays with logarithmic access time. The functionality is very similar to that of library(arrays), but library(trees) is slightly more efficient if the array does not need to be extendible.
ugraphs
provides an implementation of directed and undirected graphs with unlabeled edges.
wgraphs
provides an implementation of directed and undirected graphs where each edge has an integral weight.
sockets
provides an interface to system calls for manipulating sockets.
linda/client
linda/server
provides an implementation of the Linda concept for process communication.
db
provides storage and retrieval of terms on disk files with user-defined multiple indexing.
clpb
provides constraint solving over Booleans.
clpq
clpr
provides constraint solving over Q (Rationals) or R (Reals).
clpfd
provides constraint solving over Finite (Integer) Domains
objects
provides the combination of the logic programming and the object-oriented programming paradigms.
gcla
is a specification tool that is based on Generalized Horn Clause Language, a generalization of Prolog.
tcltk
An interface to the Tcl/Tk language and toolkit.
gauge
is a profiling tool for Prolog programs with a graphical interface based on tcltk.
charsio
defines I/O predicates that read from, or write to, a list of character codes.
flinkage
is a utility program for generating glue code for the Foreign Language Interface when building statically linked Runtime Systems or Development Systems.
timeout
provides a way of running goals with an execution time limit.
xref
provides a cross reference producer for debugging and program analysis.

To load a library package Package, you will normally enter a query

| ?- use_module(library(Package)).

Library packages may be compiled and consulted as well as loaded.

An alternative way of loading from the library is using the built-in predicate require/1 (see section Reading-in Programs). The index file `INDEX.pl' needed by require/1 can be created by the make_index program. This program is loaded as:

| ?- use_module(library(mkindex)).
make_index:make_library_index(+LibraryDirectory)
Creates a file `INDEX.pl' in LibraryDirectory. All `*.pl' files in the directory and all its subdirectories are scanned for module/2 declarations. From these declarations, the exported predicates are entered into the index.

Go to the first, previous, next, last section, table of contents.