0% found this document useful (0 votes)
3 views2 pages

Prolog Lab Assign

This document contains a set of questions for 4th year extension students in the Department of Computer Science at the University of Gondar, focusing on Prolog programming and logic. It includes exercises related to parent-child relationships and logical clauses, requiring students to deduce answers based on given facts. The document is structured with specific queries that students must respond to using Prolog syntax.

Uploaded by

redeatsgetnet
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Prolog Lab Assign

This document contains a set of questions for 4th year extension students in the Department of Computer Science at the University of Gondar, focusing on Prolog programming and logic. It includes exercises related to parent-child relationships and logical clauses, requiring students to deduce answers based on given facts. The document is structured with specific queries that students must respond to using Prolog syntax.

Uploaded by

redeatsgetnet
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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).

You might also like