Logtalk 2.26.2 files.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1486 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
pmoura 2005-12-24 18:00:21 +00:00
parent f5002fa37f
commit 9f1b358c04
382 changed files with 8056 additions and 8866 deletions

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================
@ -19,7 +19,7 @@ need of patching both Logtalk and Prolog compilers to workaround the lack of
strong Prolog standards.
1. LOGTALK INSTALLATION
1. LOGTALK BASIC INSTALLATION
Installing Logtalk can be as simple as decompressing the downloaded archive
and copying the resulting directory to a suitable location. This location
@ -46,35 +46,26 @@ directory can be copied to any location that its accessible by all the users
for some reason, not feasible or desired).
The "scripts" sub-directory contains shell scripts for easy installation of
Logtalk on MacOS X, Windows, Linux, and Unix-like operating systems (see the
"scripts/NOTES" file for details).
Logtalk on MacOS X, Windows, Linux, and Unix-like (POSIX) operating systems
(see the "scripts/NOTES" file for details).
After running the appropriated script for your operating-system, the second
step will be to run the Prolog integration scripts that you find on the
"scripts" sub-directory, assuming that your favorite Prolog compilers are
supported (if that is not the case, don't worry: just follow the steps
described in the "QUICK_START" file). The third step is for each user to
make a local copy of the Logtalk user-modifiable files to its home directory.
This allows each user to easily customize Logtalk to its needs. These copies
can be easily made by instructing end-users to simply run the shell command
"cplgtdirs" (the corresponding scripts are described in the "scripts/NOTES"
file).
>> POSIX systems installation (starting from the Logtalk directory):
% cd scripts
% sudo ./lgt_install.sh
>> Windows installation (starting from the Logtalk directory):
C:\logtalk> cd scripts
C:\logtalk> cscript lgt_install.js
RESTART
The "scripts/lgt_install.*" installation scripts make all files read-only in
order to avoid user tempering. This is a convenient setup for computer labs,
given that making directories world-writable is a security risk. Of course,
the local copies made by the "cplgtdirs" scripts have both read and write
permissions for the user running the script.
When used with one of the Prolog compilers for which an integration script
is provided on the "scripts" directory, this setup as the advantage of
allowing each end-user to independently customize default compilation options
and library paths.
given that making directories world-writable is a security risk.
2. LOGTALK CONFIGURATION
2.1 Setting environment variables
2. SETTING LOGTALK ENVIRONMENT VARIABLES
You need to set two environment variables, LOGTALKHOME and LOGTALKUSER. The
environment variable LOGTALKHOME should point to the Logtalk installation
@ -87,19 +78,19 @@ you have full permissions to the Logtalk installation directory. In addition,
you may want to add the Logtalk sub-directory "xml", which contains useful
scripts for processing XML documenting files, to your execution path.
* Unix and Unix-like systems:
>> POSIX systems:
If you use a csh shell, add the following line to your ~/.cshrc file:
setenv LOGTALKHOME /your/logtalk/installation/directory
setenv LOGTALKUSER $HOME/logtalk
setenv PATH $PATH:$LOGTALKUSER/xml:$LOGTALKHOME/scripts
setenv PATH $PATH:$LOGTALKHOME/xml:$LOGTALKHOME/scripts
If you use a bash shell, add the following lines to your ~/.profile file:
LOGTALKHOME=/your/logtalk/installation/directory
LOGTALKUSER=$HOME/logtalk
PATH=$PATH:$LOGTALKUSER/xml:$LOGTALKHOME/scripts
PATH=$PATH:$LOGTALKHOME/xml:$LOGTALKHOME/scripts
export PATH LOGTALKHOME LOGTALKUSER
When using the provided shell script for installing Logtalk, a symbolic link
@ -108,23 +99,66 @@ named "logtalk". In this case, you may use this symbolic link to define the
LOGTALKHOME environment variable in order to avoid breaking it when upgrading
Logtalk.
* Windows systems:
In Windows 95/98/ME, environment variables are defined in the "autoexec.bat"
file (you will need to reboot after editing the file):
SET LOGTALKHOME=C:\your\logtalk\installation\folder\
SET LOGTALKUSER=%HOMEPATH%\logtalk
>> Windows systems:
In Windows 2000/XP, environment variables are defined using the System
properties control panel (if you are a system administrator, you should
use the JScript install script provided in the "scripts" sub-directory;
this script sets the LOGTALKHOME environment variable for all users and
also sets the LOGTALKUSER environment variable for the administrator user
running the script).
properties control panel. If you are a system administrator, the "scripts/
lgt_install.js" JScript install script sets the LOGTALKHOME environment
variable for all users and also sets the LOGTALKUSER environment variable
for the administrator user running the script.
2.2 Setting library paths
3. CREATING NEW PROLOG TOP-LEVELS FOR AUTOMATIC LOADING OF LOGTALK
Most Prolog compilers allows the user to define an initialization file that
is automatically consulted at startup. This initialization file may contain
directives for loading other files, such as the Logtalk configuration file
and the Logtalk compiler. The "$LOGTALKHOME/scripts" sub-directory contains
several scripts (named "make_*lgt.*") for automating the creation of these
initialization files for some Prolog compilers. In addition, be sure to read
the "configs/NOTES" file notes on the Prolog compilers that you intend to use.
There are also "makeall_lgt.*" scripts that try to run all the individual
"make_*lgt.*" scripts:
>> POSIX systems:
% cd $LOGTALKHOME/scripts
% sudo ./makeall_lgt.sh
>> Windows:
C:\> cd %LOGTALKHOME%\scripts
C:\> cscript makeall_lgt.js
This assumes that your favorite Prolog compilers are supported by the
"make_*lgt.*" scripts. If that is not the case, don't worry: just follow
the steps described in the "QUICK_START" file.
4. COPYING THE LOGTALK USER-MODIFIABLE FILES TO USERS HOME DIRECTORIES
Each user must make a local copy of the Logtalk user-modifiable files to its
home directory. This setup allows each user to easily and independently
customize Logtalk to its needs. These copies can be easily made by instructing
end-users to simply run the shell scripts "cplgtdirs.*" (which are described
in the "scripts/NOTES" file).
>> POSIX systems:
% cplgtdirs
>> Windows:
C:\> cplgtdirs
The local copies made by the "cplgtdirs" scripts have both read and write
permissions for the user running the script. When used with one of the
Prolog compilers for which an integration script is provided on the "scripts"
directory, this setup as the advantage of allowing each end-user to
independently customize default compilation options and library paths.
5. SETTING LIBRARY PATHS
In Logtalk, a library is simply a directory containing source files. Library
paths can be declared using a dynamic predicate. This allows compiling and
@ -138,7 +172,7 @@ installation and your Prolog compiler and operating-system requirements. For
more details, see the file "$LOGTALKUSER/libpaths/NOTES".
2.3 Customizing Prolog configuration files
6. CUSTOMIZING PROLOG CONFIGURATION FILES
Logtalk interfaces with a specific Prolog compiler via a configuration file
that can be found on the "$LOGTALKUSER/configs" directory. These configuration
@ -147,29 +181,18 @@ used by Logtalk when compiling source files. For a full description of these
default flags, consult the "Running and debugging Logtalk programs" section of
the User Manual. Some of the default flags that you may want to change are:
"smart_compilation", "startup_message", "portability", "underscore_vars",
"altdirs", and the set of documentation-related flags ("xml", "xsl", "xmlspec",
and "doctype"). Be sure to read the "$LOGTALKUSER/configs/NOTES" file for
Prolog specific notes; some Prolog compilers do not support the whole range of
compilation flags.
"altdirs", and the set of documentation-related flags ("xmldocs", "xslfile",
"xmlspec", and "xmlsref"). Be sure to read the "$LOGTALKUSER/configs/NOTES"
file for Prolog specific notes; some Prolog compilers do not support the whole
range of compilation flag values.
2.4 Customizing documentation processing scripts and supporting files
7. CUSTOMIZING DOCUMENTATION PROCESSING SCRIPTS AND SUPPORTING FILES
Logtalk provides, in the "$LOGTALKUSER/xml" directory, a set of shell scripts,
CSS and XSLT style-sheets, and DTD and XML Schema files for processing the XML
documenting files that are automatically generated when you compile source
files. You may want to customize these scripts and their supporting files to
modify the layout or style of the resulting PDF/(X)HTML files or to write new
scripts and transformations to generate other formats. For more details, see
the file "$LOGTALKUSER/xml/NOTES".
3. CREATING NEW PROLOG TOP-LEVELS FOR AUTOMATIC LOADING OF LOGTALK
Most Prolog compilers allows the user to define an initialization file that
is automatically consulted at startup. This initialization file may contain
directives for loading other files, such as the Logtalk configuration file
and the Logtalk compiler. The "$LOGTALKHOME/scripts" sub-directory contains
several scripts for automating the creation of these initialization files
for some Prolog compilers. In addition, be sure to read the "configs/NOTES"
file notes on the Prolog compilers that you intend to use.
files. You may want to customize these CSS and XSLT files to modify the layout
or style of the resulting PDF/(X)HTML files or to write new scripts and
transformations to generate other formats. For more details, see the file
"$LOGTALKUSER/xml/NOTES".

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================
@ -68,9 +68,9 @@ sub-directory.
2. Read the example NOTES file for a description of the example.
3. Open SCRIPT file for instructions on how to load the example and for sample
queries that you may try by copying-and-pasting or dragging-and-droping them
on your Prolog interpreter top-level.
3. Open the SCRIPT file for instructions on how to load the example and for
sample queries that you may try by copying-and-pasting or dragging-and-droping
them on your Prolog interpreter top-level.
Ready to start writing your own programs?

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================
@ -31,8 +31,7 @@ stated.
2. HOME OF LOGTALK PACKAGE
The latest release of the Logtalk package is always available at the
URL:
The latest release of the Logtalk package is always available at the URL:
http://www.logtalk.org/
@ -45,7 +44,7 @@ about Logtalk.
To register as a Logtalk user either use the registration form found at
the Logtalk web site or send an email message to:
registration@logtalk.org
registration@logtalk.org
with the following information:
@ -59,34 +58,36 @@ platforms (mac, pc, unix,...) (optional)
Logtalk support is available for registered users via email to
support@logtalk.org.
At the URL http://www.logtalk.org/bugs.html you can find a list of
known problems and download bug fixes. The latest news about Logtalk are
At the URL http://www.logtalk.org/bugs.html you can find a list of known
problems and download bug fixes. The latest news about Logtalk are
available at the URL http://www.logtalk.org/news.html.
There is also a mailing list, logtalk, used to announce new releases and
bug fixes and for discussion between Logtalk users, that you can subscribe.
For instructions on how to subscribe open the web page:
There is also a mailing list, "logtalk", used to announce new releases and
bug fixes and for discussion between registered Logtalk users, that you
may subscribe. For instructions on how to subscribe, please visit the web
page:
http://sagitta.ci.uc.pt/mailman/listinfo.cgi/logtalk
http://lserv.ci.uc.pt/mailman/listinfo/logtalk
or send an email message to:
logtalk-request@list-serv.ci.uc.pt
logtalk-request@lserv.ci.uc.pt
with just the word "help" in the subject or in the message body.
5. INSTALLATION
Installing Logtalk is just a matter of uncompressing/unpacking the
distribution archive file for your operating system. You can install
Logtalk in any directory that you find convenient. See the file INSTALL
for detailed instructions on how to customize your working environment.
Installing Logtalk is just a matter of uncompressing/unpacking the
distribution archive file for your operating system and running a
few shell scripts. You may install Logtalk in any directory that
you find convenient. See the file INSTALL for detailed instructions
on how to customize your working environment.
See the user manual for a description of the source files organization
and for using instructions (to read the user manual open the file
"manuals/index.html" with a web browser). Most files are formatted using
four-space tabs.
"manuals/index.html" with a web browser). Most files are formatted
using four-space tabs.
6. QUICK START
@ -98,23 +99,18 @@ to run Logtalk, provided that your favorite Prolog compiler is supported.
7. DOCUMENTATION
The reference and user manuals and the tutorial are provided in XHTML format
and can be found in the manuals directory.
and can be found in the "manuals" directory.
PDF versions of all documentation are also available as a separated download
from the Logtalk web site. The PDF files include page numbers, an index, and
a table of contents and are available for printing in both A4 and US Letter
paper formats.
The file RELEASE_NOTES contains descriptions of the changes made in Logtalk
since the first public version. Read it carefully if you have been using a
previous Logtalk version.
The file RELEASE_NOTES contains descriptions of all Logtalk updates since the
first public version. Read it carefully if you have been using a previous
Logtalk version.
8. UPGRADING
If you have been using a previous Logtalk version read the file UPGRADING for
instructions on how to upgrade your programs or your custom configuration
files to run under this new version.
If you are upgrading from a previous Logtalk version, please check the file
UPGRADING for instructions on how to upgrade your programs or your custom
configuration files to run under this new version.
9. CITATIONS

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================
@ -10,6 +10,186 @@ RELEASE NOTES
=============
2.26.2 - December 20, 2005
Improved error-checking for the Logtalk compiler and for the grammar rule
translator.
Small performance improvements for message sending and for the built-in
database methods.
Corrected a bug on the implementation of the built-in methods phrase/2-3
for negated grammar rule bodies (thanks to Mats Carlsson for pointing the
error).
Removed the read-only compiler flag "iso_initialization_dir".
Corrected a compilation bug on the "metapredicates" example source file.
Corrected several bugs on the performance monitor of the "searching"
example.
Switched off default generation of XML documenting files for the "symdiff"
example in order to avoid file names compatibility problems on Windows.
Updated compatibility notes on B-Prolog 6.8 and Qu-Prolog 7.0. Added a
config file for the forthcoming SICStus Prolog 4.0 version (based only
on publicly available information). Updated the config file for Amzi!
Prolog to solve issues with predicate properties and to ensure that file
system utility predicates are loaded.
Added a config file for the current XSB CVS version and the corresponding
integration shell scripts (for both Windows and POSIX systems). Modified
the "cplgtdirs.*" shell scripts in order to make either links or copies of
the config files and the "libpaths.pl" file with the required ".P" file
name extension.
Improved integration scripts documentation and help screens.
Added a predicate for checking directory existence to the config files.
2.26.1 - November 28, 2005
Added a CSS style-sheet to the Logtalk XHTML documentation that can be
used with CSSToXSLFO to generate nicely formatted PDF files suitable for
printing with running headers and page numbers.
Updated the Logtalk XHTML documentation for compliance with the XHTML 1.1
standard.
Updated the "lgtxhtml.xsl" XSLT file in order to generate XHTML 1.1 files.
Added a new, generic "lgtpdf.xsl" XSLT file. Redefined the "lgtpdfa4.xsl"
and "lgtpdfus.xsl" files to import the "lgtpdf.xsl" file.
Added support for the Lunasil XSL-FO processor to the "lgt2pdf.*" shell
scripts.
Updated the "lgt2pdf.sh", "lgt2xml.sh", and "lgt2html.sh" shell scripts
in order to write a warning message when the current directory does not
contain any XML documenting file.
Added a definition for missing open/4 ISO Prolog predicate to the config
files of Open Prolog, LPA Prolog compilers, and MasterProlog.
2.26.0 - November 7, 2005
Added support for defining predicate aliases when using uses/2 directives
(using the format Predicate::Alias).
Added Prolog modules migration code allowing modules to be compiled as
objects and allowing messages to be sent to modules. Added a new "modules"
example.
Added a "Prolog Integration and Migration Guide" to the Logtalk
documentation.
Added support for syntax coloring of common Prolog module directives to
the configuration files of the supported text editors.
Added support for using library aliases on the second argument of the
logtalk_library_path/2 predicate (using the format alias(path)).
Added support for ignoring, copying as-is, or rewriting proprietary Prolog
directives. The action to be taken is defined on a per-directive basis on
the config files.
Updated the config files of CIAO, ECLiPSe, SWI-Prolog, and YAP to define
actions for some proprietary directives in order to allow some or most of
the module libraries distributed with these compilers to be compiled as
objects.
Renamed some XML documentation-related compiler flags to more meaningful
names: "xml" -> "xmldocs", "xsl" -> "xslfile", and "doctype" -> "xmlsref".
No changes to the other flags or flag valid values.
Updated documenting scripts to use system-wide resources from LOGTALKHOME
and user-modifiable resources from LOGTALKUSER.
Updated "cplgtdirs.*" shell scripts to create links to the documenting
scripts and to the DTD and XML Schema specifications instead of making
local copies. Updated the "cplgtdirs.js" Windows JScript script to create
a link to the Logtalk manuals.
Changed generation of predicate compiled functors to add an underscore
between the original predicate functor and arity (further minimizing the
chance of name conflicts).
Improved compilation warning messages (separately handling plural and
singular forms).
Improved documentation of Windows JScript installation and integration
scripts.
Corrected a bug on the Logtalk built-in debugger on the processing of the
abort option at a leashed port (option was ignored instead of aborting the
debugging session).
Added an option to choose between a "verbose" or "compact" listing of the
default compilation flags at Logtalk startup (defined on the config files).
Improved CIAO integration scripts in order to suppress some (harmless)
warnings which are generated at first run.
Updated SWI-Prolog hook file ("swihook.pl") in order to support Logtalk
library notation when loading Logtalk files using the SWI-Prolog consult/1
predicate.
Corrected a bug on the implementation of the built-in method abolish/1
that prevented abolishing of dynamic predicates with arity zero.
Corrected a bug on the "gplgt" shell script generated by the make_gplgt.sh
shell script where the value of the LOGTALKHOME environment variable would
not be retrieved at runtime.
Removed config file for older versions of XSB (up to 2.6). Renamed the
config file for XSB 2.7.1 to simply "xsb.config".
Consolidated the source files of the "birds", "errors", "lpa", "lo",
"metainterpreters", "poem", "relations", "roots", and "symdiff" examples
into single source files. Updated the "searching" example to take advantage
of the uses/2 directive.
Removed outdated documenting shell scripts from the "xml" directory.
Corrected a bug when compiling a source file where the generated Prolog
file might not be properly closed when a compilation error occurs.
2.25.3 - September 12, 2005
Consolidated the source files of the examples "bricks", "dynpred", "mi",
"parametric", "points", "polygons", "reflection", "shapes", "sicstus",
and "viewpoints" into single source files.
Improved documentation on most example source files. Improved "parametric"
example by adding a new parametric objects and by illustrating alternative
ways of accessing object parameters.
Updated several config files with declarations for some more non-standard
Prolog meta-predicates.
Corrected some omissions and typos on the B-Prolog - Logtalk integration
instructions.
Small performance optimization for messages and super-calls with not yet
cached method lookups.
2.25.2 - August 11, 2005
Updated Logtalk installation and Prolog integration scripts in order to
detect a wrongly defined LOGTALKHOME environment variable.
Corrected a bug on the lgt_install.sh and make*lgt.sh shell scripts where
the wrong variable was being referenced when testing the existence of the
installation directory prefix.
Corrected a bug on the makeall_lgt.sh shell script that failed to properly
detect unsuccessful completion of individual Prolog integration scripts.
2.25.1 - August 8, 2005
Added support for using the "source-highlight" package (version 2.0 or
@ -215,7 +395,7 @@ RELEASE NOTES
2.22.5 - February 9, 2005
Added scripts for easy integration of Logtalk with K-Prolog. Updated the
K-Prolog config file, correcting a showstopper bug and enabling support
K-Prolog config file, correcting a show-stopper bug and enabling support
for using the "library" notation for loading source files.
Updated JIProlog config file in order to allow smart compilation of source
@ -524,7 +704,7 @@ RELEASE NOTES
Updated the syntax coloring configuration files for the supported text
editors for the new alias/3 predicate directive.
Added autocomplete strings for Logtalk methods and for Logtalk and Prolog
Added auto-complete strings for Logtalk methods and for Logtalk and Prolog
built-in predicates and directives to the SubEthaEdit 2.x text editor.
Corrected a bug which prevented compilation of metafiles containing
@ -538,7 +718,7 @@ RELEASE NOTES
compilers.
Improved user manual section on defining object and category metapredicates
and on calling non-stardard Prolog built-in metapredicates. Improved the
and on calling non-standard Prolog built-in metapredicates. Improved the
description of some compiler options.
Added some files missing from the "errors" example (which should have been
@ -956,7 +1136,7 @@ RELEASE NOTES
2.14.6 - December 31, 2002
Corrected a bug where the opening directive of an object that,
simultaneously, implements a protocol, imports a categoty, instantiates
simultaneously, implements a protocol, imports a category, instantiates
a class, and specializes a superclass, will not be recognized.
@ -974,7 +1154,7 @@ RELEASE NOTES
2.14.4 - November 5, 2002
Removed definition of depracated built-in predicate logtalk_version/3.
Removed definition of deprecated built-in predicate logtalk_version/3.
Show flag names when printing at startup the default flag values.
@ -989,7 +1169,7 @@ RELEASE NOTES
in the PassiveTeX 1.21 XSL:FO processor.
2.14.3 - Sptember 16, 2002
2.14.3 - September 16, 2002
New compiler option, doctype, to set the doctype reference (if any)
in the XML documenting files. Default value is "local" for backward
@ -1118,7 +1298,7 @@ RELEASE NOTES
at startup.
Reworked Logtalk pre-processor compilation and loading reports. Compiler
option "report" now togles between normal reporting (as specified by the
option "report" now toggles between normal reporting (as specified by the
other flags) and silent compilation/loading of source files.
@ -1157,7 +1337,7 @@ RELEASE NOTES
Renamed config file predicate lgt_default_compiler_option/2 to lgt_flag/2.
New XSL stylesheets and shell scripts to convert Logtalk XML entity
New XSL style-sheets and shell scripts to convert Logtalk XML entity
documenting files to PDF format using XSL Formating Objects.
@ -1183,7 +1363,7 @@ RELEASE NOTES
and info/2 directives.
Changed the order of object loading in the "mi" example to avoid
suporious warning messages.
spurious warning messages.
Added a new problem ("bridge") to the "searching" example. Improved
"performance" monitor to give correct reports on alternative solutions.
@ -1198,7 +1378,7 @@ RELEASE NOTES
entities (by default) prints a warning. Updated user and reference
manuals.
Rewrited all the compiler warning/error code and output messages.
Rewritten all the compiler warning/error code and output messages.
Changed compiled code functors postfixes from "_sdcl" and "_sdef" to
"_idcl" and "_idef" (implies recompilation of all objects, protocols,
@ -1243,11 +1423,11 @@ RELEASE NOTES
Corrected a bug where sending a message for a built-in method to an
unknown object fails instead of generating the expected exception.
Put some ocorrences of atoms public, mode, and type between ()'s to
Put some occurrences of atoms public, mode, and type between ()'s to
avoid compilation errors in BinProlog 8.0 and other Prolog compilers
that declare these atoms as operators.
Corrected the definition of the state space of the "Missionaires and
Corrected the definition of the state space of the "Missionaries and
Cannibals" problem in the "searching" example that resulted in some
wrong solutions.
@ -1444,7 +1624,7 @@ RELEASE NOTES
Logtalk is now an Open Source project, available under Perl's Artistic
license.
Two new examples: instmethods, ilustrating the use of instance defined
Two new examples: instmethods, illustrating the use of instance defined
methods, and classvars, showing how to implement class variables.
Updated Logtalk grammar to explicitly allow for user-defined types
@ -1564,7 +1744,7 @@ RELEASE NOTES
pre-processor.
Removed variables example. The category attributes is now part of the
kernel example. Corrected some warmless syntax errors in directives in
kernel example. Corrected some harmless syntax errors in directives in
kernel/attributes.lgt, kernel/monitor.lgt and miscellaneous/queens.lgt.
Changed name of blocks example to bricks and object "block" to "brick"
@ -1624,7 +1804,7 @@ RELEASE NOTES
New config file for MasterProlog 4.1; removed config file for the
old BIM Prolog 4.0.
Corrected an error in the config file for OpenProlog in the definiton
Corrected an error in the config file for OpenProlog in the definition
of the write_term/3 predicate.
Added a safer definition for write_term/3 predicate in the config
@ -1672,7 +1852,7 @@ RELEASE NOTES
Modified the examples loader utility files to make only a call to
logtalk_load/1 by using a list of entities. This should make it easy to
modify these files for compilers that don't support arbritrary queries
modify these files for compilers that don't support arbitrary queries
in a file.
Logtalk runtime no longer tries to catch some of the errors thrown

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================
@ -17,7 +17,7 @@ sample queries for your to try.
Most of these examples need objects, protocols, and categories which are
defined in the Logtalk standard library or in other examples. See the NOTES
files inside the library folder, plus the NOTES and SCRIPT files inside each
example folder).
example folder.
Some examples may redefine objects already loaded from other examples.
You may want to restart Logtalk after trying each example.
@ -32,7 +32,7 @@ files to fully understand them.
All examples are formatted using four spaces tabs.
By default, compiling an example generates a .xml documenting file for each
compiled entity (object, category, or protocol). See the xml folder for
compiled entity (object, category, or protocol). See the "xml" folder for
instructions on how to browse the .xml files for on-line reading or how to
convert the files to a print-ready format such as PDF.
@ -41,7 +41,8 @@ Here is a short description of each included example:
aliases
example of using the alias/3 predicate directive to provide alternative
names to inherited predicates in order to improve readability
names to inherited predicates in order to improve readability or to solve
multi-inheritance conflicts
assignvars
example of using assignable variables in the context of parametric objects
@ -82,9 +83,10 @@ engines
errors
example showing the Logtalk compiler warning and error reporting
for common programming errors
hello_world
the unavoidable hello world programming example
the unavoidable "hello world" programming example
inheritance
examples of public, protected, and private inheritance using both
@ -115,6 +117,9 @@ mi
miscellaneous
unsorted examples
modules
simple example of compiling Prolog module files as objects
msglog
example of using events and monitors for recording, replaying, and
printing user messages
@ -148,7 +153,7 @@ relations
constrained relations between objects
roots
objects, protocols and categories needed by most of the other examples
objects, protocols, and categories needed by most of the other examples;
searching
state-space searching framework

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,4 +1,13 @@
:- initialization(
logtalk_load([
aliases])).
logtalk_load(
[aliases])).
/*
If you intend to use the FOP XSL:FO processor for generating PDF documenting
files, comment the directive above and uncomment the directive below
:- initialization(
logtalk_load(
[aliases], [xmlsref(standalone)])).
*/

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,5 +1,13 @@
:- initialization(
logtalk_load([
fsm3,
rectangle3])).
logtalk_load(
[fsm3, rectangle3])).
/*
If you intend to use the FOP XSL:FO processor for generating PDF documenting
files, comment the directive above and uncomment the directive below
:- initialization(
logtalk_load(
[fsm3, rectangle3], [xmlsref(standalone)])).
*/

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,5 +1,4 @@
:- object(database).
:- public(db_test_this/0, db_test_self/0, db_test_obj/0).
@ -25,7 +24,6 @@
fail.
db_test_self.
db_test_obj :-
this(This),
{repeat(100)},

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -2,41 +2,14 @@
:- initialization(
logtalk_load([
descriptors,
order,
expert,
birds])).
falconiforms, % orders
passerformes,
tubenose,
waterfowl,
/*
If you intend to use the FOP XSL:FO processor for generating PDF documenting
files, comment the directive above and uncomment the directive below
albatross, % families
duck,
falcon,
flycatcher,
goose,
swallow,
swan,
vulture,
ash_throated_flycatcher, % birds
barn_swallow,
black_footed_albatross,
california_condor,
canada_goose,
cliff_swallow,
female_mallard,
fulmar,
great_crested_flycatcher,
laysan_albatross,
male_mallard,
peregrine_falcon,
pintail,
purple_martin,
snow_goose,
sparrow_hawk,
trumpeter_swan,
turkey_vulture,
whistling_swan])).
:- initialization(
logtalk_load(
[birds], [xmlsref(standalone)])).
*/

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,7 +1,13 @@
:- initialization(
logtalk_load([
brick,
brick_stack,
stack_monitor],
[events(on)])).
logtalk_load(
[bricks], [events(on)])).
/*
If you intend to use the FOP XSL:FO processor for generating PDF documenting
files, comment the directive above and uncomment the directive below
:- initialization(
logtalk_load(
[bricks], [events(on), xmlsref(standalone)])).
*/

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,4 +1,13 @@
:- initialization(
logtalk_load([
classvars])).
logtalk_load(
[classvars])).
/*
If you intend to use the FOP XSL:FO processor for generating PDF documenting
files, comment the directive above and uncomment the directive below
:- initialization(
logtalk_load(
[classvars], [xmlsref(standalone)])).
*/

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================
@ -15,7 +15,7 @@ objects and categories:
canonical DCG example of parsing arithmetic expressions
bom
bill of materials DCG example (see below for original source)
sentence
sentences
simple parsing of natural language sentences
parsetree
same as above but building and returning the parse tree
@ -30,11 +30,15 @@ objects and categories:
walker
parsing of walker movements and calculation of distance
travelled
bypass
using the {} DCG construct together with the {} Logtalk control
construct
This folder contains two examples of DCGs (bom and faa) adopted with
This folder contains two examples of DCGs ("bom" and "faa") adopted with
permission from the Amzi! Prolog documentation. The documentation is
available on-line in HTML format at the URL:
http://www.amzi.com/
Please refer to the book for more information on the original examples.
Please refer to the Amzi! Prolog documentation for more information on the
original examples.

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,5 +1,5 @@
bar :-
bar :- % test predicate
write('bar predicate called'), nl.
@ -10,6 +10,6 @@ bar :-
:- info(foo//0, [
comment is 'Just the almighty and famous old foo.']).
foo --> {{bar}}.
foo --> {{bar}}. % the external pair of {}'s have the usual DCG semantics;
% the internal pair of {}'s is the Logtalk compiler bypass control construct
:- end_object.

