Home      Affiliated Colleges      Course content      First Sem     Second Sem     Third Sem     Fourth Sem     Fifth Sem     Sixth Sem     Seventh Sem     Eighth Sem     Lab report 4th sem     Contact    

Friday, February 5, 2010

Introduction to Cognitive Science-Program to find fibonacii

Predicates
fibonacci(integer,integer)

Clauses
fibonacci(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.

Goal
fibonacci(6,F).

No comments:

Post a Comment

^ Scroll to Top Related Posts with Thumbnails ^ Go to Top