Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Visual C# And Databases

Authors: Philip Conrod, Lou Tylee

16th Edition

1951077083, 978-1951077082

More Books

Students also viewed these Databases questions