Logtalk is compatible with almost any machine/operating system with a modern Prolog compiler available. Currently, my main development environment is an upgraded Apple PowerMacintosh 7600 running Mac OS 9 and LinuxPPC; most used compilers are the Mac port of GNU Prolog and, under Linux, YAP and SWI Prolog. 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).
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:
dynamic
, static
, built_in
)
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.
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.
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+
.
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.
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
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.
In the Logtalk installation directory, you will find the following files and directories:
BIBLIOGRAPHY
- Logtalk bibliography in BibTeX formatINSTALL
- Logtalk installation instructionsLICENSE
- Logtalk user licenseQUICK_START
- Quick start instructions for those that do not like to read manualsREADME
- several useful informationRELEASE_NOTES
- release notes for this versionUPGRADING
- instructions in how to upgrade your programs to the current Logtalk versioncompiler
NOTES
- notes on the current status of the compiler...
- compiler source filesconfigs
NOTES
- notes on the provided configuration filestemplate.config
- template configuration file...
- specific configuration filesexamples
NOTES
- short description of the provided examplesbricks
NOTES
- example description and other notesSCRIPT
- step by step example tutorialbricks.loader
- loader utility file for the example objects...
- bricks example source files...
- other exampleslibrary
NOTES
- short description of the library contentsall.loader
- loader utility file for all library entities...
- library source filesmanuals
NOTES
- notes on the provided documentationbibliography.html
- bibliographyglossary.html
- glossaryindex.html
- root document for all documentation...
- other documentation filesmisc
NOTES
- notes on diverse files for Logtalk packaging, installation, and integration with Prolog compilers...
- packaging, installation, and integration fileswenv
NOTES
- notes on the text editors syntax configuration files providing syntax coloring for editing Logtalk source files...
- syntax configuration filesxml
NOTES
- notes on the automatic generation of XML documentation fileslogtalk.css
- cascade style sheet file for the HTML output of the XSLT conversion of the XML fileslogtalk.dtd
- Document Type Description file describing the structure of the XML fileslgthtml.xsl
- transformation style sheet to output HTML code from the XML files...
- other XML related filesConfiguration 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.
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.
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.
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.
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.
Most examples directories contain a Prolog utility file that can be used to load all included source files. These loader utility files are named <dir name>.loader
and should be consulted like any ordinary Prolog file.
Usually these files contain a call to the Logtalk built-in predicates logtalk_load/1
or logtalk_load/2
, wrapped inside an initialization/1
directive (to ensure ISO compatiblity). For instance, if your code is split in three Logtalk source files named source1.lgt
, source2.lgt
, and source3.lgt
, then the contents of your loader file will be:
:- initialization( logtalk_load([ source1, source2, source3])).
These loader files may not work without modifications depending on the way your Prolog compiler deals with folders/directories. Most of the time you will need to set the working directory to be the one that contains the loader file in order to get the example source files loaded. Unfortunately, there is no portable way for us to do that from inside Logtalk due to differences between operating systems and lack of adequate operating system access support in some Prolog compilers.