Logtalk 2.30.2 files.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1908 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
628bcbeeb6
commit
9fc2c47d53
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
@ -10,6 +10,31 @@ RELEASE NOTES
|
|||||||
=============
|
=============
|
||||||
|
|
||||||
|
|
||||||
|
2.30.2 - June 24, 2007
|
||||||
|
|
||||||
|
Updated the Logtalk compiler to throw a compilation error when duplicated
|
||||||
|
or conflicting predicate scope directives are found.
|
||||||
|
|
||||||
|
Updated the Logtalk compiler to correct a cosmetic glitch when reporting
|
||||||
|
compilation errors.
|
||||||
|
|
||||||
|
Updated the Logtalk compiler to check for mismatches between the argument
|
||||||
|
of this/1 calls and the parametric object identifier.
|
||||||
|
|
||||||
|
Corrected a bug in the implementation of the multi-threading built-in
|
||||||
|
predicate threaded_ignore/1.
|
||||||
|
|
||||||
|
Revamped the "threads/buffer" example to support setting the buffer
|
||||||
|
maximum number of items.
|
||||||
|
|
||||||
|
Added a new DCG example, "dcgs/morse.lgt", for parsing messages in Morse
|
||||||
|
code.
|
||||||
|
|
||||||
|
Extended the "parametric" example to illustrate a solution for dealing
|
||||||
|
with inheritance when defining "setter" predicates/methods that return
|
||||||
|
updated object identifiers.
|
||||||
|
|
||||||
|
|
||||||
2.30.1 - June 12, 2007
|
2.30.1 - June 12, 2007
|
||||||
|
|
||||||
Added a new, experimental control construct, :/1, for calling imported
|
Added a new, experimental control construct, :/1, for calling imported
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
@ -35,6 +35,17 @@ objects and categories:
|
|||||||
bypass
|
bypass
|
||||||
using the {} DCG construct together with the {} Logtalk control
|
using the {} DCG construct together with the {} Logtalk control
|
||||||
construct
|
construct
|
||||||
|
tokenizer
|
||||||
|
natural language tokenizer example
|
||||||
|
macaddr
|
||||||
|
validator for MAC addresses
|
||||||
|
morse
|
||||||
|
decoder for Morse code messages; illustrate how to use scope
|
||||||
|
directives to declare grammar rule non-terminals
|
||||||
|
|
||||||
|
This folder contains an example ("tokenizer") adopted with permission from
|
||||||
|
a Michael A. Covington example (http://www.ai.uga.edu/~mc/). See the file
|
||||||
|
"tokenizer.lgt" for more details.
|
||||||
|
|
||||||
This folder contains two examples of DCGs ("bom" and "faa") adopted with
|
This folder contains two examples of DCGs ("bom" and "faa") adopted with
|
||||||
permission from the Amzi! Prolog documentation. The documentation is
|
permission from the Amzi! Prolog documentation. The documentation is
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
@ -20,13 +20,21 @@ Result = -9
|
|||||||
yes
|
yes
|
||||||
|
|
||||||
|
|
||||||
% Recognize MAC addresses:
|
% recognize MAC addresses:
|
||||||
|
|
||||||
| ?- macaddr::valid("00:1e:4a:ef:72:8b").
|
| ?- macaddr::valid("00:1e:4a:ef:72:8b").
|
||||||
|
|
||||||
yes
|
yes
|
||||||
|
|
||||||
|
|
||||||
|
% decode Morse code messages:
|
||||||
|
|
||||||
|
?- morse::phrase(morse(Message), "... --- ...").
|
||||||
|
|
||||||
|
Message = [sos]
|
||||||
|
yes
|
||||||
|
|
||||||
|
|
||||||
% solve a cellphone keypad encoded enigma:
|
% solve a cellphone keypad encoded enigma:
|
||||||
|
|
||||||
| ?- enigma::solve("4 96853 5683 86 4283 346637 9484 968 8664448", Message).
|
| ?- enigma::solve("4 96853 5683 86 4283 346637 9484 968 8664448", Message).
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
date is 2006/01/22,
|
date is 2006/01/22,
|
||||||
comment is 'Example of using DCG rules to decrypt a enigma where words are made of numbers corresponding to the characters on a cellphone keypad.']).
|
comment is 'Example of using DCG rules to decrypt a enigma where words are made of numbers corresponding to the characters on a cellphone keypad.']).
|
||||||
|
|
||||||
:- public(solve/2).
|
|
||||||
:- public(solve/2).
|
:- public(solve/2).
|
||||||
:- mode(solve(+string, -list(atom)), zero_or_one).
|
:- mode(solve(+string, -list(atom)), zero_or_one).
|
||||||
:- info(solve/2, [
|
:- info(solve/2, [
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
parsetree,
|
parsetree,
|
||||||
sentences,
|
sentences,
|
||||||
tokenizer,
|
tokenizer,
|
||||||
|
morse,
|
||||||
macaddr,
|
macaddr,
|
||||||
url,
|
url,
|
||||||
xml,
|
xml,
|
||||||
|
86
Logtalk/examples/dcgs/morse.lgt
Normal file
86
Logtalk/examples/dcgs/morse.lgt
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
|
||||||
|
:- object(morse).
|
||||||
|
|
||||||
|
:- info([
|
||||||
|
version is 1.0,
|
||||||
|
author is 'Paulo Moura',
|
||||||
|
date is 2007/06/14,
|
||||||
|
comment is 'Morse code decoder.']).
|
||||||
|
|
||||||
|
:- public(morse//1).
|
||||||
|
:- mode(morse(-list(atom)), zero_or_one).
|
||||||
|
:- info(morse//1, [
|
||||||
|
comment is 'Recognizes a message in Morse code, returning the corresponding list of words.',
|
||||||
|
argnames is ['Words']]).
|
||||||
|
|
||||||
|
morse([Word| Words]) --> word(Characters), {atom_chars(Word, Characters)}, " ", morse(Words).
|
||||||
|
morse([Word]) --> word(Characters), {atom_chars(Word, Characters)}.
|
||||||
|
|
||||||
|
word([Character| Characters]) --> character(LM), {code(Character, LM)}, " ", word(Characters).
|
||||||
|
word([Character]) --> character(Symbols), {code(Character, Symbols)}.
|
||||||
|
|
||||||
|
character([Symbol| Symbols]) --> symbol([Symbol]), character(Symbols).
|
||||||
|
character([Symbol]) --> symbol([Symbol]).
|
||||||
|
|
||||||
|
symbol(".") --> ".".
|
||||||
|
symbol("-") --> "-".
|
||||||
|
|
||||||
|
code(a, ".-").
|
||||||
|
code(b, "-...").
|
||||||
|
code(c, "-.-.").
|
||||||
|
code(d, "-..").
|
||||||
|
code(e, ".").
|
||||||
|
code(f, "..-.").
|
||||||
|
code(g, "--.").
|
||||||
|
code(h, "....").
|
||||||
|
code(i, "..").
|
||||||
|
code(j, ".---").
|
||||||
|
code(k, "-.-").
|
||||||
|
code(l, ".-..").
|
||||||
|
code(m, "--").
|
||||||
|
code(n, "-.").
|
||||||
|
code(o, "---").
|
||||||
|
code(p, ".--.").
|
||||||
|
code(q, "--.-").
|
||||||
|
code(r, ".-.").
|
||||||
|
code(s, "...").
|
||||||
|
code(t, "-").
|
||||||
|
code(u, "..-").
|
||||||
|
code(v, "...-").
|
||||||
|
code(w, ".--").
|
||||||
|
code(x, "-..-").
|
||||||
|
code(y, "-.--").
|
||||||
|
code(z, "--..").
|
||||||
|
|
||||||
|
code('1', ".----").
|
||||||
|
code('2', "..---").
|
||||||
|
code('3', "...--").
|
||||||
|
code('4', "....-").
|
||||||
|
code('5', ".....").
|
||||||
|
code('6', "-....").
|
||||||
|
code('7', "--...").
|
||||||
|
code('8', "---..").
|
||||||
|
code('9', "----.").
|
||||||
|
code('0', "-----").
|
||||||
|
|
||||||
|
code('.', ".-.-.-").
|
||||||
|
code(',', "--..--").
|
||||||
|
code('?', "..--..").
|
||||||
|
code('''', ".----.").
|
||||||
|
code('!', "-.-.--").
|
||||||
|
%code('!', "— — — ·").
|
||||||
|
code('/', "-..-.").
|
||||||
|
code('(', "-.--.").
|
||||||
|
code(')', "-.--.-").
|
||||||
|
code('&', ".-...").
|
||||||
|
code(':', "---...").
|
||||||
|
code(';', "-.-.-.").
|
||||||
|
code('=', "-...-").
|
||||||
|
code('+', ".-.-.").
|
||||||
|
code('-', "-....-").
|
||||||
|
code('_', "..--.-").
|
||||||
|
code('"', ".-..-.").
|
||||||
|
code('$', "...-..-").
|
||||||
|
code('@', ".--.-").
|
||||||
|
|
||||||
|
:- end_object.
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
@ -71,3 +71,18 @@ NR = rectangle(2, 1, 3, 4)
|
|||||||
X2 = 3
|
X2 = 3
|
||||||
Y2 = 4
|
Y2 = 4
|
||||||
yes
|
yes
|
||||||
|
|
||||||
|
|
||||||
|
% some queries with parametric objects that define "setter"
|
||||||
|
% methods that return updated object identifiers:
|
||||||
|
|
||||||
|
| ?- person(sally, 20)::grow_older(NewId).
|
||||||
|
|
||||||
|
NewId = person(sally, 21)
|
||||||
|
yes
|
||||||
|
|
||||||
|
|
||||||
|
| ?- employee(sally, 21, 1200)::give_raise(250, NewId).
|
||||||
|
|
||||||
|
NewId = employee(sally, 21, 1450)
|
||||||
|
yes
|
||||||
|
@ -201,7 +201,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/* The following parametric object illustrates a solution for implementing
|
/* The following parametric object illustrates a solution for implementing
|
||||||
modifiable object state. The idea is to represent object state by using
|
backtracable object state. The idea is to represent object state by using
|
||||||
object parameters, defining "setter" predicates/methods that return the
|
object parameters, defining "setter" predicates/methods that return the
|
||||||
updated object identifier.
|
updated object identifier.
|
||||||
*/
|
*/
|
||||||
@ -276,3 +276,74 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
:- end_object.
|
:- end_object.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* The following parametric objects show a solution for dealing with inheritance when
|
||||||
|
defining "setter" predicates/methods that return updated object identifiers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
:- object(person(_Name, _Age)).
|
||||||
|
|
||||||
|
:- info([
|
||||||
|
version is 1.0,
|
||||||
|
author is 'Paulo Moura',
|
||||||
|
date is 2007/6/19,
|
||||||
|
comment is 'A simple representation for people using parametric objects.',
|
||||||
|
parnames is ['Name', 'Age']]).
|
||||||
|
|
||||||
|
:- public(grow_older/1).
|
||||||
|
:- mode(grow_older(-object_identifier), one).
|
||||||
|
:- info(grow_older/1,
|
||||||
|
[comment is 'Increments the person''s age, returning the updated object identifier.',
|
||||||
|
argnames is ['NewId']]).
|
||||||
|
|
||||||
|
grow_older(NewId) :-
|
||||||
|
::age(OldAge, NewAge, NewId),
|
||||||
|
NewAge is OldAge + 1.
|
||||||
|
|
||||||
|
:- protected(age/3).
|
||||||
|
:- mode(age(?integer, ?integer, -object_identifier), zero_or_one).
|
||||||
|
:- info(age/3,
|
||||||
|
[comment is 'Rectangle area.',
|
||||||
|
argnames is ['OldAge', 'NewAge', 'NewId']]).
|
||||||
|
|
||||||
|
age(OldAge, NewAge, person(Name, NewAge)) :- % this rule is compiled into a fact due to
|
||||||
|
this(person(Name, OldAge)). % compilation of the this/1 call inline
|
||||||
|
|
||||||
|
:- end_object.
|
||||||
|
|
||||||
|
|
||||||
|
:- object(employee(Name, Age, _Salary),
|
||||||
|
extends(person(Name, Age))).
|
||||||
|
|
||||||
|
:- info([
|
||||||
|
version is 1.0,
|
||||||
|
author is 'Paulo Moura',
|
||||||
|
date is 2007/6/19,
|
||||||
|
comment is 'A simple representation for employees using parametric objects.',
|
||||||
|
parnames is ['Name', 'Age', 'Salary']]).
|
||||||
|
|
||||||
|
:- public(give_raise/2).
|
||||||
|
:- mode(give_raise(+integer, -object_identifier), one).
|
||||||
|
:- info(give_raise/2,
|
||||||
|
[comment is 'Gives a raise to the employee, returning the updated object identifier.',
|
||||||
|
argnames is ['Amount', 'NewId']]).
|
||||||
|
|
||||||
|
give_raise(Amount, NewId) :-
|
||||||
|
::salary(OldSalary, NewSalary, NewId),
|
||||||
|
NewSalary is OldSalary + Amount.
|
||||||
|
|
||||||
|
:- protected(salary/3).
|
||||||
|
:- mode(salary(?integer, ?integer, -object_identifier), zero_or_one).
|
||||||
|
:- info(salary/3,
|
||||||
|
[comment is 'Rectangle area.',
|
||||||
|
argnames is ['OldSalary', 'NewSalary', 'NewId']]).
|
||||||
|
|
||||||
|
salary(OldSalary, NewSalary, employee(Name, Age, NewSalary)) :-
|
||||||
|
this(employee(Name, Age, OldSalary)).
|
||||||
|
|
||||||
|
age(OldAge, NewAge, employee(Salary, Name, NewAge)) :-
|
||||||
|
this(employee(Salary, Name, OldAge)).
|
||||||
|
|
||||||
|
:- end_object.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
||||||
================================================================
|
================================================================
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
================================================================
|
================================================================
|
||||||
Logtalk - Open source object-oriented logic programming language
|
Logtalk - Open source object-oriented logic programming language
|
||||||
Release 2.30.1
|
Release 2.30.2
|
||||||
|
|
||||||
Copyright (c) 1998-2007 Paulo Moura. All Rights Reserved.
|
Copyright (c) 1998-2007 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