Question: 7. (8%) You are given the following Prolog code. foo (alice, carol). bar (bob, carol). bar (bob, dave). bar (eve, bob). qux (X, Y)

7. (8%) You are given the following Prolog code. foo (alice, carol). 

7. (8%) You are given the following Prolog code. foo (alice, carol). bar (bob, carol). bar (bob, dave). bar (eve, bob). qux (X, Y) :- ham (Z, X), ham (Z, Y). ham (X, Y) bar (X, Y). ham (X, Y) :- foo (X, Y). Suppose the query is ? qux (X, dave). What is/are the answer substitution(s) given by Prolog? What is/are the answer(s) of the query?

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 Computer Network Questions!