ARTIFICIAL INTELLIGENCE

Completed Posted 7 years ago Paid on delivery
Completed Paid on delivery

I wish you to add to it by adding 2 rules to it. The first is mother(X, Y) and the second rule is grandparent(X, Z). The first one allows us is put in either the name of a mother (here X) from our database and find all her children (here Y) or the reverse to put in the name of a child and find the name of the mother. The second allows us to put in the grandfather's name and find all the grandchildren or to do the reverse. The database as you see below consists of information such as parent(pam, bob) which says pam is a parent of bob and female(pam), which says pam is a female.

You put the full program on your laptop and be prepared to run the program for me next Tuesday. I will supply you next week with test queries to see if the new rules run correctly.

parent(pam, bob).

parent(tom, bob).

parent(tom, liz).

parent(bob, ann).

parent(bob, pat).

parent(pat, jim).

male(jim).

female(pat).

female(ann).

female(liz).

male(bob).

male(tom).

female(pam).

offspring(Y,X) :- parent(X, Y).

then

1.

First enter the additional facts into the program1 file:

parent(john, pam).

parent(jill, john).

male(john).

female(jill).

2.

Now add the following rules to the program 1 file:

a.

A rule for sister (i.e., sister(X, Y), where X is a sister of who).

To make this rule work correctly add the following to the program:

different(X,Y) :- not(X=Y).

b.

A rule for predecessor (i.e., predecessor(X,Y) will give all the people that come before and are related to X, that is, all ancestors.) This rule must be recursive.

Below is a partial program, program 3, which you are to complete. It is due in 2 weeks.

%expert system to find thermostat setting at workplace.

% expert rules

% If it's saturday or sunday it's the weekend

weekend:-day(saturday);day(sunday).

% If it's not the weekend or a holiday, it's a workday.

% Fridays in August are holidays

% Business hours are on workdays from 9 to 5

business_hours:-workday,time(X),X>=9,X=<17. %24 hour time, midnight=0

% The office is closed outside of business hours

% Summer is the months of June, July and August, fall - September, October, and November, winter - December, January, and

% February, spring - March, April, and May.

summer:-month(june);month(july);month(august).

% The thermostat setting in spring and fall, during business hours should be 70

setting(X):- ,X=70.

% The thermostat setting in spring and fall, when the office is closed should be 50

setting(X):-

% The thermostat setting in winter, during business hours should be 68

setting(X):-

% The thermostat setting in winter, when the office is closed should be 45

setting(X):-

% The thermostat setting in summer, during business hours should be 74

setting(X):-

% The thermostat setting in summer, when the office is closed should be 85

setting(X):-

% The following 3 can be changed for different answers

month(august).

day(friday).

time(11).

C Programming Engineering Java Software Testing

Project ID: #13664117

About the project

8 proposals Remote project Active 7 years ago

Awarded to:

szymszteinsl

Ready to work !Ready to work !Ready to work !Ready to work !Ready to work !Ready to work !Ready to work !Ready to work !Ready to work !Ready to work !Ready to work !Ready to work !Ready to work !Ready to work !Ready to More

$500 USD in 10 days
(89 Reviews)
6.8

8 freelancers are bidding on average $134 for this job

dobreiiita

Hello I am Java expert and interested in this project. I have reviewed the details and confident to handle it perfectly. I will keep codes well documented and simple. Please communicate to discuss further. R More

$150 USD in 1 day
(411 Reviews)
7.4
hbxfnzwpf

I am very proficient in c and c++. I have 16 years c++ developing experience now, and have worked for more than 7 years. My work is online game developing, and mainly focus on server side, using c++ under Linux environ More

$200 USD in 3 days
(112 Reviews)
6.8
schoudhary1553

Greetings sir, i am an expert freelancer for this job and your 100% satisfaction is assured if you allow me to serve. Here is the reason. Why you should pick me? a) I am a very expert and have the same kind o More

$100 USD in 1 day
(11 Reviews)
4.5