Question: Please complete the following using Prolog. Thanks, I will rate. 4. For each of the following English statements write a prolog program. % Facts &
Please complete the following using Prolog. Thanks, I will rate.
4. For each of the following English statements write a prolog program.
% Facts & Rules
(1) jane is a woman.
(2) john is a man.
(3) john is healthy.
(4) jane is healthy.
(5) john is muscular.
(6) anyone is a hiker if he is healthy and muscular.
(7) anyone can hike if he is a hiker. % Goals (queries).
(8) Who can hike?
(9) Who is healthy and muscular?
5. What answers do you get for below queries for this given program?
% Facts & Rules
vegan(jose).
vegan (james).
milk(cow_milk).
milk(soy_milk).
likes(jose, X) :- milk(X).
loves(Who, soy_milk) :- vegan(Who).
% This are queries. You do not need to copy the ?- symbol
?- milk(X).
?- milk(potato).
?- likes(jose, What).
?- likes(Who, soy_milk).
?- loves(Who, soy_milk).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
