Professional Documents
Culture Documents
Implementacin
Bloque de preguntas.
Bloque de reglas.
Sistema experto
External
precio
Asks
ASK pregunta: '"ESTE ES UN SISTEMA EXPERTO DE VENTA DE AUTOMOVILES "
TE GUSTARIA CONOCER LAS DIFERENTES AUTOS?'
DOMAIN 'Si','No'
BECAUSE 'EL OBJETIVO PRINCIPAL ES QUE CONOZCAS/n'
ASK marca: 'CUAL ES LA MARCA QUE MAS LE AGRADA?'
DOMAIN 'Ford','Nissan','BMW'
BECAUSE 'PORQUE ES NECESARIO SABER LA MARCA QUE LE AGRADA'
ASK lujo: 'LE GUSTAN LOS AUTOS DE LUJO?'
DOMAIN 'si','no'
Rules
RULE 1
if (cilindraje = '4')and (asientos = 'si') and (marca = 'BMW') and
(tipoc = 'automatico')
THEN
precio := 'bajo'
ACTIONS
DISPLAY 'De acuerdo a las caractersticas que escogiste el precio del
auto es/n/n/n',
'BAJO/n'
END;
RULE 2
if (cilindraje = '4')and (asientos = 'si') and (marca = 'BMW') and
(tipoc = 'estandar')
THEN
precio := 'medio'
ACTIONS
DISPLAY 'De acuerdo a las caractersticas que escogiste el precio del
auto es/n/n/n',
'MEDIO/n'
END;
RULE 3
if (cilindraje = '4')and (asientos = 'si') and (marca = 'Nissan')
THEN
precio := 'alto'
ACTIONS
DISPLAY 'De acuerdo a las caractersticas que escogiste el precio del
auto es/n/n/n',
'ALTO/n'
END;
RULE 4
if (cilindraje = '4')and (asientos = 'si') and (marca = 'Ford') and
(seguros = 'electricos') and (usb = si)
THEN
precio := 'alto'
ACTIONS
DISPLAY 'De acuerdo a las caractersticas que escogiste el precio del
auto es/n/n/n',
'ALTO/n'
END;
RULE 5
if (cilindraje = '4')and (asientos = 'si') and (marca = 'Ford') and
(seguros = 'electricos') and (usb = no)
THEN
precio := 'medio'
ACTIONS
DISPLAY 'De acuerdo a las caractersticas que escogiste el precio del
auto es/n/n/n',
'MEDIO/n'
END;
RULE 6
if (cilindraje = '4')and (asientos = 'si') and (marca = 'Ford') and
(seguros = 'manuales') and (radio = 'si') and (color = 'azul')
THEN
precio := 'bajo'
ACTIONS
DISPLAY 'De acuerdo a las caractersticas que escogiste el precio del
auto es/n/n/n',
'BAJO/n'
END;
RULE 7
'BAJO/n'
END;
RULE 13
if (cilindraje = '4')and (asientos = 'no') and (color = 'azul') and
(marca = 'Ford')
THEN
precio := 'medio'
ACTIONS
DISPLAY 'De acuerdo a las caractersticas que escogiste el precio del
auto es/n/n/n',
'MEDIO/n'
END;
RULE 14
if (cilindraje = '4')and (asientos = 'no') and (color = 'rojo') and
(tipoc = 'automatico')
THEN
precio := 'medio'
ACTIONS
DISPLAY 'De acuerdo a las caractersticas que escogiste el precio del
auto es/n/n/n',
'MEDIO/n'
END;
RULE 15
if (cilindraje = '4')and (asientos = 'no') and (color = 'rojo') and
(tipoc = 'estandar')
THEN
precio := 'medio'
ACTIONS
DISPLAY 'De acuerdo a las caractersticas que escogiste el precio del
auto es/n/n/n',
'MEDIO/n'
END;
RULE 16
if (cilindraje = '6')and (asientos = 'si') and (color = 'azul') and
(lujo = 'no')
THEN
precio := 'bajo'
ACTIONS
DISPLAY 'De acuerdo a las caractersticas que escogiste el precio del
auto es/n/n/n',
'BAJO/n'
END;
RULE 17
if (cilindraje = '6')and (asientos = 'si') and (color = 'azul') and
(lujo = 'si')
THEN
precio := 'alto'
ACTIONS
DISPLAY 'De acuerdo a las caractersticas que escogiste el precio del
auto es/n/n/n',
'ALTO/n'
END;
RULE 18
if (cilindraje = '6')and (asientos = 'si') and (color = 'rojo') and
(lujo = 'no')
THEN
precio := 'alto'
ACTIONS
DISPLAY 'De acuerdo a las caractersticas que escogiste el precio del
auto es/n/n/n',
'ALTO/n'
END;
RULE 19
if (cilindraje = '6')and (asientos = 'si') and (color = 'rojo') and
(lujo = 'si')
THEN
precio := 'alto'
ACTIONS
DISPLAY 'De acuerdo a las caractersticas que escogiste el precio del
auto es/n/n/n',
'ALTO/n'
END;
RULE 20
if (cilindraje = '6')and (asientos = 'no') and (rines = 'deportivo')
THEN
precio := 'medio'
ACTIONS
DISPLAY 'De acuerdo a las caractersticas que escogiste el precio del
auto es/n/n/n',
'MEDIO/n'
END;
RULE 21
if (cilindraje = '6')and (asientos = 'no') and (rines = 'normal') and
(color = 'azul')
THEN
precio := 'alto'
ACTIONS
DISPLAY 'De acuerdo a las caractersticas que escogiste el precio del
auto es/n/n/n',
'ALTO/n'
END;
RULE 22
if (cilindraje = '6')and (asientos = 'no') and (rines = 'normal') and
(color = 'rojo')
THEN
precio := 'medio'
ACTIONS
DISPLAY 'De acuerdo a las caractersticas que escogiste el precio del
auto es/n/n/n',
'MEDIO/n'
END;
RULE 23
if (cilindraje = '8')and (color = 'azul') and (puertas = '2') and
(lujo = 'si')
THEN
precio := 'alto'
ACTIONS
DISPLAY 'De acuerdo a las caractersticas que escogiste el precio del
auto es/n/n/n',
'ALTO/n'
END;
RULE 24
if (cilindraje = '8')and (color = 'azul') and (puertas = '2') and
(lujo = 'no')
THEN
precio := 'alto'
ACTIONS
DISPLAY 'De acuerdo a las caractersticas que escogiste el precio del
auto es/n/n/n',
'ALTO/n'
END;
RULE 25
if (cilindraje = '8')and (color = 'azul') and (puertas = '4')
THEN
precio := 'alto'
ACTIONS
DISPLAY 'De acuerdo a las caractersticas que escogiste el precio del
auto es/n/n/n',
'ALTO/n'
END;
RULE 26
if (cilindraje = '8')and (color = 'negro') and (tipoa = 'camioneta')
and (lujo = 'si')
THEN
precio := 'alto'
ACTIONS
DISPLAY 'De acuerdo a las caractersticas que escogiste el precio del
auto es/n/n/n',
'ALTO/n'
END;
RULE 27
if (cilindraje = '8')and (color = 'negro') and (tipoa = 'camioneta')
and (lujo = 'no')
THEN
precio := 'alto'
ACTIONS
DISPLAY 'De acuerdo a las caractersticas que escogiste el precio del
auto es/n/n/n',
'ALTO/n'
END;
RULE 28
if (cilindraje = '8')and (color = 'negro') and (tipoa = 'deportivo')
THEN
precio := 'alto'
ACTIONS
DISPLAY 'De acuerdo a las caractersticas que escogiste el precio del
auto es/n/n/n',
'ALTO/n'
END;
RULE 29
if (cilindraje = '8')and (color = 'negro') and (tipoa = 'carro') and
(puertas = '2')
THEN
precio := 'medio'
ACTIONS