Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Search Tree for this Prolog code Codes containing facts, rules, and other required programming concepts for the implementation: / * Fact * / wet (

Search Tree for this Prolog code
Codes containing facts, rules, and other required programming concepts for the implementation:
/*Fact*/
wet(low).
wet(medium).
wet(high).
temp(low).
temp(medium).
temp(high).
wind(high).
state(low, low).
state(low, medium).
state(low, high).
state(medium, low).
state(medium, medium).
state(medium, high).
state(high, low).
state(high, medium).
state(high, low, high).
weather(snow, low, low).
weather(mild, low, medium).
weather(dry, low, high).
weather(cold, medium, low).
weather(suny, medium, high).
weather(foggy, medium, medium).
weather(rainy, high, low).
weather(cloudy, high, medium).
weather(thunderStorm, high, low, high).
/*Rule*/
weather(snow):- wet(low), temp(low).
weather(mild):- wet(low), temp(medium).
weather(dry):- wet(low), temp(high).
weather(cold):- wet(medium), temp(low).
weather(suny):- wet(medium), temp(high).
weather(foggy):- wet(medium), temp(medium).
weather(rainy):- wet(high), temp(low).
weather(cloudy):- wet(high), temp(medium).
weather(thunderStorm):- wet(high), temp(low), wind(high).
snow:- state(low, low).
mild:- state(low, medium).
dry:- state(low, high).
cold:- state(medium, low).
suny:- state(medium, high).
foggy:- state(medium, medium).
rainy:- state(high, low).
cloudy:- state(high, medium).
thunderStorm:- state(high, low, high).
whatWeather(Wet, Temp, Weather) :-
weather(Weather, Wet, Temp).
whatWeather(Wet, Temp, Wind, Weather) :-
weather(Weather, Wet, Temp, Wind).
whatState(Weather, Wet, Temp) :-
weather(Weather, Wet, Temp).
whatState(Weather, Wet, Temp, Wind) :-
weather(Weather, Wet, Temp, Wind).

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

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions

Question

What, if any, financial support do they provide their students?

Answered: 1 week ago