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). 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
Get step-by-step solutions from verified subject matter experts
