You are on page 1of 3

PRACTICAL NO.

01 DATE:

AIM: Study and installation of various tools for prolog programming language in linux.

THEORY:
Here we are studying the 3 tools as follows:
[1] YAP (YET ANOTHER PROLOG):

YAP is a high-performance Prolog compiler developed at LIACC/Universidade do Porto and


at COPPE Sistemas/UFRJ. Its Prolog engine is based in the WAM (Warren Abstract
Machine), with several optimizations for better performance. YAP follows the Edinburgh
tradition, and is largely compatible with the ISO-Prolog standard and with Quintus and
SICStus Prolog. YAP has been developed since 1985. The original version was written in
assembly, C and Prolog, and achieved high performance on m68k based machines. The
assembly code was used to implement the WAM emulators. Later emulators supported the
VAX, SPARC, and MIPS architectures. Work on the more recent version of YAP strives at
several goals:
Portability: The whole system is now written in C. YAP compiles in popular 32 bit
machines, such as Suns and Linux PCs, and in a 64 bit machines, the Alphas running OSF
UNIX and Linux.
Performance: We have optimised the emulator to obtain performance comparable to or
better than well-known Prolog systems. In fact, the current version of YAP performs better
than the original one, written in assembly language.
Robustness: We have tested the system with a large array of Prolog applications.
Extensibility: YAP was designed internally from the beginning to encapsulate manipulation
of terms. These principles were used, for example, to implement a simple and powerful C-
interface. The new version of YAP extends these principles to accommodate extensions to the
unification algorithm, that we believe will be useful to implement extensions such as
constraint programming.
Completeness: YAP has for a long time provided most builtins expected from an Edinburgh
Prolog implementation. These include I/O functionality, data-base operations, and modules.
Work on YAP AIMs now at being compatible with the Prolog standard.

1
Openness: We would like to make new development of YAP open to the user community.
Research: YAP has been a vehicle for research within and outside our group. Currently
research is going on parallelisation and tabulation, and support for Bayesian Networks.

Installing YAP:

To compile YAP it should be sufficient to:


1. mkdir ARCH.
2. cd ARCH.
3. ../configure ...options. Notice that by default configure gives you a vanilla configuration.
For instance, in order to use co-routining and/or CLP you need to do ../configure --enable-
coroutining ...options...
4. check the Makefile for any extensions or changes you want to make. YAP uses autoconf.
Recent versions of YAP try to follow GNU conventions on where to place software. The
main executable is placed at BINDIR. This executable is actually a script that calls the Prolog
engine, stored at LIBDIR. LIBDIR is the directory where libraries are stored. YAPLIBDIR is
a subdirectory that contains the Prolog engine and a Prolog library.
INCLUDEDIR is used if you want to use YAP as a library. INFODIR is where to store info
files. Usually /usr/local/info, /usr/info, or /usr/share/info.
5. Make.
6. If the compilation succeeds, try ./yap.
7. If you feel satisfied with the result, do make install.
8. Make install-info will create the info files in the standard info directory.
9. Make html will create documentation in html format in the predefined directory. In most
systems you will need to be superuser in order to do make install and make info on the
standard directories.

[2] SWI-INSTALLATION ON UBUNTU AND EXECUTING PROLOG PROGRAMS :

I have an interest in playing and fuxing with prolog, I have installed the swi-prolog and added
the repository, just in case anyone is interested on which one commands I used:
% sudo apt-add-repository ppa:swi-prolog/stable
% sudo apt-get update
% sudo apt-get install swi-prolog

You might also like