Installing Logtalk

Hardware & software requirements

Computer and operating system

Logtalk is compatible with almost any computer/operating system with a modern Prolog compiler available. Currently, the main development environment is an Apple PowerBook running MacOS X. Being written in Prolog and distributed in source form, the only issue regarding operating system compatibility are the end-of-line codes in the source text files! Most example source file names do not fit in the 8+3 MS-DOS file length limitation, so this may prevent those examples from running under this operating system (or in any other system with similar limitations).

Prolog compiler

In writing Logtalk I have tried to follow the recently approved Prolog ISO standard whenever possible. Capabilities needed by Logtalk that are not defined in the ISO standard are:

Logtalk needs access to the predicate propertybuilt_in to properly compile objects and categories that contain Prolog built-in predicates calls. In addition, some Logtalk built-ins need to know the dynamic/static status of predicates to ensure correct application. The ISO standard for Prolog modules defines a predicate_property/2 predicate that is already implemented by most Prolog compilers. Note that if these capabilities are not built-in the user cannot easily define them.

For optimal performance, Logtalk requires that the Prolog compiler supports first-argument indexing for both static and dynamic code (most modern compilers support this feature).

Since most Prolog compilers are moving closer to the ISO Prolog standard [ISO 95], it is advisable that you try to use a recent version of your favorite Prolog compiler.

Installing Logtalk

The Logtalk system can be installed in any directory that is accessible to the user. The installation process consists merely in decompressing an archive file that will lead to a new directory with the structure/contents described below. The decompression process naturally depends on the operative system that you are using. For some operating systems, an installer may be provided. Users wishing to use the Logtalk library and Logtalk examples will need write access to the respective directories or to make a local copy these directories on their home directories. See the file INSTALL for details. The directory misc may contain scripts for helping with Logtalk packaging, installation, and integration with Prolog compilers.

Mac OS 8.x, 9.x

The Macintosh version is included in the file lgt2xxx.sea.bin, a MacBinary encoded, self-extracting archive. Your web browser should automatically decode the file, giving you a .sea self-extracting archive that you double-click to install Logtalk. If not, drag and drop the .bin file in a utility like StuffIt Expander or MacBinaryII+.

MacOS X, BSD, Linux, Unix

The MacOS X/BSD/Linux/Unix version is included in the file lgt2xxx.tar.gz. In order to decompress and install the system you may use the following commands:

    % gunzip lgt2xxx.tar.gz
    % tar -xvf lgt2xxx.tar

This will create a sub-directory named lgt2xxx in your current directory.

OS/2, Windows 95/98/NT/ME/2000

The OS/2 and Windows 95/98/NT/ME/2000 version is included in the file lgt2xxx.zip. The file can be decompressed using an utility like unzip:

    unzip lgt2xxx.zip

Other operating systems

Almost all files in the Logtalk distribution are text files. The only difference between the source files, other than the compressing formats, is the end-of-line codes: Macintosh uses a carriage return, Unix uses a line feed, OS/2, Windows 95/NT uses both a carriage return and a line feed. This should make it easier to install Logtalk under other operating systems.

Directories and files organization

In the Logtalk installation directory, you will find the following files and directories:

BIBLIOGRAPHY - Logtalk bibliography in BibTeX format
INSTALL - Logtalk installation instructions
LICENSE - Logtalk user license
QUICK_START - Quick start instructions for those that do not like to read manuals
README - several useful information
RELEASE_NOTES - release notes for this version
UPGRADING - instructions in how to upgrade your programs to the current Logtalk version
compiler
NOTES - notes on the current status of the compiler
... - compiler source files
configs
NOTES - notes on the provided configuration files
template.config - template configuration file
... - specific configuration files
examples
NOTES - short description of the provided examples
bricks
NOTES - example description and other notes
SCRIPT - step by step example tutorial
loader.lgt - loader utility file for the example objects
... - bricks example source files
... - other examples
library
NOTES - short description of the library contents
all_loader.lgt - loader utility file for all library entities
... - library source files
manuals
NOTES - notes on the provided documentation
bibliography.html - bibliography
glossary.html - glossary
index.html - root document for all documentation
... - other documentation files
misc
NOTES - notes on diverse files for Logtalk packaging, installation, and integration with Prolog compilers
... - packaging, installation, and integration files
wenv
NOTES - notes on the text editors syntax configuration files providing syntax coloring for editing Logtalk source files
... - syntax configuration files
xml
NOTES - notes on the automatic generation of XML documentation files
logtalk.css - cascade style sheet file for the HTML output of the XSLT conversion of the XML files
logtalk.dtd - Document Type Description file describing the structure of the XML files
lgthtml.xsl - transformation style sheet to output HTML code from the XML files
... - other XML related files

Configuration files

Configuration files provide the glue code between the Logtalk preprocessor/runtime and a Prolog compiler. Each configuration file contains two sets of predicates: ISO Prolog standard predicates and directives not built-in in the target Prolog compiler and Logtalk-specific predicates.

Logtalk already includes ready to use configuration files for most academic and commercial Prolog compilers. If a configuration file is not available for the compiler that you intend to use, then you need to build a new one, starting from the included template.config file. Start by making a copy of the template file. Carefully check (or complete if needed) each listed definition. If your Prolog compiler conforms to the ISO standard, this task should only take you a few minutes. In most cases, you can borrow code from some of the predefined configuration files. If you are unsure that your Prolog compiler provides all the ISO predicates needed by Logtalk, try to run the system by setting the unknown predicate error handler to report as an error any call to a missing predicate. Better yet, switch to a modern, ISO compliant, Prolog compiler. If you send me your configuration file, with a reference to the target Prolog compiler, maybe I can include it in the next release of Logtalk.

Logtalk compiler and runtime

The compiler sub-directory contains the Prolog source file(s) that implement the Logtalk preprocessor/compiler and the Logtalk runtime. The compiler and the runtime may be split in two (or more) separate files or combined in a single file, depending on the Logtalk release that you are installing.

Library

Starting from version 2.7, Logtalk contains a standard library of useful objects, categories, and protocols. Read the corresponding NOTES file for details about the library contents.

Examples

Logtalk 2.x contains new implementations of some of the examples provided with previous 1.x versions. The sources of each one of these examples can be found included in a subdirectory with the same name, inside the directory examples. The majority of these examples include a file named SCRIPT that contains cases of simple utilization. Some examples may depend on other examples and library objects to work properly. Read the corresponding NOTES file for details before running an example.

Logtalk source files

Each Logtalk entity (object, category or protocol) is contained in a text file named after the entity. The extension .lgt is normally used. The Logtalk preprocessor compiles these files to plain Prolog, replacing the .lgt extension with .pl (the default Prolog extension). If your Prolog compiler expects the Prolog source filenames to end with a specific, different extension, you can set it in the corresponding configuration file.