Logtalk 2.22.4 files.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1232 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
pmoura 2005-01-13 12:22:42 +00:00
parent cd4fd05d45
commit a920e364c3
160 changed files with 838 additions and 465 deletions

View File

@ -1,36 +1,38 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================
This file contains detailed instruction for installing and configuring
Logtalk.
Logtalk. You should also consult the "misc/NOTES" file for a description
of a set of shell scripts that might be used for Logtalk installation on
some operating-systems and for easy Logtalk integration with popular
Prolog compilers.
1. LOGTALK INSTALLATION
Installing Logtalk is just a matter of decompressing the downloaded archive
and copying the resulting directory to a suitable location.
The Logtalk directory can reside in any user accessible location. This
location depends on the working environment and on the number of users.
Installing Logtalk can be as simple as decompressing the downloaded archive
and copying the resulting directory to a suitable location. This location
depends on the working environment and on the number of users. The Logtalk
directory can reside in any user accessible location. Whenever possible, it
is recommended that Logtalk be installed by a user with administrative rights,
as described below. This leads to a setup where each Logtalk user may freely
try and modify the provided examples, library, and configuration files with
the option of, at any time, restoring the files to its original state by
simply running one of the provided scripts.
* Installing for a single user:
* Installing for a single user with no administrative rights:
In the case of a single user, the Logtalk directory may simply be copied to
the user home directory. In alternative, assuming a user with administrative
rights, the same setup described below for multiple users may be applied.
This has the advantage of allowing the user to freely try and modify the
provided examples, library, and configuration files with the option of, at
any time, restoring the files to its original state by simply running one of
the provided scripts.
In the case of a single user with no administrative rights, the Logtalk
directory may simply be copied to the user home directory.
* Installing for multiple users:
* Installing for one or more users by a user with administrative rights:
In the case of multiple users, the Logtalk directory can be copied to any
location that its accessible by all the users (assuming that copying the
@ -39,20 +41,26 @@ feasible or desired).
The "misc" sub-directory contains shell scripts for easy installation of
Logtalk on Windows, Unix, and Unix-like operating systems (for details,
see the misc/NOTES file). These scripts make all files read-only in order
to avoid user tempering. However, Logtalk directories such as "library"
or "examples" must be user-writable as compiling Logtalk source files
generates intermediate Prolog files, which are written to the same location
as the source files. In addition, it is convenient that directories such as
"configs", "libpaths", and "xml" be user-writable in order to allow each
user to customize Logtalk to its needs. Given that making directories
world-writable is a security risk, one solution is to copy the directories
that need to be user-writable to each user home directory. The "misc" sub-
directory contains shell scripts (named "cplgtdirs.*") which may be called
by the end-users for making such copies. This is the preferred setup for a
computer lab. When used with one of the Prolog compilers for which an
integration script is provided on the "misc" directory, this setup allows
end-users to independently customize default compilation options and
see the "misc/NOTES" file). 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 "misc" 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 "misc/NOTES" file).
The "misc/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 "misc" directory, this setup as the advantage of allowing
each end-user to independently customize default compilation options and
library paths.
@ -89,14 +97,15 @@ If you use a bash shell, add the following lines to your ~/.profile file:
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, you may use this symbolic link to define the
environment variable in order to avoid breaking it when upgrading Logtalk.
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\installation\folder\
SET LOGTALKHOME=C:\your\logtalk\installation\folder\
SET LOGTALKUSER=%HOMEPATH%\logtalk
In Windows 2000/XP, environment variables are defined using the System
@ -112,11 +121,13 @@ script).
In Logtalk, a library is simply a directory containing source files. Library
paths can be declared using a dynamic predicate. This allows compiling and
loading of libraries and library files to be performed without worries about
library paths. In the "$LOGTALKUSER/libpaths" directory you will find a sample
file which, when loaded, defines the library paths for the Logtalk standard
library and for all the supplied examples. This file may need to be edited to
match your Logtalk installation and your Prolog compiler and operating-system
requirements. For more details, see the file "$LOGTALKUSER/libpaths/NOTES".
library paths. Assuming that you have used the "misc/cplgtdirs.*" shell scripts
for making a copy of the user-modifiable Logtalk files, you will find in the
"$LOGTALKUSER/libpaths" directory a sample file which, when loaded, defines
the library paths for the Logtalk standard library and for all the supplied
examples. This file may need to be edited to match your Logtalk installation
and your Prolog compiler and operating-system requirements. For more details,
see the file "$LOGTALKUSER/libpaths/NOTES".
2.3 Customizing Prolog configuration files
@ -152,5 +163,5 @@ 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 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.
compilers. In addition, be sure to read the "configs/NOTES" file notes on
the Prolog compilers that you intend to use.

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================
@ -10,7 +10,10 @@ Quick start
===========
1. Install Logtalk by following the instructions on the "INSTALL" file.
1. Install Logtalk by following the instructions on the "INSTALL" file.
Depending on your operating-system, working environment, and favorite
Prolog compiler, you may already have a shortcut installed for easily
running Logtalk.
2. Open the "manuals/index.html" file with a web browser.

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================
@ -10,6 +10,33 @@ RELEASE NOTES
=============
2.22.4 - January 12, 2005
Simplified method lookup cache tables, resulting in a small message
sending performance speedup. Improved method lookup caching for
parametric objects. Added support for caching method lookups for
parametric objects whose parameters contain cyclic terms.
Added a new category, "assignvars", to the Logtalk standard library,
containing an adaptation of the implementation of logical assignable
variables developed by Nobukuni Kino. Added a new example, "assignvars",
illustrating some possible uses of assignable variables in the context
of parametric objects.
Simplified compilation of op/3 directives: there is no longer need to
repeat the directives both before and inside an entity in order to make
the operators global and also use them in the compilation process.
Simplified installation instructions.
Corrected a compiler bug in the code that checks and prints a warning
when redefined parametric objects.
Corrected a bug in the built-in predicate abolish_category/1, which
failed to delete import relation clauses between the category being
abolished and other categories.
2.22.3 - December 30, 2004
Added a configuration file for XSB 2.7.

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================
@ -43,6 +43,9 @@ aliases
example of using the alias/3 predicate directive to provide alternative
names to inherited predicates in order to improve readability
assignvars
example of using assignable variables in the context of parametric objects
benchmarks
simple benchmarks for for helping measuring performance of Logtalk message
seding between Prolog compilers and for comparing message sending with

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -0,0 +1,20 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.4
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 the use of assignable variables and parametric
objects as alternative implementation to dynamic object predicates for
storing (backtracable) object state. For more information on assignable
variables please consult the URL:
http://www.kprolog.com/en/logical_assignment/
The objects in this example make use of the library category "assignvars".
This category contains an adaptation of the pure logical subset implementation
of assignable variables by Nobukuni Kino, which can be found on the URL above.

