ARTIFICIAL INTELLIGENCE

Completado Publicado hace 7 años Pagado a la entrega
Completado Pagado a la entrega

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).

Programación en C Ingeniería Java Verificación de software

Nº del proyecto: #13664117

Sobre el proyecto

8 propuestas Proyecto remoto Activo hace 7 años

Adjudicado a:

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 Más

$500 USD en 10 días
(89 comentarios)
6.8

8 freelancers están ofertando un promedio de $134 por este trabajo

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 Más

$150 USD en 1 día
(411 comentarios)
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 Más

$200 USD en 3 días
(112 comentarios)
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 Más

$100 USD en 1 día
(11 comentarios)
4.5