View File

@ -4,10 +4,7 @@
parsep,
calculator,
parsetree,
determiners,
nouns,
verbs,
sentence,
sentences,
url,
xml,
shell,
@ -16,3 +13,23 @@
faa,
bypass,
dcgtest])).
/*
If you intend to use the FOP XSL:FO processor for generating PDF documenting
files, comment the directive above and uncomment the directive below
:- initialization(
logtalk_load(
[parsep,
calculator,
parsetree,
sentences,
url,
xml,
shell,
walker,
bom,
faa,
bypass,
dcgtest], [xmlsref(standalone)])).
*/

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,6 +1,13 @@
:- initialization(
logtalk_load([
diamond1,
diamond2,
diamond3])).
logtalk_load(
[diamond1, diamond2, diamond3])).
/*
If you intend to use the FOP XSL:FO processor for generating PDF documenting
files, comment the directive above and uncomment the directive below
:- initialization(
logtalk_load(
[diamond1, diamond2, diamond3], [xmlsref(standalone)])).
*/

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,9 +1,17 @@
:- initialization(
logtalk_load([
root,
descendant,
metaclass,
class,
instance,
protos,
classes,
prototype])).
/*
If you intend to use the FOP XSL:FO processor for generating PDF documenting
files, comment the directive above and uncomment the directive below
:- initialization(
logtalk_load(
[protos,
classes,
prototype], [xmlsref(standalone)])).
*/

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================
@ -20,10 +20,10 @@ need to configure your text editor to open the source file using the
declared encoding. If you are using the SWI-Prolog GUI application on
Windows, be sure to select a font which supports Unicode characters.
Currently, Logtalk accepts any atom is an argument for the encoding/1
The current Logtalk version accepts any atom as an argument for the encoding/1
directive. As, by default, Logtalk automatically generates a XML documenting
file for each compiled entity, the following table is used to set the
encoding of the XML file:
file for each compiled entity, the following table is used to set the encoding
of the XML file:
Logtalk source file XML file
ascii us-ascii

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,5 +1,5 @@
:- encoding(utf8).
:- encoding(utf8). % this directive, when present, must be the first term in a source file
:- object(babel).
@ -21,7 +21,7 @@
hello_world(es, '¡Hola mundo!').
hello_world(ja, 'こんにちは世界!').
hello_world(ko, '여보세요 세계!').
hello_world(nl, 'Hello wereld!').
hello_world(nl, 'Hallo wereld!').
hello_world(pt, 'Olá mundo!').
hello_world(ru, 'Здравствулте! мир!').
hello_world(zh, '你好世界!').

