Logtalk 2.27.1 files.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1580 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
fded381282
commit
75b2645e3f
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
@ -108,34 +108,7 @@ variable for all users and also sets the LOGTALKUSER environment variable
|
||||
for the administrator user running the script.
|
||||
|
||||
|
||||
3. CREATING NEW PROLOG TOP-LEVELS FOR AUTOMATIC LOADING OF LOGTALK
|
||||
|
||||
Most Prolog compilers allows the user to define an initialization file that
|
||||
is automatically consulted at startup. This initialization file may contain
|
||||
directives for loading other files, such as the Logtalk configuration file
|
||||
and the Logtalk compiler. The "$LOGTALKHOME/scripts" sub-directory contains
|
||||
several scripts (named "make_*lgt.*") for automating the creation of these
|
||||
initialization files for some Prolog compilers. In addition, be sure to read
|
||||
the "configs/NOTES" file notes on the Prolog compilers that you intend to use.
|
||||
There are also "makeall_lgt.*" scripts that try to run all the individual
|
||||
"make_*lgt.*" scripts:
|
||||
|
||||
>> POSIX systems:
|
||||
|
||||
% cd $LOGTALKHOME/scripts
|
||||
% sudo ./makeall_lgt.sh
|
||||
|
||||
>> Windows:
|
||||
|
||||
C:\> cd %LOGTALKHOME%\scripts
|
||||
C:\> cscript makeall_lgt.js
|
||||
|
||||
This assumes that your favorite Prolog compilers are supported by the
|
||||
"make_*lgt.*" scripts. If that is not the case, don't worry: just follow
|
||||
the steps described in the "QUICK_START" file.
|
||||
|
||||
|
||||
4. COPYING THE LOGTALK USER-MODIFIABLE FILES TO USERS HOME DIRECTORIES
|
||||
3. COPYING THE LOGTALK USER-MODIFIABLE FILES TO USERS HOME DIRECTORIES
|
||||
|
||||
If you installed Logtalk on your home directory, then skip this step if you
|
||||
have set both Logtalk environment variables (LOGTALKHOME and LOGTALKUSER) to
|
||||
@ -162,6 +135,33 @@ directory, this setup as the advantage of allowing each end-user to
|
||||
independently customize default compilation options and library paths.
|
||||
|
||||
|
||||
4. CREATING NEW PROLOG TOP-LEVELS FOR AUTOMATIC LOADING OF LOGTALK
|
||||
|
||||
Most Prolog compilers allows the user to define an initialization file that
|
||||
is automatically consulted at startup. This initialization file may contain
|
||||
directives for loading other files, such as the Logtalk configuration file
|
||||
and the Logtalk compiler. The "$LOGTALKHOME/scripts" sub-directory contains
|
||||
several scripts (named "make_*lgt.*") for automating the creation of these
|
||||
initialization files for some Prolog compilers. In addition, be sure to read
|
||||
the "configs/NOTES" file notes on the Prolog compilers that you intend to use.
|
||||
There are also "makeall_lgt.*" scripts that try to run all the individual
|
||||
"make_*lgt.*" scripts:
|
||||
|
||||
>> POSIX systems:
|
||||
|
||||
% cd $LOGTALKHOME/scripts
|
||||
% sudo ./makeall_lgt.sh
|
||||
|
||||
>> Windows:
|
||||
|
||||
C:\> cd %LOGTALKHOME%\scripts
|
||||
C:\> cscript makeall_lgt.js
|
||||
|
||||
This assumes that your favorite Prolog compilers are supported by the
|
||||
"make_*lgt.*" scripts. If that is not the case, don't worry: just follow
|
||||
the steps described in the "QUICK_START" file.
|
||||
|
||||
|
||||
5. SETTING LIBRARY PATHS
|
||||
|
||||
In Logtalk, a library is simply a directory containing source files. Library
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
@ -10,6 +10,45 @@ RELEASE NOTES
|
||||
=============
|
||||
|
||||
|
||||
2.27.1 - March 27, 2006
|
||||
|
||||
Allow calls to the built-in method parameter/2 with the first argument
|
||||
not instantiated at compile time. Detect and report as a compilation
|
||||
error parameter/2 indexes that are out of range.
|
||||
|
||||
Optimized generation of predicate definition and declaration linking
|
||||
clauses, resulting in small lookup performance improvements and in space
|
||||
savings for the Prolog code generated when compiling Logtalk entities.
|
||||
|
||||
Many minor code and documentation improvements to the Logtalk compiler.
|
||||
|
||||
Added an object version of the tokenizer described in the Michael
|
||||
Covington's paper "Tokenization using DCG Rules" to the "dcgs" example.
|
||||
|
||||
Improved integration code for Qu-Prolog and Logtalk ("configs/qphook.ql").
|
||||
|
||||
Improved library hierarchy methods that return lists of objects in order
|
||||
to avoid duplicated elements (library objects "proto_hierarchy.lgt" and
|
||||
"class_hierarchy.lgt"). Added new methods extension/1 and extensions/1 to
|
||||
the library object "proto_hierarchy.lgt".
|
||||
|
||||
Documented the concept of "parametric object proxy". Added a new example,
|
||||
"proxies", illustrating the use of parametric object proxies.
|
||||
|
||||
Added support for code completion and for listing entity names on the
|
||||
symbol pop-up menu to the MacOS X TextMate text editor.
|
||||
|
||||
Updated the "cplgtdirs.*" scripts to also create an alias/shortcut to the
|
||||
"wenv" directory.
|
||||
|
||||
Renamed the alternative compilation and documentation directory names on
|
||||
all config files to be compatible across operating-systems. Removed unused
|
||||
predicate '$lgt_reverse'/2 from all config files.
|
||||
|
||||
Updated HTML manuals "print.css" CSS file for compatibility with the
|
||||
latest version of CSSToXSLFO.
|
||||
|
||||
|
||||
2.27.0 - February 9, 2006
|
||||
|
||||
Improved performance for local calls to the built-in methods phrase/2-3.
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
@ -122,3 +122,9 @@ generated by previous Logtalk versions.
|
||||
Logtalk version 2.27.0 changes representation of declared predicates in order
|
||||
to support the new predicate property non_terminal/1, implying recompilation
|
||||
of all objects, protocols, and categories.
|
||||
|
||||
Logtalk version 2.27.1 optimizes the generation of predicate definition and
|
||||
declaration linking clauses, resulting in small performance improvements and
|
||||
in space savings for the Prolog code generated when compiling Logtalk entities.
|
||||
Recompilation of all objects, protocols, and categories is necessary in order
|
||||
to take advantage of this optimizations.
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
@ -145,6 +145,9 @@ polygons
|
||||
profiling
|
||||
examples of using of events and monitors to implement profilers
|
||||
|
||||
proxies
|
||||
example of using parametric object proxies
|
||||
|
||||
puzzles
|
||||
several examples of logical puzzles
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
@ -71,6 +71,15 @@ L = [pwd,'cd ..','ls -a'] ?
|
||||
yes
|
||||
|
||||
|
||||
% convert a string to a list of tokens (words, numbers, ponctuation):
|
||||
|
||||
| ?- tokenizer::tokens(" We owe $1,048,576.24 to Agent 007 for Version 3.14159! ", Tokens).
|
||||
|
||||
Tokens = [we,owe,$,1048576.24,to,agent,7,for,version,3.14159,!] ?
|
||||
|
||||
yes
|
||||
|
||||
|
||||
% walker movements:
|
||||
|
||||
| ?- walker::walk([n(5), e(4), s(2), nw(8), s(5), se(1), n(4)], Ending).
|
||||
|
@ -6,6 +6,7 @@
|
||||
enigma,
|
||||
parsetree,
|
||||
sentences,
|
||||
tokenizer,
|
||||
url,
|
||||
xml,
|
||||
shell,
|
||||
@ -26,6 +27,7 @@ files, comment the directive above and uncomment the directive below
|
||||
enigma,
|
||||
parsetree,
|
||||
sentences,
|
||||
tokenizer,
|
||||
url,
|
||||
xml,
|
||||
shell,
|
||||
|
114
Logtalk/examples/dcgs/tokenizer.lgt
Normal file
114
Logtalk/examples/dcgs/tokenizer.lgt
Normal file
@ -0,0 +1,114 @@
|
||||
|
||||
% Natural Language Processing in Prolog using Definite Clause Grammar rules
|
||||
%
|
||||
% This example is a straightforward adaptation of the original plain Prolog
|
||||
% code described in the paper:
|
||||
%
|
||||
% Tokenization using DCG Rules
|
||||
% Michael A. Covington
|
||||
% Artificial Intelligence Center
|
||||
% The University of Georgia
|
||||
% Athens, Georgia 30602-7415 U.S.A.
|
||||
% 2000 April 21
|
||||
%
|
||||
% A copy of the paper is available at:
|
||||
%
|
||||
% http://www.ai.uga.edu/~mc/projpaper.ps
|
||||
%
|
||||
% Usage example:
|
||||
%
|
||||
% | ?- tokenizer::tokens(" We owe $1,048,576.24 to Agent 007 for Version 3.14159! ", Tokens).
|
||||
|
||||
:- object(tokenizer).
|
||||
|
||||
:- info([
|
||||
version is 1.0,
|
||||
date is 2006/2/11,
|
||||
author is 'Michael A. Covington',
|
||||
comment is 'Natural language tokenizer example using DCG rules.']).
|
||||
|
||||
:- public(tokens/2).
|
||||
:- mode(tokens(+string, -list), zero_or_more).
|
||||
:- info(tokens/2, [
|
||||
comment is 'Parses a string into a list of tokens.',
|
||||
argnames is ['String', 'Tokens']]).
|
||||
|
||||
tokens(String, Tokens) :-
|
||||
phrase(token_list(Tokens), String).
|
||||
|
||||
% A token list is a series of zero or more tokens.
|
||||
% Its argument consists of the list of tokens, as atoms and numbers.
|
||||
% The cut ensures that the maximum number of characters is gathered into each token.
|
||||
|
||||
token_list([T| Rest]) --> blank0, token(T), !, token_list(Rest).
|
||||
token_list([]) --> blank0.
|
||||
|
||||
% blank0 is a series of zero or more blanks.
|
||||
|
||||
blank0 --> [C], {char_type(C, blank)}, !, blank0.
|
||||
blank0 --> [].
|
||||
|
||||
% Several kinds of tokens.
|
||||
% This is where lists of characters get converted into atoms or numbers.
|
||||
|
||||
token(T) --> special(L), {atom_codes(T, L)}.
|
||||
token(T) --> word(W), {atom_codes(T, W)}.
|
||||
token(T) --> numeral(N), {number_codes(T, N)}.
|
||||
|
||||
% A word is a series of one or more letters.
|
||||
% The rules are ordered so that we first try to gather as many
|
||||
% characters into one digit_string as possible.
|
||||
|
||||
word([L| Rest]) --> letter(L), word(Rest).
|
||||
word([L]) --> letter(L).
|
||||
|
||||
% A numeral is a list of characters that constitute a number.
|
||||
% The argument of numeral(...) is the list of character codes.
|
||||
|
||||
numeral([C1, C2, C3| N]) --> ",", digit(C1), digit(C2), digit(C3), numeral(N).
|
||||
numeral([C1, C2, C3]) --> ",", digit(C1), digit(C2), digit(C3).
|
||||
numeral([C| N]) --> digit(C), numeral(N). % multiple digits
|
||||
numeral([C]) --> digit(C). % single digit
|
||||
numeral(N) --> decimal_part(N). % decimal point and more digits
|
||||
|
||||
decimal_part([46| Rest]) --> ".", digit_string(Rest).
|
||||
|
||||
digit_string([D| N]) --> digit(D), digit_string(N).
|
||||
digit_string([D]) --> digit(D).
|
||||
|
||||
% Various kinds of characters...
|
||||
|
||||
digit(C) --> [C], {char_type(C, numeric)}.
|
||||
|
||||
special([C]) --> [C], {char_type(C, special)}.
|
||||
|
||||
letter(C) --> [C], {char_type(C, lowercase)}.
|
||||
letter(C) --> [U], {char_type(U, uppercase), C is U + 32}. % Conversion to lowercase
|
||||
|
||||
% char_type(+Code, ?Type)
|
||||
% Classifies a character (ASCII code) as blank, numeric, uppercase, lowercase, or special.
|
||||
% Adapted from Covington 1994.
|
||||
|
||||
char_type(Code, Type) :- % blanks, other ctrl codes
|
||||
Code =< 32,
|
||||
!,
|
||||
Type = blank.
|
||||
|
||||
char_type(Code, Type) :- % digits
|
||||
48 =< Code, Code =< 57,
|
||||
!,
|
||||
Type = numeric.
|
||||
|
||||
char_type(Code, Type) :- % lowercase letters
|
||||
97 =< Code, Code =< 122,
|
||||
!,
|
||||
Type = lowercase.
|
||||
|
||||
char_type(Code, Type) :- % uppercase letters
|
||||
65 =< Code, Code =< 90,
|
||||
!,
|
||||
Type = uppercase.
|
||||
|
||||
char_type(_, special). % all others
|
||||
|
||||
:- end_object.
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
33
Logtalk/examples/proxies/NOTES
Normal file
33
Logtalk/examples/proxies/NOTES
Normal file
@ -0,0 +1,33 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
||||
|
||||
To load this example and for sample queries, please see the SCRIPT file.
|
||||
|
||||
A parametric object may be used to represent objects whose "state" is static
|
||||
and set when the object is defined. However, there can be only one parametric
|
||||
object with a given functor and arity. For example, if we define the following
|
||||
parametric object:
|
||||
|
||||
:- object(circle(_Radius, _Color)).
|
||||
...
|
||||
:- end_object.
|
||||
|
||||
then the following terms may be interpreted as references to the object above:
|
||||
|
||||
circle(1, blue)
|
||||
circle(2, yellow)
|
||||
|
||||
In the context of parametric objects, the above terms are know as "parametric
|
||||
object proxies". Proxies represent different instantiations of a parametric
|
||||
object parameters. They may be stored on the database as Prolog facts. This
|
||||
results in a very compact representation, which can be an advantage when
|
||||
dealing with a large number of objects. However, this is also a fragile
|
||||
solution as changes on the parametric object ancestors may imply changes to
|
||||
the number and meaning of the parametric object parameters which, in turn,
|
||||
may imply changes to all the Prolog facts used to represent the individual
|
||||
objects.
|
24
Logtalk/examples/proxies/SCRIPT
Normal file
24
Logtalk/examples/proxies/SCRIPT
Normal file
@ -0,0 +1,24 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
||||
|
||||
% start by loading the example:
|
||||
|
||||
| ?- logtalk_load(proxies(loader)).
|
||||
...
|
||||
|
||||
|
||||
% print the area and the perimeter for all circle proxies:
|
||||
|
||||
| ?- forall(circle(Id, R, C), (write(Id), write(' '), circle(R, C)::print)).
|
||||
|
||||
#1 area: 4.75291, perimeter: 7.72831, color: blue
|
||||
#2 area: 43.2412, perimeter: 23.3106, color: yellow
|
||||
#3 area: 0.477836, perimeter: 2.45044, color: green
|
||||
#4 area: 103.508, perimeter: 36.0655, color: black
|
||||
#5 area: 217.468, perimeter: 52.2761, color: cyan
|
||||
yes
|
13
Logtalk/examples/proxies/loader.lgt
Normal file
13
Logtalk/examples/proxies/loader.lgt
Normal file
@ -0,0 +1,13 @@
|
||||
|
||||
:- initialization(
|
||||
logtalk_load(
|
||||
[proxies])).
|
||||
|
||||
/*
|
||||
If you intend to use the FOP XSL:FO processor for generating PDF documenting
|
||||
files, comment the directive above and uncomment the directive below
|
||||
|
||||
:- initialization(
|
||||
logtalk_load(
|
||||
[proxies], [xmlsref(standalone)])).
|
||||
*/
|
39
Logtalk/examples/proxies/proxies.lgt
Normal file
39
Logtalk/examples/proxies/proxies.lgt
Normal file
@ -0,0 +1,39 @@
|
||||
|
||||
:- object(circle(_Radius, _Color)).
|
||||
|
||||
:- public([
|
||||
radius/1,
|
||||
color/1,
|
||||
area/1,
|
||||
perimeter/1,
|
||||
print/0]).
|
||||
|
||||
radius(Radius) :-
|
||||
parameter(1, Radius).
|
||||
|
||||
color(Color) :-
|
||||
parameter(2, Color).
|
||||
|
||||
area(Area) :-
|
||||
::radius(Radius),
|
||||
Area is 3.1415927*Radius*Radius.
|
||||
|
||||
perimeter(Perimeter) :-
|
||||
::radius(Radius),
|
||||
Perimeter is 2*3.1415927*Radius.
|
||||
|
||||
print :-
|
||||
area(Area), write('area: '), write(Area),
|
||||
perimeter(Perimeter), write(', perimeter: '), write(Perimeter),
|
||||
color(Color), write(', color: '), write(Color), nl.
|
||||
|
||||
:- end_object.
|
||||
|
||||
|
||||
% parametric object proxies (with an extra argument to represent identity):
|
||||
|
||||
circle('#1', 1.23, blue).
|
||||
circle('#2', 3.71, yellow).
|
||||
circle('#3', 0.39, green).
|
||||
circle('#4', 5.74, black).
|
||||
circle('#5', 8.32, cyan).
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
@ -1,6 +1,6 @@
|
||||
=================================================================
|
||||
Logtalk - Object oriented extension to Prolog
|
||||
Release 2.27.0
|
||||
Release 2.27.1
|
||||
|
||||
Copyright (c) 1998-2006 Paulo Moura. All Rights Reserved.
|
||||
=================================================================
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user