View File

@ -0,0 +1,75 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.4
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================
% start by loading the "assignvars" category:
| ?- logtalk_load(library(assignvars)).
...
% now you are ready for loading the example:
| ?- logtalk_load(assignvars(loader)).
...
% rectangle example:
?- rectangle(2, 3, _)::(init, position(X0, Y0), move(3, 7), position(X1, Y1), move(2, 5), position(X2, Y2)).
X0 = 0
Y0 = 0
X1 = 3
Y1 = 7
X2 = 2
Y2 = 5
Yes
% finite state machine example:
| ?- fsm(T, I, F), fsm(T, I, F)::recognise([0,1,1,2,1,2,0]).
red-0-red
red-1-green
green-1-yellow
yellow-2-red
red-1-green
green-2-red
red-0-red
T = [red-0-red, red-1-green, red-2-red, yellow-0-red, yellow-1-green, yellow-2-red, green-0-yellow, ... -... -yellow, ... -...]
I = red
F = [red]
Yes
% finite state machine example:
| ?- fsm(T, I, F), !, fsm(T, I, F)::recognise([0,1,1,2,1,2,1,0]).
red-0-red
red-1-green
green-1-yellow
yellow-2-red
red-1-green
green-2-red
red-1-green
green-0-yellow
backtracking...
backtracking...
backtracking...
backtracking...
backtracking...
backtracking...
backtracking...
backtracking...
No