View File

@ -1,5 +1,5 @@
:- encoding(iso_latin_1).
:- encoding(iso_latin_1). % this directive, when present, must be the first term in a source file
:- object(latin).

View File

@ -1,5 +1,13 @@
:- initialization(
logtalk_load([
babel,
latin])).
logtalk_load(
[babel, latin])).
/*
If you intend to use the FOP XSL:FO processor for generating PDF documenting
files, comment the directive above and uncomment the directive below
:- initialization(
logtalk_load(
[babel, latin], [xmlsref(standalone)])).
*/

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,4 +1,13 @@
:- initialization(
logtalk_load([
engines])).
logtalk_load(
[engines])).
/*
If you intend to use the FOP XSL:FO processor for generating PDF documenting
files, comment the directive above and uncomment the directive below
:- initialization(
logtalk_load(
[engines], [xmlsref(standalone)])).
*/

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================
@ -16,6 +16,6 @@ source files in a text editor to better understand how the compiler
deals with common programming errors.
Note that the warnings and errors that you will get while compiling
your files depend on your compiler flags (defined explicitly as
parameters in the logtalk_compile/2 or logtalk_load/2 built-in
predicates or by default in your configuration file).
your source files depend on your compiler flags (defined explicitly
as parameters for the logtalk_compile/2 or logtalk_load/2 built-in
predicates or by default in your Prolog configuration file).

