Question: What is wrong this piece of Prolog code? ancestor ( A , D ) : - ancestor ( A , P ) , ancestor (
What is wrong this piece of Prolog code?
ancestorA D : ancestor A P ancestorP D
Answers:
A
It does not have a stopping condition.
B
It is not a tailrecursive program, and it is not efficient.
C
It does not have a definition of the sizen problem.
D
It has two sizem problems with different sizes.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
