University of Gondar
Department of computer science
Artificial Intelligence lab questions (15%) for 4th year extension students
Name ----------------------------------------------------------------------- IDNO ------------------
1. Consider the following fact.
2. parent( pam, hailu). what will be Prolog's answers to the
3. parent( tom, hailu). following questions
4. parent( tom, liz). A. ?- parent(jim, A).
5. parent( hailu, ann). B. ?- parent(A, jim).
6. parent( hailu, pat). C. ?- parent(pam, A), parent(A, pat).
7. parent( pat, jim). D. ?- parent(pam, A), parent(A,B),
parent(A, jim).
E. Parent(X, ann), parent(X,pat).
2. Consider the following fact.
p([H|T], H, T). what will be Prolog's answers to the
following questions
a. ?- p([a,b,c], X, Y).
b. ?- p([a], X, Y).
c. ?- p([], X, Y).
3. If sky is blue, everyone likes it. - Write this statement as a prolog clause.
4. consider the following facts:
father(yirga, hailu). what will be Prolog's answers to the following
father(gizachew, arega). questions
mother(werkie, hailu). A. mother(Z, abeba).
B. father(X, Y).
mother(arega, abeba).
C. grandfather(X, Y).
parent(X,Y) :- father(X,Y).
parent(X,Y) :- mother(X,Y).
grandfather(X,Y):-
father(X,Z),parent(Z,Y).