View File

@ -0,0 +1,63 @@
% fsm(Transitions, Initial, Final)
%
% fsm(-list, -nonvar, -list)
fsm([red-0-red, red-1-green, red-2-red, % a simple finite state machine example
yellow-0-red, yellow-1-green, yellow-2-red,
green-0-yellow, green-1-yellow, green-2-red],
red,
[red]).
:- object(fsm(_transitions, _initial, _final),
imports(private::assignvars)).
:- info([
version is 1.0,
author is 'Paulo Moura',
date is 2005/1/8,
comment is 'A simple implementation of finite-state machines using assignable variables and parametric objects. Adapted from a similar example by Nobukuni Kino.',
parnames is ['Transitions', 'Initial state', 'Final states']]).
:- public(recognise/1).
:- mode(recognise(+list), zero_or_more).
:- info(recognise/1,
[comment is 'Recognise a list of events.',
argnames is ['Events']]).
recognise(Events) :-
parameter(2, Initial),
::assignable(Current, Initial),
recognise(Events, Current).
recognise([], State) :-
::State => Current,
final_state(Current).
recognise([Event| Events], State) :-
::State => Current,
transition(Event, Current, Next),
(write(Current-Event-Next), nl
;
write('backtracking...'), nl, fail),
::State <= Next,
recognise(Events, State).
transition(Event, Current, Next) :-
parameter(1, Transitions),
transition(Transitions, Event, Current, Next).
transition([Current-Event-Next| _], Event, Current, Next).
transition([_| Transitions], Event, Current, Next):-
transition(Transitions, Event, Current, Next).
final_state(State) :-
parameter(3, Final),
final_state(Final, State).
final_state([State| _], State).
final_state([_| States], State) :-
final_state(States, State).
:- end_object.

View File

@ -0,0 +1,5 @@
:- initialization(
logtalk_load([
fsm3,
rectangle3])).

View File

@ -0,0 +1,52 @@
:- object(rectangle(_width, _height, _position),
imports(private::assignvars)).
:- info([
version is 1.0,
author is 'Paulo Moura',
date is 2005/1/8,
comment is 'A simple implementation of a geometric rectangle using assignable variables and parametric objects.',
parnames is ['Width', 'Height', 'Position']]).
:- public(init/0).
:- mode(init, one).
:- info(init/0,
[comment is 'Initialize rectangle position.']).
:- public(area/1).
:- mode(area(-integer), one).
:- info(area/1,
[comment is 'Rectangle area.',
argnames is ['Area']]).
:- public(move/2).
:- mode(move(+integer, +integer), one).
:- info(move/2, [
comment is 'Moves a rectangle to a new position.',
argnames is ['X', 'Y']]).
:- public(position/2).
:- mode(position(?integer, ?integer), zero_or_one).
:- info(position/2, [
comment is 'Rectangle current position.',
argnames is ['X', 'Y']]).
init :-
parameter(3, Position),
::assignable(Position, (0, 0)).
area(Area) :-
parameter(1, Width),
parameter(2, Height),
Area is Width*Height.
move(X, Y) :-
parameter(3, Position),
::Position <= (X, Y).
position(X, Y) :-
parameter(3, Position),
::Position => (X, Y).
:- end_object.

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================
@ -32,3 +32,7 @@ This example is made of four source files:
contains the same definition of a list length predicate
encapsulated in an object
The Prolog files above are loaded (from the loader.lgt file) by using
ensure_loaded/1 directives. If this directive is not supported on your
Prolog compiler, replace them by calls to the built-in predicate used
by your compiler to load Prolog code.

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================
This folder contains a Prolog file, "libpaths.pl", which, when loaded,

View File

