:- mode fibo(integer,-).
fibo(N,X):- N>=2,!,N1 is N-1,N2 is N-2,fibo(N1,X1),fibo(N2,X2),X is X1+X2.
fibo(N,N):- N>=0.

:-mode ack(integer,integer,-).
ack(0,Y,Ans):-!,Ans is Y+1.
ack(X,0,Ans):-!,XX is X-1,ack(XX,1,Ans).
ack(X,Y,Ans):-XX is X-1,YY is Y-1,ack(X,YY,A),ack(XX,A,Ans).