View File

@ -1,13 +1,15 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================
% The entities on this example are divided in two sets. To load each
% sets of entities, compile and load the corresponding loader files:
The entities on this example are divided in two sets. The first set
results on compiler warning messages, while the second set results
in compiler error messages. To load each sets of entities, compile
and load the corresponding loader files:
| ?- logtalk_load(errors(warnings_loader)).
...

View File

@ -1,14 +1,13 @@
:- category(catdynpred).
% dynamic predicates may be declared inside categories but ...
:- public(dynpred/1).
:- dynamic(dynpred/1).
% ... clauses for dynamic predicates are not allowed
dynpred(1).
dynpred(2).
dynpred(3).
:- end_object.

View File

@ -1,7 +1,7 @@
:- object(ccredef).
::(_).
:- end_object.
% Logtalk built-in control constructs cannot be redefined
::(_).
:- end_object.

View File

@ -1,62 +1,12 @@
:- initialization((
catch(
logtalk_load(
[lgtmthdredef],
[unknown(warning), misspelt(warning), singletons(warning), plredef(warning), lgtredef(warning), report(on)]),
_,
true),
catch(
logtalk_load(
[invclause],
[unknown(warning), misspelt(warning), singletons(warning), plredef(warning), lgtredef(warning), report(on)]),
_,
true),
catch(
logtalk_load(
[unknowndir],
[unknown(warning), misspelt(warning), singletons(warning), plredef(warning), lgtredef(warning), report(on)]),
_,
true),
catch(
logtalk_load(
[noninstdir],
[unknown(warning), misspelt(warning), singletons(warning), plredef(warning), lgtredef(warning), report(on)]),
_,
true),
catch(
logtalk_load(
[invargdir],
[unknown(warning), misspelt(warning), singletons(warning), plredef(warning), lgtredef(warning), report(on)]),
_,
true),
catch(
logtalk_load(
[unmatchdir],
[unknown(warning), misspelt(warning), singletons(warning), plredef(warning), lgtredef(warning), report(on)]),
_,
true),
catch(
logtalk_load(
[catdynpred],
[unknown(warning), misspelt(warning), singletons(warning), plredef(warning), lgtredef(warning), report(on)]),
_,
true),
catch(
logtalk_load(
[ccredef],
[unknown(warning), misspelt(warning), singletons(warning), plredef(warning), lgtredef(warning), report(on)]),
_,
true),
catch(
logtalk_load(
[usesrepeated],
[unknown(warning), misspelt(warning), singletons(warning), plredef(warning), lgtredef(warning), report(on)]),
_,
true),
catch(
logtalk_load(
[usesconflict],
[unknown(warning), misspelt(warning), singletons(warning), plredef(warning), lgtredef(warning), report(on)]),
_,
true))).
catch(logtalk_load(lgtmthdredef, [report(on)]), _, true),
catch(logtalk_load(invclause, [report(on)]), _, true),
catch(logtalk_load(unknowndir, [report(on)]), _, true),
catch(logtalk_load(noninstdir, [report(on)]), _, true),
catch(logtalk_load(invargdir, [report(on)]), _, true),
catch(logtalk_load(unmatchdir, [report(on)]), _, true),
catch(logtalk_load(catdynpred, [report(on)]), _, true),
catch(logtalk_load(ccredef, [report(on)]), _, true),
catch(logtalk_load(usesrepeated, [report(on)]), _, true),
catch(logtalk_load(usesconflict, [report(on)]), _, true))).

