Question: prolog The below prolog program is given. a. What is the output of likes(X,Y). b. What is the output of isHappy(k). has(joy, laptop). has(jemmy, ps2).

prolog
The below prolog program is given. a. What is the output of likes(X,Y). b. What is the output of isHappy(k). has(joy, laptop). has(jemmy, ps2). has(azrai, iphone6). has(encikSuka, ferrari). has(encikMulia, ferrari). has(pen, ferrari). plays(jemmy, volleyball). plays(jamal, volleyballl). plays(joy, volleyball). plays(jemmy, badminton). plays(joy, badminton). non_smoker(ali). non_smoker(jemmy). non_smoker(azrai). non_smoker(chan). non-smoker(joy). nice(pen). nice(jeff). like_travel(pen). like_travel(zain). likes(joy, Y) :- plays(Y, volleyball), plays (Y, badminton), has(Y,ps2), non_smoker(Y). isHappy(x) :- nice(X), like_travel(x), has(x, ferrari)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
