Logtalk 2.20.0 files.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1114 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
1781ff9420
commit
f5e660b9a3
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
@ -23,7 +23,8 @@ the user home directory.
|
||||
INSTALLING FOR MULTIPLE USERS
|
||||
|
||||
In the case of multiple users, the Logtalk directory can be copied to any
|
||||
location that its accessible by all the users.
|
||||
location that its accessible by all the users (assuming that copying the
|
||||
Logtalk directory to each user home directory is not feasible or desired).
|
||||
|
||||
Regarding directory and file permissions, it is advisable to make all files
|
||||
read-only in order to avoid user tempering. However, the library and examples
|
||||
@ -31,40 +32,56 @@ sub-directories (and possibly the compiler sub-directory, depending on the
|
||||
chosen Prolog compiler) must be user writable as compiling Logtalk source
|
||||
files generates intermediate Prolog files, which are written to the same
|
||||
location as the source files. However, making directories world-writable is a
|
||||
security risk. There are two alternatives. The first one is to pre-compile the
|
||||
library and all examples and to turn on the compiler option "smart_compilation"
|
||||
in order to avoid the need of recompilation when the files are loaded by the
|
||||
users. The second, and probably best, alternative is to copy the Logtalk xml,
|
||||
examples, and library directories to each user home directory (the "misc"
|
||||
sub-directory contains a shell script for automating these copies).
|
||||
security risk. One solution is to copy the Logtalk xml, examples, and library
|
||||
directories to each user home directory (the "misc" sub-directory contains
|
||||
some scripts which may be called by the end-users for making these copies).
|
||||
|
||||
|
||||
ENVIRONMENT VARIABLES
|
||||
|
||||
In Unix and Unix-like systems is recommended that you define an environment
|
||||
variable named $LOGTALKHOME pointing to the Logtalk installation for use with
|
||||
your Prolog compilers. If you use a csh shell, add the following line to your
|
||||
~/.cshrc file:
|
||||
It is recommended that you define an environment variable named LOGTALKHOME
|
||||
pointing to the Logtalk installation directory for use with your Prolog
|
||||
compilers. 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.
|
||||
|
||||
setenv LOGTALKHOME "/your/installation/directory/lgt2191"
|
||||
* Unix and Unix-like systems:
|
||||
|
||||
If you use a csh shell, add the following line to your ~/.cshrc file:
|
||||
|
||||
setenv LOGTALKHOME /your/installation/directory/lgt2200
|
||||
setenv PATH $PATH:$LOGTALKHOME/xml:$LOGTALKHOME/misc
|
||||
|
||||
If you use a bash shell, add the following lines to your ~/.profile file:
|
||||
|
||||
LOGTALKHOME="/your/installation/directory/lgt2191"
|
||||
LOGTALKHOME=/your/installation/directory/lgt2200
|
||||
export LOGTALKHOME
|
||||
PATH=$PATH:$LOGTALKHOME/xml:$LOGTALKHOME/misc
|
||||
export PATH
|
||||
|
||||
When using the provided shell script for installing Logtalk, a symbolic link
|
||||
to the Logtalk installation directory is automatically created. The link is
|
||||
named "logtalk". In this case, use this symbolic link to define the
|
||||
named "logtalk". In this case, you may use this symbolic link to define the
|
||||
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\installation\folder\
|
||||
|
||||
In Windows NT/2000/XP, environment variables are defined using the System
|
||||
properties control panel (if you are a system administrator, you may define
|
||||
LOGTALKHOME as a system variable, otherwise define it as a user variable).
|
||||
|
||||
|
||||
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 "misc" sub-directory contains several shell
|
||||
scripts for automating the creation of these initialization files for some
|
||||
popular Prolog compilers. In addition, be sure to read the configs/NOTES file
|
||||
notes on the Prolog compilers that you intend to use.
|
||||
and the Logtalk compiler. The "misc" 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.
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
@ -39,7 +39,7 @@ sub-directory.
|
||||
Note that both the configuration files and the compiler/preprocessor files
|
||||
are Prolog files. The predicate called to load these files depends on your
|
||||
Prolog compiler (consult your Prolog compiler documentation or take a look
|
||||
at the definition of the predicate $lgt_load_prolog_code/1 in the config
|
||||
at the definition of the predicate '$lgt_load_prolog_code'/1 in the config
|
||||
file. For most command-line compilers, you could type at the Prolog prompt
|
||||
something like:
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
@ -10,6 +10,42 @@ RELEASE NOTES
|
||||
=============
|
||||
|
||||
|
||||
2.20.0 - August 16, 2004
|
||||
|
||||
Added support for the uses/2 predicate directive (whose semantics is similar
|
||||
to C++ using-declarations). Updated the uses/1 entity directive to accept as
|
||||
argument a single object identifier.
|
||||
|
||||
Improved installation instructions for Windows users.
|
||||
|
||||
Added four new sample bash shell scripts and Windows JScript scripts for
|
||||
converting XML documenting files to PDF, HTML, and XHTML using several XSL
|
||||
processors.
|
||||
|
||||
Added missing namespace to XSL files in order to generated valid (X)HTML
|
||||
files with recent versions of XSLT processors.
|
||||
|
||||
Updated the User Manual documentation on converting XML documenting files
|
||||
to other formats.
|
||||
|
||||
Removed the texml.xsl XSLT file as the TeXMLatte application it depends on
|
||||
is no longer available.
|
||||
|
||||
Added Windows JScript script for copying the Logtalk examples, library, and
|
||||
xml directories to the user directory.
|
||||
|
||||
Added Windows JScript scripts for easy integration of Logtalk with ECLiPSe,
|
||||
SWI-Prolog, SICStus Prolog, and YAP.
|
||||
|
||||
Added missing extension for source metafiles to the SWI-Prolog hook file.
|
||||
|
||||
Corrected a bug in the lgtxhtml.xsl XSLT file where a wrong reference to
|
||||
the Logtalk CSS file is being used in the xml-stylesheet tag.
|
||||
|
||||
The iso_initialization_dir/1 compiler option is now a read only flag,
|
||||
defined in the configuration files.
|
||||
|
||||
|
||||
2.19.1 - August 2, 2004
|
||||
|
||||
Corrected a bug where entities could not be reloaded if they depend on
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
@ -81,3 +81,7 @@ value is "flags" (print both banner and default flag values).
|
||||
|
||||
Logtalk version 2.17.1 removes predicate nth/3 from library entities listp,
|
||||
list, and difflist (replaced by the predicates nth0/3 and nth1/3).
|
||||
|
||||
Logtalk version 2.20.0 updates the semantics of the uses/1 entity directive
|
||||
to accept as argument a single object identifier (this change is needed in
|
||||
order to ensure compatibility with the new uses/2 predicate directive).
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -13,9 +13,6 @@
|
||||
source is 'Example adopted from the SICStus Objects documentation.']).
|
||||
|
||||
|
||||
:- uses(list).
|
||||
|
||||
|
||||
move(X, Y) :-
|
||||
::check_bounds(x, X),
|
||||
::check_bounds(y, Y),
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -4,13 +4,14 @@
|
||||
|
||||
|
||||
:- info([
|
||||
version is 1.0,
|
||||
date is 1998/3/23,
|
||||
version is 1.1,
|
||||
date is 2004/8/15,
|
||||
author is 'Paulo Moura',
|
||||
comment is 'Concentric polygons as a constrained binary relation.']).
|
||||
|
||||
|
||||
:- uses(list).
|
||||
:- uses(list,
|
||||
[member/2, select/3]).
|
||||
|
||||
|
||||
descriptor_([x1, x2]).
|
||||
@ -33,7 +34,7 @@
|
||||
|
||||
add_tuple([Polygon| Polygons]) :-
|
||||
Polygon::position(X, Y),
|
||||
forall(list::member(Polygon2, Polygons), {Polygon2::move(X, Y)}),
|
||||
forall(member(Polygon2, Polygons), {Polygon2::move(X, Y)}),
|
||||
^^add_tuple([Polygon| Polygons]).
|
||||
|
||||
|
||||
@ -45,24 +46,24 @@
|
||||
|
||||
|
||||
propagate(after, move(X, Y), Polygon, _, Tuple) :-
|
||||
list::select(Polygon, Tuple, Polygons),
|
||||
select(Polygon, Tuple, Polygons),
|
||||
!,
|
||||
forall(
|
||||
(list::member(Polygon2, Polygons),\+ Polygon2::position(X, Y)),
|
||||
(member(Polygon2, Polygons),\+ Polygon2::position(X, Y)),
|
||||
{Polygon2::move(X, Y)}).
|
||||
|
||||
propagate(after, transX(X), Polygon, _, Tuple) :-
|
||||
list::select(Polygon, Tuple, Polygons),
|
||||
select(Polygon, Tuple, Polygons),
|
||||
!,
|
||||
forall(
|
||||
(list::member(Polygon2, Polygons), \+ Polygon2::position(X, _)),
|
||||
(member(Polygon2, Polygons), \+ Polygon2::position(X, _)),
|
||||
{Polygon2::transX(X)}).
|
||||
|
||||
propagate(after, transY(Y), Polygon, _, Tuple) :-
|
||||
list::select(Polygon, Tuple, Polygons),
|
||||
select(Polygon, Tuple, Polygons),
|
||||
!,
|
||||
forall(
|
||||
(list::member(Polygon2, Polygons), \+ Polygon2::position(_, Y)),
|
||||
(member(Polygon2, Polygons), \+ Polygon2::position(_, Y)),
|
||||
{Polygon2::transY(Y)}).
|
||||
|
||||
|
||||
|
@ -11,9 +11,6 @@
|
||||
comment is 'Polygon predicates.']).
|
||||
|
||||
|
||||
:- uses(list).
|
||||
|
||||
|
||||
:- public(move/2).
|
||||
:- mode(move(+integer, +integer), one).
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -3,14 +3,14 @@
|
||||
|
||||
|
||||
:- info([
|
||||
version is 1.1,
|
||||
version is 1.2,
|
||||
author is 'Paulo Moura',
|
||||
date is 2004/6/30,
|
||||
date is 2004/8/15,
|
||||
comment is 'Call executing time profiler.']).
|
||||
|
||||
|
||||
:- uses(time).
|
||||
:- uses(loop).
|
||||
:- uses(time, [cpu_time/1]).
|
||||
:- uses(loop, [forto/3]).
|
||||
|
||||
|
||||
:- public(timer/2).
|
||||
@ -34,19 +34,19 @@
|
||||
|
||||
|
||||
timer(Call, Time) :-
|
||||
time::cpu_time(Start),
|
||||
cpu_time(Start),
|
||||
(call(Call) -> true; true),
|
||||
time::cpu_time(End),
|
||||
cpu_time(End),
|
||||
Time is End - Start.
|
||||
|
||||
|
||||
timer(Call, Times, Time) :-
|
||||
time::cpu_time(Start),
|
||||
loop::forto(1, Times, Call),
|
||||
time::cpu_time(End),
|
||||
time::cpu_time(Start2),
|
||||
loop::forto(1, 0, true),
|
||||
time::cpu_time(End2),
|
||||
cpu_time(Start),
|
||||
forto(1, Times, Call),
|
||||
cpu_time(End),
|
||||
cpu_time(Start2),
|
||||
forto(1, 0, true),
|
||||
cpu_time(End2),
|
||||
Overhead is End2 - Start2,
|
||||
Time is (End - Start - Overhead) / Times.
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -9,12 +9,12 @@ http://www.csci.csusb.edu/dick/cs320/prolog/Potions.htm
|
||||
|
||||
|
||||
:- info([
|
||||
version is 1.0,
|
||||
date is 2004/4/29,
|
||||
version is 1.1,
|
||||
date is 2004/8/15,
|
||||
author is 'Paulo Moura',
|
||||
comment is 'Harry Potter potions logical puzzle.']).
|
||||
|
||||
:- uses(list).
|
||||
:- uses(list, [select/3]).
|
||||
|
||||
:- public(potions/7).
|
||||
:- mode(potions(?atom, ?atom, ?atom, ?atom, ?atom, ?atom, ?atom), zero_or_one).
|
||||
@ -27,17 +27,17 @@ http://www.csci.csusb.edu/dick/cs320/prolog/Potions.htm
|
||||
|
||||
potions(P1, P2, P3, P4, P5, P6, P7) :-
|
||||
contents(H1),
|
||||
list::select(P1, H1, H2),
|
||||
list::select(P7, H2, H3),
|
||||
select(P1, H1, H2),
|
||||
select(P7, H2, H3),
|
||||
P1 \= P7, P1 \= forward, P7 \= forward, % second clue
|
||||
list::select(P2, H3, H4),
|
||||
select(P2, H3, H4),
|
||||
P2 \= poison,
|
||||
list::select(P3, H4, H5),
|
||||
select(P3, H4, H5),
|
||||
P3 \= poison, % third clue
|
||||
P2 = P6,
|
||||
list::select(P6, H5, H6), % fourth clue
|
||||
list::select(P4, H6, H7),
|
||||
list::select(P5, H7, []),
|
||||
select(P6, H5, H6), % fourth clue
|
||||
select(P4, H6, H7),
|
||||
select(P5, H7, []),
|
||||
two_pairs_poison_wine([P1, P2, P3, P4, P5, P6, P7]). % first clue
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -5,13 +5,14 @@
|
||||
|
||||
|
||||
:- info([
|
||||
version is 3,
|
||||
date is 2000/7/24,
|
||||
version is 3.1,
|
||||
date is 2004/8/15,
|
||||
author is 'Paulo Moura',
|
||||
comment is 'Enables the representation of relations with constraints on the state of participating objects.']).
|
||||
|
||||
|
||||
:- uses(list).
|
||||
:- uses(list,
|
||||
[member/2, memberchk/2, subtract/3]).
|
||||
|
||||
|
||||
:- private(activ_points_/3).
|
||||
@ -106,7 +107,7 @@
|
||||
|
||||
del_object_monitors(Object, Role) :-
|
||||
::plays_roles(Object, Roles) ->
|
||||
(list::member(Role, Roles) ->
|
||||
(member(Role, Roles) ->
|
||||
true
|
||||
;
|
||||
del_object_monitors(Object, Role, Roles))
|
||||
@ -145,7 +146,7 @@
|
||||
|
||||
activ_point(Role, Event, Message) :-
|
||||
::activ_points_(Role, Event, Messages),
|
||||
list::member(Message, Messages).
|
||||
member(Message, Messages).
|
||||
|
||||
|
||||
activ_points(Role, Event, List) :-
|
||||
@ -160,7 +161,7 @@
|
||||
|
||||
set_activ_points(Role, Event, List) :-
|
||||
::descriptor(Descriptor),
|
||||
list::memberchk(Role, Descriptor),
|
||||
memberchk(Role, Descriptor),
|
||||
::retractall(activ_points_(Role, Event, _)),
|
||||
::assertz(activ_points_(Role, Event, List)).
|
||||
|
||||
@ -174,7 +175,7 @@
|
||||
|
||||
filter_messages([Role| Roles], Original, Event, Messages) :-
|
||||
::activ_points_(Role, Event, Excluded),
|
||||
list::subtract(Original, Excluded, Rest),
|
||||
subtract(Original, Excluded, Rest),
|
||||
filter_messages(Roles, Rest, Event, Messages).
|
||||
|
||||
|
||||
@ -196,13 +197,13 @@
|
||||
::descriptor(Descriptor),
|
||||
write('call activation points:'), nl,
|
||||
findall(Messages,
|
||||
(list::member(Role, Descriptor),
|
||||
(member(Role, Descriptor),
|
||||
::activ_points(Role, before, Messages)),
|
||||
CallList),
|
||||
write(' '), writeq(CallList), nl,
|
||||
write('exit activation points:'), nl,
|
||||
findall(Messages,
|
||||
(list::member(Role, Descriptor),
|
||||
(member(Role, Descriptor),
|
||||
::activ_points(Role, after, Messages)),
|
||||
ExitList),
|
||||
write(' '), writeq(ExitList), nl.
|
||||
|
@ -6,15 +6,16 @@
|
||||
|
||||
|
||||
:- info([
|
||||
version is 1.1,
|
||||
date is 2004/5/9,
|
||||
version is 1.2,
|
||||
date is 2004/8/15,
|
||||
author is 'Esteban Zimanyi, Paulo Moura',
|
||||
comment is 'Enables the representation of relations between independent objects.']).
|
||||
|
||||
|
||||
:- uses(before_event_registry).
|
||||
:- uses(after_event_registry).
|
||||
:- uses(list).
|
||||
:- uses(list,
|
||||
[length/2, member/2, memberchk/2, nth1/3, same_length/2]).
|
||||
|
||||
|
||||
tuple(Tuple) :-
|
||||
@ -33,7 +34,7 @@
|
||||
|
||||
add_tuple(Tuple) :-
|
||||
::descriptor(Descriptor),
|
||||
\+ list::same_length(Tuple, Descriptor),
|
||||
\+ same_length(Tuple, Descriptor),
|
||||
self(Self),
|
||||
sender(Sender),
|
||||
throw(error(invalid_length, Self::add_tuple(Tuple), Sender)).
|
||||
@ -49,8 +50,8 @@
|
||||
|
||||
add_tuple(Tuple) :-
|
||||
::descriptor(Descriptor),
|
||||
list::nth1(Position, Tuple, Object),
|
||||
list::nth1(Position, Descriptor, Role),
|
||||
nth1(Position, Tuple, Object),
|
||||
nth1(Position, Descriptor, Role),
|
||||
::cardinality(Role, _, Maximum),
|
||||
::plays_role_n_times(Object, Role, Number),
|
||||
Maximum = Number,
|
||||
@ -60,8 +61,8 @@
|
||||
|
||||
add_tuple(Tuple) :-
|
||||
::descriptor(Descriptor),
|
||||
list::nth1(Position, Tuple, Object),
|
||||
list::nth1(Position, Descriptor, Role),
|
||||
nth1(Position, Tuple, Object),
|
||||
nth1(Position, Descriptor, Role),
|
||||
::domain(Role, Domain),
|
||||
(Domain::strict_instance ->
|
||||
\+ Domain::valid(Object)
|
||||
@ -79,7 +80,7 @@
|
||||
make_tuple_template([], [], _, []).
|
||||
|
||||
make_tuple_template([Object| Objects], [Role| Roles], Key, [Var| Rest]) :-
|
||||
(list::member(Role, Key) ->
|
||||
(member(Role, Key) ->
|
||||
Var = Object
|
||||
;
|
||||
true),
|
||||
@ -94,8 +95,8 @@
|
||||
|
||||
remove_tuple(Tuple) :-
|
||||
::descriptor(Descriptor),
|
||||
list::nth1(Position, Tuple, Object),
|
||||
list::nth1(Position, Descriptor, Role),
|
||||
nth1(Position, Tuple, Object),
|
||||
nth1(Position, Descriptor, Role),
|
||||
::cardinality(Role, Minimum, _),
|
||||
::plays_role_n_times(Object, Role, Number),
|
||||
Minimum = Number,
|
||||
@ -115,34 +116,34 @@
|
||||
|
||||
number_of_tuples(Number) :-
|
||||
findall(1, ::tuple_(_), List),
|
||||
list::length(List, Number).
|
||||
length(List, Number).
|
||||
|
||||
|
||||
plays_roles(Object, Roles) :-
|
||||
::descriptor(Descriptor),
|
||||
setof(Role,
|
||||
Tuple^Position^ (::tuple(Tuple),
|
||||
list::member(Object, Tuple),
|
||||
list::nth1(Position, Tuple, Object),
|
||||
once(list::nth1(Position, Descriptor, Role))),
|
||||
member(Object, Tuple),
|
||||
nth1(Position, Tuple, Object),
|
||||
once(nth1(Position, Descriptor, Role))),
|
||||
Roles).
|
||||
|
||||
|
||||
plays_role_in_tuple(Object, Role, Tuple) :-
|
||||
::descriptor(Descriptor),
|
||||
::tuple(Tuple),
|
||||
list::nth1(Position, Tuple, Object),
|
||||
list::nth1(Position, Descriptor, Role).
|
||||
nth1(Position, Tuple, Object),
|
||||
nth1(Position, Descriptor, Role).
|
||||
|
||||
|
||||
plays_role_n_times(Object, Role, Number) :-
|
||||
::descriptor(Descriptor),
|
||||
list::nth1(Position, Descriptor, Role),
|
||||
nth1(Position, Descriptor, Role),
|
||||
setof(Tuple,
|
||||
(::tuple(Tuple),
|
||||
list::nth1(Position, Tuple, Object)),
|
||||
nth1(Position, Tuple, Object)),
|
||||
Tuples),
|
||||
list::length(Tuples, Number).
|
||||
length(Tuples, Number).
|
||||
|
||||
|
||||
domains(Domains) :-
|
||||
@ -193,7 +194,7 @@
|
||||
|
||||
degree(Degree) :-
|
||||
::descriptor_(Descriptor),
|
||||
list::length(Descriptor, Degree).
|
||||
length(Descriptor, Degree).
|
||||
|
||||
|
||||
set_descriptor(Descriptor) :-
|
||||
@ -258,8 +259,8 @@
|
||||
|
||||
valid_keys([Key| Keys], Descriptor) :-
|
||||
forall(
|
||||
list::member(Role, Key),
|
||||
list::memberchk(Role, Descriptor)),
|
||||
member(Role, Key),
|
||||
memberchk(Role, Descriptor)),
|
||||
valid_keys(Keys, Descriptor).
|
||||
|
||||
|
||||
@ -294,7 +295,7 @@
|
||||
|
||||
set_delete_options(Options) :-
|
||||
::descriptor(Descriptor),
|
||||
\+ list::same_length(Options, Descriptor),
|
||||
\+ same_length(Options, Descriptor),
|
||||
self(Self),
|
||||
sender(Sender),
|
||||
throw(error(invalid_length, Self::set_delete_options(Options), Sender)).
|
||||
@ -413,7 +414,7 @@
|
||||
|
||||
del_monitors([Object| Objects]) :-
|
||||
((instantiates_class(Object, Class),
|
||||
\+ (::tuple(Other), list::member(Object, Other))) ->
|
||||
\+ (::tuple(Other), member(Object, Other))) ->
|
||||
self(Self),
|
||||
before_event_registry::del_monitors(Class, delete(Object, _), _, Self)
|
||||
;
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -3,9 +3,16 @@
|
||||
instantiates(heuristic_state_space)).
|
||||
|
||||
|
||||
:- uses(list).
|
||||
:- uses(numberlist).
|
||||
:- uses(set).
|
||||
:- info([
|
||||
version is 1.1,
|
||||
author is 'Paulo Moura',
|
||||
date is 2004/8/15,
|
||||
comment is 'Bridge puzzle.']).
|
||||
|
||||
|
||||
:- uses(list, [append/3]).
|
||||
:- uses(numberlist, [min/2, max/2]).
|
||||
:- uses(set, [insert/3, insert_all/3, select/3]).
|
||||
|
||||
|
||||
initial_state(start, ([], right, [1,3,6,8,12])).
|
||||
@ -15,32 +22,32 @@
|
||||
|
||||
|
||||
next_state((Left1, left, Right1), (Left2, right, Right2), Slower) :- % two persons
|
||||
list::append(List, [Person1| Persons], Left1),
|
||||
set::select(Person2, Persons, Others),
|
||||
list::append(List, Others, Left2),
|
||||
set::insert_all([Person1, Person2], Right1, Right2),
|
||||
append(List, [Person1| Persons], Left1),
|
||||
select(Person2, Persons, Others),
|
||||
append(List, Others, Left2),
|
||||
insert_all([Person1, Person2], Right1, Right2),
|
||||
(Person1 > Person2 ->
|
||||
Slower = Person1
|
||||
;
|
||||
Slower = Person2).
|
||||
|
||||
next_state((Left1, right, Right1), (Left2, left, Right2), Slower) :- % two persons
|
||||
list::append(List, [Person1| Persons], Right1),
|
||||
set::select(Person2, Persons, Others),
|
||||
list::append(List, Others, Right2),
|
||||
set::insert_all([Person1, Person2], Left1, Left2),
|
||||
append(List, [Person1| Persons], Right1),
|
||||
select(Person2, Persons, Others),
|
||||
append(List, Others, Right2),
|
||||
insert_all([Person1, Person2], Left1, Left2),
|
||||
(Person1 > Person2 ->
|
||||
Slower = Person1
|
||||
;
|
||||
Slower = Person2).
|
||||
|
||||
next_state((Left1, left, Right1), (Left2, right, Right2), Person) :- % one person
|
||||
set::select(Person, Left1, Left2),
|
||||
set::insert(Right1, Person, Right2).
|
||||
select(Person, Left1, Left2),
|
||||
insert(Right1, Person, Right2).
|
||||
|
||||
next_state((Left1, right, Right1), (Left2, left, Right2), Person) :- % one person
|
||||
set::select(Person, Right1, Right2),
|
||||
set::insert(Left1, Person, Left2).
|
||||
select(Person, Right1, Right2),
|
||||
insert(Left1, Person, Left2).
|
||||
|
||||
|
||||
heuristic((Left, Lamp, Right), Heuristic) :-
|
||||
|
@ -4,13 +4,13 @@
|
||||
|
||||
|
||||
:- info([
|
||||
version is 1.0,
|
||||
version is 1.1,
|
||||
author is 'Paulo Moura',
|
||||
date is 1998/3/23,
|
||||
date is 2004/8/15,
|
||||
comment is 'Eight puzzle heuristic state space search problem.']).
|
||||
|
||||
|
||||
:- uses(list).
|
||||
:- uses(list, [member/2]).
|
||||
|
||||
|
||||
initial_state(four_steps, [2/2,1/3,3/2,2/3,3/3,3/1,2/1,1/1,1/2]).
|
||||
@ -24,10 +24,10 @@
|
||||
|
||||
|
||||
print_state([S0,S1,S2,S3,S4,S5,S6,S7,S8]) :-
|
||||
list::member(Y, [3, 2, 1]),
|
||||
member(Y, [3, 2, 1]),
|
||||
nl,
|
||||
list::member(X, [1, 2, 3]),
|
||||
list::member(Tile-X/Y, [' '-S0,1-S1,2-S2,3-S3,4-S4,5-S5,6-S6,7-S7,8-S8]),
|
||||
member(X, [1, 2, 3]),
|
||||
member(Tile-X/Y, [' '-S0,1-S1,2-S2,3-S3,4-S4,5-S5,6-S6,7-S7,8-S8]),
|
||||
write(Tile),
|
||||
fail.
|
||||
|
||||
|
@ -4,21 +4,22 @@
|
||||
|
||||
|
||||
:- info([
|
||||
version is 1.0,
|
||||
version is 1.1,
|
||||
author is 'Paulo Moura',
|
||||
date is 1998/3/23,
|
||||
date is 2004/8/15,
|
||||
comment is 'Hill climbing heuristic state space search strategy.',
|
||||
parnames is ['Threshold']]).
|
||||
|
||||
|
||||
:- uses(list).
|
||||
:- uses(list,
|
||||
[member/2, reverse/2, sort/2]).
|
||||
|
||||
:- private(hill/7).
|
||||
|
||||
|
||||
search(Space, State, Threshold, Solution, Cost) :-
|
||||
hill(Space, State, Threshold, [], Path, 0, Cost),
|
||||
list::reverse(Path, Solution).
|
||||
reverse(Path, Solution).
|
||||
|
||||
|
||||
hill(Space, State, _, Path, [State| Path], Cost, Cost) :-
|
||||
@ -28,12 +29,12 @@
|
||||
findall(
|
||||
(Estimate, Cost, Next),
|
||||
(Space::next_state(State, Next, Cost),
|
||||
\+ list::member(Next, [State| Path]),
|
||||
\+ member(Next, [State| Path]),
|
||||
Space::heuristic(Next, Guess),
|
||||
Estimate is Guess + Cost),
|
||||
States),
|
||||
list::sort(States, SortedStates),
|
||||
list::member((_, Cost2, Next2), SortedStates),
|
||||
sort(States, SortedStates),
|
||||
member((_, Cost2, Next2), SortedStates),
|
||||
SoFar2 is SoFar + Cost2,
|
||||
SoFar2 =< Threshold,
|
||||
hill(Space, Next2, Threshold, [State| Path], Solution, SoFar2, Total).
|
||||
|
@ -10,7 +10,7 @@
|
||||
comment is 'Missionaries and cannibals heuristic state space search problem.']).
|
||||
|
||||
|
||||
:- uses(loop).
|
||||
:- uses(loop, [forto/3]).
|
||||
|
||||
|
||||
initial_state(start, ((3,3), left, (0,0))).
|
||||
@ -20,14 +20,14 @@
|
||||
|
||||
|
||||
print_state(((Me,Ce), B, (Md,Cd))) :-
|
||||
loop::forto(1, Me, write('M')),
|
||||
loop::forto(1, Ce, write('C')),
|
||||
forto(1, Me, write('M')),
|
||||
forto(1, Ce, write('C')),
|
||||
(B = left ->
|
||||
write('.<__>..........')
|
||||
;
|
||||
write('..........<__>.')),
|
||||
loop::forto(1, Md, write('M')),
|
||||
loop::forto(1, Cd, write('C')),
|
||||
forto(1, Md, write('M')),
|
||||
forto(1, Cd, write('C')),
|
||||
nl.
|
||||
|
||||
|
||||
|
@ -4,18 +4,18 @@
|
||||
|
||||
|
||||
:- info([
|
||||
version is 1.0,
|
||||
version is 1.1,
|
||||
author is 'Paulo Moura',
|
||||
date is 1998/3/23,
|
||||
date is 2004/8/15,
|
||||
comment is 'Performance monitor for state space searches.']).
|
||||
|
||||
|
||||
:- uses(event_registry).
|
||||
:- uses(before_event_registry).
|
||||
:- uses(after_event_registry).
|
||||
:- uses(list).
|
||||
:- uses(numberlist).
|
||||
:- uses(time).
|
||||
:- uses(list, [length/2]).
|
||||
:- uses(numberlist, [min/2, max/2, sum/2]).
|
||||
:- uses(time, [cpu_time/1]).
|
||||
|
||||
|
||||
:- private(transitions/3).
|
||||
@ -71,7 +71,7 @@
|
||||
|
||||
transitions(Number) :-
|
||||
findall(N, ::transitions(_, _, N), List),
|
||||
numberlist::sum(List, Number).
|
||||
sum(List, Number).
|
||||
|
||||
|
||||
time(Time) :-
|
||||
@ -85,12 +85,12 @@
|
||||
Length,
|
||||
(::transitions(State1, _, _),
|
||||
findall(State2, ::transitions(State1, State2, _), States2),
|
||||
list::length(States2, Length)),
|
||||
length(States2, Length)),
|
||||
Lengths),
|
||||
list::min(Lengths, Minimum),
|
||||
list::max(Lengths, Maximum),
|
||||
numberlist::sum(Lengths, Sum),
|
||||
list::length(Lengths, Length),
|
||||
min(Lengths, Minimum),
|
||||
max(Lengths, Maximum),
|
||||
sum(Lengths, Sum),
|
||||
length(Lengths, Length),
|
||||
Average is Sum / Length.
|
||||
|
||||
|
||||
@ -114,13 +114,13 @@
|
||||
|
||||
before(_, solve(_, _, _), _) :-
|
||||
!,
|
||||
time::cpu_time(Time),
|
||||
cpu_time(Time),
|
||||
::retractall(start_time(_)),
|
||||
::asserta(start_time(Time)).
|
||||
|
||||
before(_, solve(_, _, _, _), _) :-
|
||||
!,
|
||||
time::cpu_time(Time),
|
||||
cpu_time(Time),
|
||||
::retractall(start_time(_)),
|
||||
::asserta(start_time(Time)).
|
||||
|
||||
@ -145,19 +145,19 @@
|
||||
|
||||
after(_, solve(_, _, Solution), _) :-
|
||||
!,
|
||||
time::cpu_time(Time),
|
||||
cpu_time(Time),
|
||||
::retractall(end_time(_)),
|
||||
::asserta(end_time(Time)),
|
||||
list::length(Solution, Length),
|
||||
length(Solution, Length),
|
||||
::retractall(solution_length(_)),
|
||||
::asserta(solution_length(Length)).
|
||||
|
||||
after(_, solve(_, _, Solution, _), _) :-
|
||||
!,
|
||||
time::cpu_time(Time),
|
||||
cpu_time(Time),
|
||||
::retractall(end_time(_)),
|
||||
::asserta(end_time(Time)),
|
||||
list::length(Solution, Length),
|
||||
length(Solution, Length),
|
||||
::retractall(solution_length(_)),
|
||||
::asserta(solution_length(Length)).
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,7 +1,7 @@
|
||||
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.19.1
|
||||
Release 2.20.0
|
||||
|
||||
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
|
||||
<title>Logtalk 2.19.1 Documentation</title>
|
||||
<title>Logtalk 2.20.0 Documentation</title>
|
||||
<link rel="stylesheet" href="styles.css" type="text/css" />
|
||||
</head>
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<h1>Logtalk 2.19.1 Documentation</h1>
|
||||
<h1>Logtalk 2.20.0 Documentation</h1>
|
||||
|
||||
<ul>
|
||||
<li><h2><a href="userman/index.html">User Manual</a></h2></li>
|
||||
@ -37,7 +37,7 @@ Copyright © <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> — <a
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
<p><span class="bleft"><a href="http://validator.w3.org/check/referer">XHTML</a> + <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a></span><span class="bright">Last updated on: July 28, 2004</span></p>
|
||||
<p><span class="bleft"><a href="http://validator.w3.org/check/referer">XHTML</a> + <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a></span><span class="bright">Last updated on: August 14, 2004</span></p>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
@ -52,7 +52,7 @@
|
||||
</blockquote>
|
||||
|
||||
<div class="navbottom">
|
||||
<a href="../directives/public1.html">previous</a> | <a href="../../glossary.html">glossary</a> | <a href="current_object1.html">next</a>
|
||||
<a href="../directives/uses2.html">previous</a> | <a href="../../glossary.html">glossary</a> | <a href="current_object1.html">next</a>
|
||||
</div>
|
||||
|
||||
<div class="copyright">
|
||||
@ -60,7 +60,7 @@ Copyright © <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> — <a
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
<p><span class="bleft"><a href="http://validator.w3.org/check/referer">XHTML</a> + <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a></span><span class="bright">Last updated on: December 23, 2003</span></p>
|
||||
<p><span class="bleft"><a href="http://validator.w3.org/check/referer">XHTML</a> + <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a></span><span class="bright">Last updated on: August 14, 2003</span></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -50,7 +50,7 @@ public([Functor1/Arity1, Functor2/Arity2, ...])</pre>
|
||||
</blockquote>
|
||||
|
||||
<div class="navbottom">
|
||||
<a href="protected1.html">previous</a> | <a href="../../glossary.html">glossary</a> | <a href="../builtins/current_category1.html">next</a>
|
||||
<a href="protected1.html">previous</a> | <a href="../../glossary.html">glossary</a> | <a href="uses2.html">next</a>
|
||||
</div>
|
||||
|
||||
<div class="copyright">
|
||||
@ -58,7 +58,7 @@ Copyright © <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> — <a
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
<p><span class="bleft"><a href="http://validator.w3.org/check/referer">XHTML</a> + <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a></span><span class="bright">Last updated on: July 23, 2004</span></p>
|
||||
<p><span class="bleft"><a href="http://validator.w3.org/check/referer">XHTML</a> + <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a></span><span class="bright">Last updated on: August 14, 2004</span></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -24,18 +24,16 @@
|
||||
<h4>Description</h4>
|
||||
|
||||
<blockquote>
|
||||
<pre>uses(Object)
|
||||
uses(Object1, Object2, ...)
|
||||
uses([Object1, Object2, ...])</pre>
|
||||
<pre>uses(Object)</pre>
|
||||
<p>
|
||||
Declares the object(s) that are sent messages by predicates defined in the category or object containing the directive.
|
||||
Declares an object that receives messages from predicates defined in the category or object containing the directive. In the current Logtalk version, this is a non-operational directive, which may be used for documentation. Nevertheless, the compiler will warn you of any unknown object referenced using this directive when an entity containing it is compiled. In a forthcoming release, this directive will likely be used to support object namespaces.
|
||||
</p>
|
||||
</blockquote>
|
||||
|
||||
<h4>Template and modes</h4>
|
||||
|
||||
<blockquote>
|
||||
<pre>uses(+object_identifiers)</pre>
|
||||
<pre>uses(+object_identifier)</pre>
|
||||
</blockquote>
|
||||
|
||||
|
||||
@ -46,7 +44,7 @@ uses([Object1, Object2, ...])</pre>
|
||||
</blockquote>
|
||||
|
||||
<div class="navbottom">
|
||||
<a href="protocol1_2.html">previous</a> | <a href="../../glossary.html">glossary</a> | <a href="discontiguous1.html">next</a>
|
||||
<a href="protocol1_2.html">previous</a> | <a href="../../glossary.html">glossary</a> | <a href="uses2.html">next</a>
|
||||
</div>
|
||||
|
||||
<div class="copyright">
|
||||
@ -54,7 +52,7 @@ Copyright © <a href="mailto:pmoura@logtalk.org">Paulo Moura</a> — <a
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
<p><span class="bleft"><a href="http://validator.w3.org/check/referer">XHTML</a> + <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a></span><span class="bright">Last updated on: December 23, 2003</span></p>
|
||||
<p><span class="bleft"><a href="http://validator.w3.org/check/referer">XHTML</a> + <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a></span><span class="bright">Last updated on: August 14, 2004</span></p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user