View File

@ -1,8 +1,7 @@
:- object(invargdir).
% invalid directive argument
:- public(1234).
:- end_object.

View File

@ -1,9 +1,8 @@
:- object(invclause).
% invalid clause head
1234 :-
write(hello).
:- end_object.

View File

@ -1,8 +1,7 @@
:- object(lgtmthdredef).
% Logtalk built-in methods cannot be redefined
asserta(_).
:- end_object.

View File

@ -1,8 +1,7 @@
:- object(noninstdir).
% misspelt directive functor
:- Public(predicate/0).
:- end_object.

View File

@ -1,8 +1,7 @@
:- object(unknowndir).
% unknown directive
:- index(predicate/3, [1, 2]).
:- end_object.

View File

@ -1,4 +1,6 @@
% misspelt opening object directive
:- objecto(unmatchdir).

View File

@ -1,10 +1,12 @@
% conflict between uses/2 directive and a predicate definition
:-object(usesconflict).
:- uses(list, [member/2]).
member(H, [H| _]).
member(H, [_| T]) :-
member(H, [H| _]). % an object (or category) cannot define a
member(H, [_| T]) :- % predicate referenced on a uses/2 directive
member(H, T).
:- end_object.

View File

@ -1,7 +1,9 @@
% conflict between uses/2 directives
:-object(usesrepeated).
:- uses(list, [member/2]).
:- uses(set, [member/2]).
:- uses(list, [member/2]). % a predicate cannot be referenced
:- uses(set, [member/2]). % in more than one uses/2 directive
:- end_object.

