logo

Crowdly

Browser

Add to Chrome

Consider the following Prolog program:   parent_of(j...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Consider the following Prolog program:

 

parent_of(john,mary).

parent_of(john,peter).

parent_of(susan,mary).

ancestor_of(X,Y) :- parent_of(X,Y).

ancestor_of(X,Y) :- parent_of(X,Z), ancestor_of(Z,Y).

 

The query below produces exactly two answers.

?- ancestor_of(john,Y).

100%
0%
More questions like this

Want instant access to all verified answers on moodle.royalholloway.ac.uk?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome