Question: What is wrong this piece of Prolog code? ancestor ( A , D ) : - ancestor ( A , P ) , ancestor (

What is wrong this piece of Prolog code?
ancestor(A, D) :- ancestor (A, P), ancestor(P, D).
Answers:
A.
It does not have a stopping condition.
B.
It is not a tail-recursive program, and it is not efficient.
C.
It does not have a definition of the size-n problem.
D.
It has two size-m problems with different sizes.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!