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.
bdb
- provides an interface to Berkeley DB, for 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
chr
- provides Constraint Handling Rules
fdbg
- provides a debugger for finite domain constraint programs
objects
- provides the combination of the logic programming and the
object-oriented programming paradigms.
tcltk
- An interface to the Tcl/Tk language and toolkit.
vbsp
- An interface for calling Prolog from Visual Basic.
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.
jasper
- An interface to the Java language.
COM Client
- An interface to Microsoft COM automaton objects.
flinkage
- is a tool for generating glue code for the Foreign Language
Interface when building statically linked runtime systems or development
systems. No longer supported but provided for porting really old code.
timeout
- provides a way of running goals with an execution time limit.
wcx_example
- provides a sample implementation of a Wide Character Extension (WCX) box.
To load a library package Package, you will normally enter a query
| ?- use_module(library(Package)).
A library package normally consists of one or more hidden modules.
An alternative way of loading from the library is using the built-in
predicate require/1
(see Read In). 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.