Logtalk 2.15.4 release files.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@843 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
pmoura
2003-07-09 00:20:55 +00:00
parent 3751bd451f
commit e8e39e597b
100 changed files with 819 additions and 133 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,6 +1,6 @@
=================================================================
Logtalk - Object oriented extension to Prolog
Release 2.15.3
Release 2.15.4
Copyright (c) 1998-2003 Paulo Moura. All Rights Reserved.
=================================================================
@@ -33,3 +33,45 @@ yes
Tree = Tree = s(np(d(the), n(girl)), vp(v(likes), np(d(the), n(boy))))
yes
% conversion between compound terms and XML
| ?- xml::convert(word(child, children), word(singular, plural), XML).
XML = '<word><singular>child</singular><plural>children</plural></word>'
yes
| ?- xml::convert(Term, Interpretation, '<word><singular>child</singular><plural>children</plural></word>').
Term = word(child, children)
Interpretation = word(singular, plural)
yes
% parsing URLs
| ?- url::parse("http://www.logtalk.org", Components).
Components = [protocol(http), address([www, logtalk, org]), path([]), file('')]
yes
| ?- url::parse("http://www.logtalk.org/", Components).
Components = [protocol(http), address([www, logtalk, org]), path(['']), file('')]
yes
| ?- url::parse("http://www.logtalk.org/cvs", Components).
Components = [protocol(http), address([www, logtalk, org]), path([cvs]), file('')]
yes
| ?- url::parse("http://www.logtalk.org/cvs.html", Components).
Components = [protocol(http), address([www, logtalk, org]), path([]), file('cvs.html')]
yes
| ?- url::parse("http://193.136.64.5/files/update", Components).
Components = [protocol(http), address([193, 136, 64, 5]), path([files, update]), file('')]
yes

View File

@@ -7,4 +7,6 @@
determiners,
nouns,
verbs,
sentence])).
sentence,
url,
xml])).

View File

@@ -0,0 +1,67 @@
:- object(url).
:- info([
version is 1.0,
date is 2003/7/7,
author is 'Paulo Moura',
comment is 'Simple example of URL parsing.']).
:- public(parse/2).
:- mode(parse(@list, -list), zero_or_one).
:- info(parse/2, [
comment is 'Parses a URL into its components.',
argnames is ['URL', 'Components']]).
parse(URL, [protocol(Protocol), address(Address), path(Path), file(File)]) :-
phrase(url(Protocol, Address, Path, File), URL).
url(Protocol, Address, Path, File) --> protocol(Protocol), "://", address(Address), path(Path), file(File).
protocol(ftp) --> "ftp".
protocol(http) --> "http".
protocol(https) --> "https".
protocol(rtsp) --> "rtsp".
address(Address) --> ip_number(Address).
address([Identifier| Identifiers]) --> identifier(Identifier), dot_identifiers(Identifiers).
ip_number([N1, N2, N3, N4]) --> ip_subnumber(N1), ".", ip_subnumber(N2), ".", ip_subnumber(N3), ".", ip_subnumber(N4).
ip_subnumber(N) --> [N1, N2, N3], {N is N3 - 0'0 + 10*(N2 - 0'0) + 100*(N1 - 0'0), N >= 0, N =< 255}.
ip_subnumber(N) --> [N1, N2], {N is N2 - 0'0 + 10*(N1 - 0'0), N >= 0, N =< 255}.
ip_subnumber(N) --> [N1], {N is N1 - 0'0, N >= 0, N =< 255}.
identifier(Identifier) --> characters(Codes), {atom_codes(Identifier, Codes)}.
characters([]) --> [].
characters([Code| Codes]) --> [Code], {character(Code)}, characters(Codes).
character(Code) :- Code @>= 0'a, Code @=< 0'z, !.
character(Code) :- Code @>= 0'A, Code @=< 0'Z.
dot_identifiers([]) --> [].
dot_identifiers([Identifier| Identifiers]) --> ".", identifier(Identifier), dot_identifiers(Identifiers).
path([]) --> [].
path([Identifier| Path]) --> "/", identifier(Identifier), path(Path).
file('') --> [].
file(File) --> "/", identifier(Name), ".", identifier(Extension), {atom_concat(Name, '.', Aux), atom_concat(Aux, Extension, File)}.
:- end_object.

View File

@@ -0,0 +1,78 @@
:- object(xml).
:- info([
version is 1.0,
date is 2003/7/7,
author is 'Paulo Moura',
comment is 'Conversion between compound terms and XML.']).
:- public(convert/3).
:- mode(convert(@compound, @compound, -atom), zero_or_one).
:- mode(convert(-compound, -compound, +atom), zero_or_one).
:- info(convert/3, [
comment is 'Converts between a compound term and an interpretation and XML.',
argnames is ['Term', 'Interpretation', 'XML']]).
convert(Term, Interpretation, XML) :-
var(XML) ->
phrase(term(Term, Interpretation), List),
atom_codes(XML, List)
;
atom_codes(XML, List),
phrase(term(Term, Interpretation), List).
term(Term, Interpretation) -->
{nonvar(Term), nonvar(Interpretation),
Interpretation =.. [Functor| Tags], Term =.. [Functor| Args]},
open_tag(Functor),
arguments(Tags, Args),
close_tag(Functor).
term(Term, Interpretation) -->
{var(Term), var(Interpretation)},
open_tag(Functor),
arguments(Tags, Args),
close_tag(Functor),
{Interpretation =.. [Functor| Tags], Term =.. [Functor| Args]}.
arguments([], []) -->
[].
arguments([Tag| Tags], [Arg| Args]) -->
open_tag(Tag),
value(Arg),
close_tag(Tag),
arguments(Tags, Args).
open_tag(Tag) -->
"<", value(Tag), ">".
close_tag(Tag) -->
"</", value(Tag), ">".
value(Value) -->
{nonvar(Value), atom_codes(Value, Codes)}, characters(Codes).
value(Value) -->
{var(Value)}, characters(Codes), {atom_codes(Value, Codes)}.
characters([]) --> [].
characters([Code| Codes]) --> [Code], {character(Code)}, characters(Codes).
character(Code) :- Code @>= 0'a, Code @=< 0'z, !.
character(Code) :- Code @>= 0'A, Code @=< 0'Z.
:- end_object.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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