View File

@ -1,5 +1,5 @@
:- initialization(
logtalk_load(
[misspell, singletons1, plredef, lgtredef, unknownrefs, portability],
[warnings],
[unknown(warning), misspelt(warning), singletons(warning), plredef(warning), lgtredef(warning), portability(warning), report(on)])).

View File

@ -1,13 +1,13 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================
To load this example and for sample queries, please see the SCRIPT
file.
No self-respected programming language could do without a "Hello
World" example!
To load this example and for sample queries, please see the SCRIPT
file.

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -2,3 +2,12 @@
:- initialization(
logtalk_load([
hello_world])).
/*
If you intend to use the FOP XSL:FO processor for generating PDF documenting
files, comment the directive above and uncomment the directive below
:- initialization(
logtalk_load(
[hello_world], [xmlsref(standalone)])).
*/

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,7 +1,13 @@
:- initialization(
logtalk_load([
predicates,
interface,
prototypes,
classes])).
logtalk_load(
[predicates, interface, prototypes, classes])).
/*
If you intend to use the FOP XSL:FO processor for generating PDF documenting
files, comment the directive above and uncomment the directive below
:- initialization(
logtalk_load(
[predicates, interface, prototypes, classes], [xmlsref(standalone)])).
*/

View File

@ -1,7 +1,7 @@
/*
This category defines a set of predicates, which are imported by the
roots of both the class-based and the prototype-based hierarchies of
this example
this example.
*/
:- category(predicates).

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,4 +1,13 @@
:- initialization(
logtalk_load([
instmethods])).
logtalk_load(
[instmethods])).
/*
If you intend to use the FOP XSL:FO processor for generating PDF documenting
files, comment the directive above and uncomment the directive below
:- initialization(
logtalk_load(
[instmethods], [xmlsref(standalone)])).
*/

View File

@ -1,16 +1,16 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================
The examples in this folder are adopted from the Logic&Objects system
by Francis G. McCabe. Detailed descriptions and the original source code
can be found on the book "Logic and Objects" by the author published by
Prentice Hall.
by Francis G. McCabe. Detailed descriptions and the original source
code can be found on the McCabe's "Logic and Objects" book, published
by Prentice Hall.
Note that because Logtalk lacks the functional notation of the
Note that, as Logtalk lacks the functional notation found on the
Logic&Objects system, my adaptation of the book examples may have
introduced some bugs not present in the original code.

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,21 +1,13 @@
:- initialization(
logtalk_load([
plan1,
airport,
aberdeen_air,
city,
london,
albert_hall,
edinburgh,
edin,
aiai,
castle,
fly,
glasgow,
imperial,
lhr,
manchester,
renfrew,
ringway,
victoria])).
planner])).
/*
If you intend to use the FOP XSL:FO processor for generating PDF documenting
files, comment the directive above and uncomment the directive below
:- initialization(
logtalk_load(
[planner], [xmlsref(standalone)])).
*/

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================
@ -16,7 +16,7 @@ Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
| ?- incremental::route([london, brighton, portsmouth, exeter, oxford, aberystwyth], Route).
Route = oxford~london~portsmouth~brighton~exeter~aberystwyth ?
Route = oxford-london-portsmouth-brighton-exeter-aberystwyth ?
yes
@ -24,7 +24,7 @@ yes
| ?- presort::route([london, brighton, portsmouth, exeter, oxford, aberystwyth], Route).
Route = brighton~london~oxford~portsmouth~exeter~aberystwyth ?
Route = brighton-london-oxford-portsmouth-exeter-aberystwyth ?
yes
@ -32,7 +32,7 @@ yes
| ?- circular::route([london, brighton, portsmouth, exeter, oxford, aberystwyth], Route).
Route = london~brighton~portsmouth~exeter~aberystwyth~oxford~london ?
Route = london-brighton-portsmouth-exeter-aberystwyth-oxford-london ?
yes
@ -40,5 +40,5 @@ yes
| ?- permute::route([london, brighton, portsmouth, exeter, oxford, aberystwyth], Route).
Route = (aberystwyth~exeter~portsmouth~brighton~london~oxford,273.6237583942784) ?
Route = (aberystwyth-exeter-portsmouth-brighton-london-oxford,273.6237583942784) ?
yes

