;Copyleft (C) 1996 William Totten
;biell@udel.edu

;This program implements the fibonnaci number generating alogithims.
;Recurrence relation:
;fib(0)=0
;fib(1)=1
;fib(n)=fib(n-1) + fib(n-2)

;Recursive implementation of the algorithm
fib(0,0) :- !.
fib(1,1) :- !.
fib(N,K) :- K is fib(N-1) + fib(N-2), !.

;Iterative implementation of the algorightm
;def fib_i(n):
;	if(n<=1):
;		return n
;	else:
;		last_last=0
;		last=1
;		while(n>1):
;			now=last+last_last
;			last_last=last
;			last=now
;			n=n-1
;		return now
