Question: Given the following Prolog program: c ( 5 ) . c ( 9 ) . c ( 1 0 ) . d ( 5 )

Given the following Prolog program:
c(5).
c(9).
c(10).
d(5).
d(9).
a(x):-c(x),d(x).
b(x):-c(x),!,d(x).(a) List all the answers that Prolog would respond with for the query a(Z). Explain why those answers are generated.(b) List all the answers that Prolog would respond with for the query b(Z). Explain why those answers are generated.
 Given the following Prolog program: c(5). c(9). c(10). d(5). d(9). a(x):-c(x),d(x).

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 Databases Questions!