Logtalk 2.30.1 files.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1903 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
pmoura
2007-06-12 10:39:47 +00:00
parent 84f478c301
commit 6b4bde14e1
475 changed files with 6213 additions and 6424 deletions

View File

@@ -0,0 +1,48 @@
:- object(paths).
:- info([
version is 1.0,
author is 'Paulo Moura',
date is 2007/05/14,
comment is 'Simple tabling example using graph paths.',
source is 'Direct conversion to Logtalk of a XSB tabling example.']).
:- public(path/2).
:- table(path/2).
path(X,Y) :- path(X,Z), edge(Z,Y).
path(X,Y) :- edge(X,Y).
edge(1,2).
edge(2,2).
edge(2,4).
edge(2,3).
edge(3,5).
:- end_object.
:- object(fibonacci).
:- info([
version is 1.1,
author is 'Paulo Moura',
date is 2007/05/28,
comment is 'Simple tabling example using Fibonacci numbers.',
source is 'Direct conversion to Logtalk of a B-Prolog tabling example.']).
:- public(fib/2).
:- table(fib/2).
fib(0, 1).
fib(1, 1).
fib(N,F) :-
N > 1,
N1 is N - 1,
N2 is N - 2,
fib(N1, F1),
fib(N2, F2),
F is F1 + F2.
:- end_object.