View File

@ -1,47 +1,13 @@
:- op(400, yfx, ~).
:- initialization(
logtalk_load([
quick1,
logtalk_load(
[sorting, towns, salesman])).
location2,
/*
If you intend to use the FOP XSL:FO processor for generating PDF documenting
files, comment the directive above and uncomment the directive below
aberdeen,
aberystwyth,
birmingham,
brighton,
bristol,
cambridge,
cardiff,
carlisle,
dover,
edinburgh,
exeter,
glasgow,
hull,
leeds,
liverpool,
london,
manchester,
newcastle,
nottingham,
oxford,
penzance,
portsmouth,
sheffield,
swansea,
york,
salesman,
circular,
incremental,
presort,
driving,
geographic2,
metric1,
permute,
descend,
natural])).
:- initialization(
logtalk_load(
[sorting, towns, salesman], [xmlsref(standalone)])).
*/

View File

@ -1,7 +1,6 @@
:- object(salesman).
:- info([
author is 'Paulo Moura',
version is 1.0,
@ -9,12 +8,266 @@
comment is '.',
source is 'Example adopted from the Francis G. McCabe L&O documentation.']).
:- op(400, yfx, ~).
:- public(route/2).
:- mode(route(+list, -nonvar), zero_or_more).
:- end_object.
:- object(circular,
extends(salesman)).
:- info([
author is 'Paulo Moura',
version is 1.0,
date is 2000/4/22,
comment is '.',
source is 'Example adopted from the Francis G. McCabe L&O documentation.']).
route([Town| Towns], Route) :-
route(Towns, Town-Town, Route).
route([], Route, Route).
route([Town| Towns], Route, Route2) :-
best_place(Route, Town, Best),
split(Best, Route, Town, Split),
route(Towns, Split, Route2).
best_place(Route, Town, Best) :-
best_place(Route, Town, 10000000, 0, 0, Best).
best_place(R-T1-T2, Town, XD, _, I, Best) :-
atom(T1),
atom(T2),
extra(T1, Town, T2, XT),
XT < XD,
I2 is I + 1,
best_place(R-T1, Town, XT, I2, I2, Best).
best_place(R-T1-T2, Town, XD, XI, I, Best) :-
atom(T1),
atom(T2),
I2 is I + 1,
best_place(R-T1, Town, XD, XI, I2, Best).
best_place(T1-T2, Town, XD, _, I, Best) :-
atom(T1),
atom(T2),
extra(T1, Town, T2, XT),
XT < XD,
Best is I + 1.
best_place(_-_, _, _, XI, _, XI).
split(0, Route, Town, Route-Town).
split(IX, Route-Town1, Town, Split-Town1) :-
IX2 is IX - 1,
split(IX2, Route, Town, Split).
split(1, Route, Town, Town-Route).
extra(T1, T, T2, E) :-
T1::crow_flies(T, E1),
T::crow_flies(T2, E2),
T1::crow_flies(T2, E3),
E is E1 + E2 - E3.
:- end_object.
:- object(incremental,
extends(salesman)).
:- info([
author is 'Paulo Moura',
version is 1.0,
date is 2000/4/22,
comment is '.',
source is 'Example adopted from the Francis G. McCabe L&O documentation.']).
route([Town| Towns], Route) :-
route(Towns, Town, Route).
route([], Route, Route).
route([Town| Towns], Route, Route2) :-
best_place(Route, Town, Best),
split(Best, Route, Town, NewR),
route(Towns, NewR, Route2).
best_place(Route-Town1, Town, Best) :- % try the back first ...
atom(Town1),
Town::crow_flies(Town1, Distance),
best_place(Route-Town1, Town, Distance, 0, 0, Best).
best_place(Town, _, 0) :-
atom(Town).
best_place(R-T1-T2, T, XD, _, I, Best) :-
atom(T1),
atom(T2),
extra(T1, T, T2, XT),
XT < XD,
I2 is I + 1,
best_place(R-T1, T, XT, I2, I2, Best).
best_place(R-T1-T2, T, XD, XI, I, Best) :-
atom(T1),
atom(T2),
I2 is I + 1,
best_place(R-T1, T, XD, XI, I2, Best).
best_place(T1-T2, T, XD, _, I, Best) :-
atom(T1),
atom(T2),
extra(T1, T, T2, XT),
XT < XD,
I2 is I + 1,
best_place(T1, T, XT, I2, I2, Best).
best_place(T1-T2, T, XD, XI, I, Best) :-
atom(T1),
atom(T2),
I2 is I + 1,
best_place(T1, T, XD, XI, I2, Best).
best_place(T1, T, XD, _, I, Best) :-
atom(T1),
T1::crow_flies(T, Distance),
Distance < XD,
Best is I + 1.
best_place(_, _, _, XI, _, XI).
split(0, Route, Town, Route-Town).
split(IX, Route-Town1, Town, S-Town1) :-
IX2 is IX -1,
split(IX2, Route, Town, S).
split(1, Route, Town, Town-Route).
extra(T1, T, T2, XT) :-
T1::crow_flies(T, Distance1),
T::crow_flies(T2, Distance2),
T1::crow_flies(T2, Distance3),
XT is Distance1 + Distance2 - Distance3.
:- end_object.
:- object(presort,
extends(incremental)).
:- info([
author is 'Paulo Moura',
version is 1.0,
date is 2000/4/22,
comment is '.',
source is 'Example adopted from the Francis G. McCabe L&O documentation.']).
:- uses(quick(_)).
route(Towns, Route) :-
arrange(Towns, Towns2),
^^route(Towns2, Route).
arrange(Towns, Sorted) :-
centre(Towns, X, Y),
quick(geographic(X, Y))::sort(Towns, Sorted).
centre(Towns, X, Y) :-
average(Towns, 0, 0, U, V, 0, L),
X is U/L,
Y is V/L.
average([], U, V, U, V, L, L).
average([Town| Towns], UX, VX, U, V, I, L):-
Town::at(UT, VT),
UX2 is UX+UT,
VX2 is VX+VT,
I2 is I + 1,
average(Towns, UX2, VX2, U, V, I2, L).
:- end_object.
:- object(driving,
extends(salesman)).
:- info([
author is 'Paulo Moura',
version is 1.0,
date is 2000/4/22,
comment is '.',
source is 'Example adopted from the Francis G. McCabe L&O documentation.']).
route(Towns, Route) :-
presort::route(Towns, Presort),
drive_around(Presort, Route).
drive_around(Route-Town1-Town2, Route1-Route2) :-
!,
drive_around(Route-Town1, Route1),
Town1::drive(Town2, Route2).
drive_around(Town1-Town2, Route) :-
!,
Town1::drive(Town2, Route).
drive_around(Town, Town).
drive_length(Route, Length) :-
drive_length(Route, 0, Length).
drive_length(Route-Town1-Town2, Acc, Length) :-
!,
Town1::road_distance(Town2, Length2),
Acc2 is Acc + Length2,
drive_length(Route-Town1, Acc2, Length).
drive_length(Town1-Town2, Acc, Length) :-
!,
Town1::road_distance(Town2, Length2),
Length is Acc + Length2.
drive_length(_, Length, Length).
:- end_object.
:- object(permute,
extends(salesman)).
:- info([
author is 'Paulo Moura',
version is 1.0,
date is 2000/4/22,
comment is '.',
source is 'Example adopted from the Francis G. McCabe L&O documentation.']).
route(Towns, Route) :-
findall(
(Towns2, Length),
(permute(Towns, Towns2), route_length(Towns2, Length)),
List),
shortest(List, Route).
permute([Town], Town).
permute(Towns, Towns2-Town) :-
delete(Towns, Town, Towns3),
permute(Towns3, Towns2).
delete([Head| Tail], Head, Tail).
delete([Head| Tail], Element, [Head| Tail2]):-
delete(Tail, Element, Tail2).
route_length(Town, 0) :-
atom(Town), !.
route_length(Towns-Town1-Town2, Length) :-
!,
route_length(Towns-Town1, Length1),
Town1::crow_flies(Town2, Length2),
Length is Length1 + Length2.
route_length(Town1-Town2, Length) :-
Town1::crow_flies(Town2, Length).
shortest(List, Shortest) :-
shortest(List, null, 1000000, Shortest).
shortest([], Route, Length, (Route, Length)).
shortest([(Route, Length)| Routes], _, LX, Shortest) :-
Length < LX, !,
shortest(Routes, Route, Length, Shortest).
shortest([_| Routes], RX, LX, Shortest) :-
shortest(Routes, RX, LX, Shortest).
:- end_object.

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -8,3 +8,12 @@
:- initialization(
logtalk_load([
translator])).
/*
If you intend to use the FOP XSL:FO processor for generating PDF documenting
files, comment the directive above and uncomment the directive below
:- initialization(
logtalk_load(
[translator], [xmlsref(standalone)])).
*/

View File

@ -5,7 +5,8 @@
version is 1.0,
date is 2004/6/8,
author is 'Paulo Moura',
comment is 'Translator of logic propostions to clauses in conjunctive normal form.']).
comment is 'Translator of logic propostions to clauses in conjunctive normal form.',
source is 'Code partially based on an example found on the Clocksin and Mellish Prolog book.']).
:- public(translate/2).
:- mode(translate(+nonvar, -list), zero_or_one).
@ -22,10 +23,10 @@
:- dynamic(gensym_counter_/1).
:- op(10, fy, ~ ). % negation
:- op(20, yfx, & ). % conjunction
:- op(30, yfx, v ). % disjunction
:- op(40, xfx, =>). % implication
:- op(10, fy, ~ ). % negation
:- op(20, yfx, & ). % conjunction
:- op(30, yfx, v ). % disjunction
:- op(40, xfx, =>). % implication
:- op(40, xfx, <=>). % equivalence