@ -2,15 +2,16 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Logtalk - Object oriented extension to Prolog
% Release 2.22.3
% Release 2.22.4
%
% Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
% Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
:- initialization(
(assertz(logtalk_library_path(library, '$LOGTALKUSER/library/')),
assertz(logtalk_library_path(aliases, '$LOGTALKUSER/examples/aliases/')),
assertz(logtalk_library_path(assignvars, '$LOGTALKUSER/examples/assignvars/')),
assertz(logtalk_library_path(benchmarks, '$LOGTALKUSER/examples/benchmarks/')),
assertz(logtalk_library_path(birds, '$LOGTALKUSER/examples/birds/')),
assertz(logtalk_library_path(bricks, '$LOGTALKUSER/examples/bricks/')),

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,9 +1,9 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -0,0 +1,114 @@
/*
This file contains an adaptation to Logtalk of code for logical assignment
of Prolog terms developed by Nobukuni Kino. For more information, please
consult the URL http://www.kprolog.com/en/logical_assignment/
As a derivative work, this file is licensed under the Open Software License
version 2.1 (http://opensource.org/licenses/osl-2.1.php).
*/
:-op(100, xfx, '<=').
:-op(100, xfx, '=>').
:- category(assignvars).
:- info([
version is 1.0,
author is 'Nobukuni Kino and Paulo Moura',
date is 2005/1/7,
comment is 'Assignable variables (supporting logical, backtracable assignement of non-variable terms).']).
:- public(assignable/1).
:- mode(assignable(-assignvar), one).
:- info(assignable/1, [
comment is 'Makes Variable an assignable variable. Initial state will be empty.',
argnames is ['Variable'],
exceptions is [
'Variable is not a variable' - type_error(variable, 'Variable')]]).
:- public(assignable/2).
:- mode(assignable(-assignvar, @nonvar), one).
:- info(assignable/2, [
comment is 'Makes Variable an assignable variable and sets its initial state to Value.',
argnames is ['Variable', 'Value'],
exceptions is [
'Variable is not a variable' - type_error(variable, 'Variable'),
'Value is not instantiated' - instantiation_error]]).
:- public((<=)/2).
:- mode(<=(?assignvar, @nonvar), one).
:- info((<=)/2, [
comment is 'Sets the state of the assignable variable Variable to Value (initializing the variable if needed).',
argnames is ['Variable', 'Value'],
exceptions is [
'Value is not instantiated' - instantiation_error]]).
:- public((=>)/2).
:- mode(=>(+assignvar, ?nonvar), zero_or_one).
:- info((=>)/2, [
comment is 'Unifies Value with the current state of the assignable variable Variable.',
argnames is ['Variable', 'Value'],
exceptions is [
'Variable is not instantiated' - instantiation_error]]).
:-op(100, xfx, <=).
:-op(100, xfx, =>).
assignable(Assig) :-
nonvar(Assig),
self(Self),
sender(Sender),
throw(error(type_error(variable, Assig), Self::assignable(Assig), Sender)).
assignable([_| _]).
assignable(Assig, Init) :-
nonvar(Assig),
self(Self),
sender(Sender),
throw(error(type_error(variable, Assig), Self::assignable(Assig, Init), Sender)).
assignable(Assig, Init) :-
var(Init),
self(Self),
sender(Sender),
throw(error(instantiation_error, Self::assignable(Assig, Init), Sender)).
assignable([_, Init| _], Init).
Assig <= Value :-
var(Value),
self(Self),
sender(Sender),
throw(error(instantiation_error, Self::Assig <= Value, Sender)).
[_| Tail] <= Value :-
nonvar(Tail) ->
Tail <= Value
;
Tail = [Value| _].
Assig => Value :-
var(Assig),
self(Self),
sender(Sender),
throw(error(instantiation_error, Self::Assig => Value, Sender)).
[Current| Tail] => Value :-
nonvar(Tail) ->
Tail => Value
;
Current = Value.
:- end_category.

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================
This folder contains objects, categories, and protocols whose

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
Copyright (c) 1998-2005 Paulo Moura. All Rights Reserved.
=================================================================

View File

@ -1,8 +1,8 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.22.3
Release 2.22.4
Copyright (c) 1998-2004 Paulo Moura. All Rights Reserved.
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