Computer Science, asked by tektrix360, 1 year ago

1.What does the query noFriend(john) return for the following Prolog program?
noFriend(X) :- not(friend(X,Y)).
friend(dev,bob).
friend(bob,johny).
friend(dev,johny).
a.true
b.false
c.Infinite loop


2.What does the query noFriend(johny) return for the following Prolog program?
noFriend(X) :- not(friend(X,Y)).
friend(X,Y) :- friend(Y,X).
friend(dev,bob).
friend(bob,johny).
friend(dev,johny).
a.true
b.false
c.Infinite loop

Answers

Answered by sarveshkumar83
0

The programming is false........

Answered by siddhartharao77
0

1.

noFriend(X):-not(friend(X,Y)).

friend(dev,bob).

friend(bob,johny).

friend(dev,johny).

"The following query returns False for the following prolog program".

2.

noFriend(johny) :- not(friend(X,Y)).

friend(XY) :- friend(Y,X).

friend(X,Y) :-friend(Y,X).

friend(dev,boob).

friend(bob,johny).

friend(dev,johny)

"The given query returns False for the given prolog program".

Hope it helps!

Similar questions