View File

@ -1,11 +1,11 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================
This directory contains examples adaptated from the LPA Prolog++
This directory contains examples adapted from the LPA Prolog++
Reference Manual. This manual can be downloaded from the LPA web
site at <http://www.lpa.co.uk>. Please consult this reference
manual for further informations about each example.

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,6 +1,13 @@
:- initialization(
logtalk_load([
solver,
proof_tree,
tracer])).
logtalk_load(
[metainterpreters])).
/*
If you intend to use the FOP XSL:FO processor for generating PDF documenting
files, comment the directive above and uncomment the directive below
:- initialization(
logtalk_load(
[metainterpreters], [xmlsref(standalone)])).
*/

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,4 +1,13 @@
:- initialization(
logtalk_load([
metapredicates])).
logtalk_load(
[metapredicates])).
/*
If you intend to use the FOP XSL:FO processor for generating PDF documenting
files, comment the directive above and uncomment the directive below
:- initialization(
logtalk_load(
[metapredicates], [xmlsref(standalone)])).
*/

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,10 +1,13 @@
:- initialization(
logtalk_load([
space,
time,
space_time,
logtalk_load(
[mi])).
space3,
time1,
space_time4])).
/*
If you intend to use the FOP XSL:FO processor for generating PDF documenting
files, comment the directive above and uncomment the directive below
:- initialization(
logtalk_load(
[mi], [xmlsref(standalone)])).
*/

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -9,7 +9,7 @@
:- object(queens).
:- uses(list).
:- uses(list, [keysort/2, member/2]).
:- public(queens/1).
@ -130,7 +130,7 @@
place([], []).
place(UnplacedQueens, [Queen-Col|Placement]) :-
least_room_to_move(UnplacedQueens, Queen, Columns, OtherQueens),
list::member(Col, Columns), % backtrack over possible places
member(Col, Columns), % backtrack over possible places
prune(OtherQueens, Queen, Col, RemainingQueens),
place(RemainingQueens, Placement).
@ -209,7 +209,7 @@
queens(N) :-
make_initial_table(N, Table),
place(Table, Placement),
list::keysort(Placement, DisplayForm),
keysort(Placement, DisplayForm),
write(DisplayForm), nl.

View File

@ -0,0 +1,16 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================
To load this example and for sample queries, please see the SCRIPT file.
This example illustrates compilation of Prolog module files as objects.
Due to the lack of standardization of Prolog module systems, the module
files must use only a common subset of Prolog module directives. Consult
the "Prolog Integration and Migration Guide" in the Logtalk documentation
for details.

View File

@ -0,0 +1,60 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================
% start by compiling and loading the Prolog module files as objects:
| ?- logtalk_load(modules(loader)).
...
% call one of the module exported predicates using message sending:
| ?- test::names.
paulo
carlos
helena
yes
% same goal as above but the call is made using a meta-predicate
% imported from other module:
| ?- test::test.
paulo
carlos
helena
yes
% test the compilation of the module export/1 directive; module
% exported predicates become public predicates:
| ?- exports::current_predicate(Pred).
Pred = p/1
yes
| ?- exports::predicate_property(p(_), Prop).
Prop = public ;
Prop = static ;
Prop = declared_in(exports) ;
Prop = defined_in(exports)
yes
% call the module exported/public predicate using message sending:
| ?- exports::p(N).
N = 1 ;
N = 2 ;
N = 3
yes

View File

@ -0,0 +1,8 @@
:- module(exports).
:- export([p/1]).
p(1).
p(2).
p(3).

View File

@ -0,0 +1,9 @@
:- module(list, [contained/2, notcontained/2]).
contained(H, [H| _]).
contained(H, [_| T]) :-
contained(H, T).
notcontained(H, L) :-
\+ contained(H, L).

View File

@ -0,0 +1,7 @@
:- initialization(
logtalk_load([
exports,
list,
meta,
test])).

View File

@ -0,0 +1,7 @@
:- module(meta, [meta/1]).
:- meta_predicate(meta(:)).
meta(Goal) :-
call(Goal).

View File

@ -0,0 +1,14 @@
:- module(test, [test/0, names/0]).
:- use_module(list, [contained/2]).
:- use_module(meta, [meta/1]).
names :-
contained(P, [paulo, carlos, helena]),
write(P), nl,
fail.
names.
test :-
meta(names).

View File

@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.25.1
Release 2.26.2
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

Some files were not shown because too many files have changed in this diff Show More