You are on page 1of 2

Tutorial

Question 1
If sky is blue, everyone likes it. - Write this statement as a prolog clause.
A. sky (blue) :- everyone(likes).
B. blue (sky), likes(X).
C. Likes(X, sky) :- blue(sky).
D. likes (sky, everyone) :- blue(sky).

Question 2
?- owner(jack, cat(X)) :- fur(X),spots(X). - What would be the English meaning for this prolog
clause.
A) jack is a owner of cat and fur and spots.
B) jack is the owner of X or jack is the owner of fur and spots .
C) jack is the owner of some cat if that cat has fur and spots.
D) B & C both.

Question 3
?- 11 + 4 is 15. - How will prolog respond to this query?
A) true
B) false

Question 4
?- N is -(+(5,6),4). and ?- N is (5+6)-4. - Do these different queries produce the same result
in prolog?
A) yes
B) no

Question 5

Write a simple prolog program that computes cube for the number.
Question 6
Assume given a set of facts of the form father (name1,name2) (name1 is the father of name2).
I. Define a predicate brother(X,Y) which holds iff X and Y are brothers.
II. Define a predicate cousin(X,Y) which holds iff X and Y are cousins.
III. Define a predicate grandson(X,Y) which holds iff X is a grandson of Y.
IV. Define a predicate descendent(X,Y) which holds iff X is a descendent of Y.
Question 7
Let the initial population consist of four individuals with the following chromosomes:
x1 = 6 5 4 1 3 5 3 2
x2 = 8 7 1 2 6 6 0 1
x3 = 2 3 9 2 1 2 8 5
x4 = 4 1 8 5 2 0 9 4
Perform the following crossover operations:
a) Cross the fittest two individuals (x2 and x1) using one–point crossover at the middle
point.
b) Cross the second and third fittest individuals (x1 and x3) using a two–point crossover.
c) Cross the first and third fittest individuals (ranked 1st and 3rd) using a uniform crossover.

Question 8
Inferential knowledge approach represents knowledge in the form of formal logics, use formal
logics to represent the statement below.
Marcus is a man
All men are mortal
Then it can represent as;
man(Marcus)

You might also like