Predicatesfibonacci(integer,integer)
Clausesfibonacci(0,1).fibonacci(1,1).fibonacci(N,F):-N>1,N1=N-1,N2=N-2,fibonacci(N1,F1),fibonacci(N2,F2),F=F1+F2.
Goalfibonacci(6,F).
No comments:
Post a Comment