24
SOLUCIONARIO EXAMEN FINAL INTELIGENCIA ARTIFICIAL 2013-II 1. Realice un árbol que represente un caso específico, precisando la nota que obtuvo cada alumno (2p). DIPLOMADO REDES GESTION CURSO A CURSO F CURSO E CURSO D CURSO C CURSO B Miguel Juan Ana Pablo Alex Pedro Ross Katy Diego Pamela Junior Marco Liz Alberto 12 11 5 12 15 6 15 12 18 14 11 8 12 18

inteligenciaartificial20132.files.wordpress.com€¦ · Web viewSOLUCIONARIO EXAMEN FINAL INTELIGENCIA ARTIFICIAL 2013-II. Realice un árbol que represente un caso específico, precisando

  • Upload
    lynhi

  • View
    219

  • Download
    0

Embed Size (px)

Citation preview

SOLUCIONARIO EXAMEN FINAL INTELIGENCIA ARTIFICIAL 2013-II

1. Realice un árbol que represente un caso específico, precisando la nota que obtuvo cada alumno (2p).

DIPLOMADO

REDESGESTION

CURSO A CURSO FCURSO ECURSO DCURSO CCURSO B

Miguel Juan Ana Pablo Alex Pedro Ross Katy Diego Pamela Junior Marco Liz Alberto

12 11 5 12 15 6 15 1218 14 11 8 12 18

2. Listar las alumnas que estudian diplomado en la FISI (3p)

CODIGO:diplomado(redes).diplomado(gestion).

lleva_el_curso(miguel,a).lleva_el_curso(marco,a).lleva_el_curso(diego,a).lleva_el_curso(ross,a).

lleva_el_curso(alex,b).lleva_el_curso(ana,b).lleva_el_curso(alberto,b).lleva_el_curso(rosa,b).

lleva_el_curso(junior,c).lleva_el_curso(pablo,c).lleva_el_curso(liz,c).lleva_el_curso(katy,c).

%cursos de redeslleva_el_curso(miguel,d).lleva_el_curso(marco,d).lleva_el_curso(yecenia,d).

lleva_el_curso(diego,e).lleva_el_curso(alex,e).lleva_el_curso(blanca,e).

lleva_el_curso(alberto,f).lleva_el_curso(paloma,f).lleva_el_curso(vanessa,f).lleva_el_curso(andrea,f).

es_curso_de(a,gestion).es_curso_de(b,gestion).es_curso_de(c,gestion).

es_curso_de(d,redes).es_curso_de(e,redes).es_curso_de(f,redes).

mujer(ross).mujer(katy).mujer(liz).mujer(rosa).mujer(blanca).mujer(andrea).mujer(vanessa).mujer(ana).mujer(paloma).mujer(yecenia).

CONSULTA:

alumnas_que_llevan_diplomado(X):-mujer(X), lleva_el_curso(X, Y), es_curso_de (Y, M), diplomado (M).

RESULTADO:

3. Listar los alumnos aprobados de REDES (5p)

CODIGO:alumno(X):-hombre(X).alumno(X):-mujer(X).

es_curso_de(a,gestion).es_curso_de(b,gestion).es_curso_de(c,gestion).es_curso_de(d,redes).es_curso_de(e,redes).

es_curso_de(f,redes).%cursos de gestionlleva_el_curso(miguel,a).lleva_el_curso(marco,a).lleva_el_curso(diego,a).lleva_el_curso(ross,a).

lleva_el_curso(alex,b).lleva_el_curso(ana,b).lleva_el_curso(alberto,b).lleva_el_curso(rosa,b).

lleva_el_curso(junior,c).lleva_el_curso(pablo,c).lleva_el_curso(liz,c).lleva_el_curso(katy,c).

%cursos de redeslleva_el_curso(miguel,d).lleva_el_curso(marco,d).lleva_el_curso(yecenia,d).lleva_el_curso(juan,d).

lleva_el_curso(diego,e).lleva_el_curso(alex,e).lleva_el_curso(blanca,e).

lleva_el_curso(alberto,f).lleva_el_curso(paloma,f).lleva_el_curso(vanessa,f).

lleva_el_curso(andrea,f).

%nota del 1 al 20notas(01,02).notas(02,03).notas(03,04).notas(04,05).notas(05,06).notas(06,07).notas(07,08).notas(08,09).notas(09,10).notas(10,11).notas(11,12).notas(12,13).notas(13,14).notas(14,15).notas(15,16).notas(16,17).notas(17,18).notas(18,19).notas(19,20).

%notastiene_nota(miguel,12).tiene_nota(marco,04).tiene_nota(juan,11).tiene_nota(alex,15).tiene_nota(luis,09).tiene_nota(ross,06).tiene_nota(katy,12).

tiene_nota(ana,19).tiene_nota(liz,12).tiene_nota(rosa,05).tiene_nota(pablo,12).tiene_nota(paloma,08).tiene_nota(junior,11).tiene_nota(yecenia,11).tiene_nota(alberto,18).tiene_nota(pedro,06).tiene_nota(diego,10).tiene_nota(blanca,07).tiene_nota(vanessa,16).tiene_nota(andrea,10).

CONSULTA:

sigs(X,Y):-notas(Y,X).sigs(X,Y):-notas(Y,Z),sigs(X,Z).

aprobo(E , C) :- setof(X ,sigs(X, E) , L) , length(L , R), C is R.alumnos_aprobados(X,Y):- es_curso_de(D,X),lleva_el_curso(Y,D),tiene_nota(Y,B),aprobo(B,C),C<10.

RESULTADO:

4. Si PEPE es alumno de REDES listar las CONOCIDAS de PEPE(7.5p)

CODIGO:diplomado(redes).diplomado(gestion).

curso(a).curso(b).curso(c).

curso(d).curso(e).curso(f).

alumno(X):-hombre(X).alumno(X):-mujer(X).

es_curso_de(a,gestion).es_curso_de(b,gestion).es_curso_de(c,gestion).

es_curso_de(d,redes).es_curso_de(e,redes).es_curso_de(f,redes).%cursos de gestionlleva_el_curso(miguel,a).

lleva_el_curso(marco,a).lleva_el_curso(diego,a).lleva_el_curso(ross,a).

lleva_el_curso(alex,b).lleva_el_curso(ana,b).lleva_el_curso(alberto,b).lleva_el_curso(rosa,b).

lleva_el_curso(junior,c).lleva_el_curso(pablo,c).lleva_el_curso(liz,c).lleva_el_curso(katy,c).

%cursos de redeslleva_el_curso(miguel,d).lleva_el_curso(marco,d).lleva_el_curso(yecenia,d).

lleva_el_curso(diego,e).lleva_el_curso(alex,e).lleva_el_curso(blanca,e).

lleva_el_curso(alberto,f).lleva_el_curso(paloma,f).lleva_el_curso(vanessa,f).

lleva_el_curso(andrea,f).

hombre(miguel).hombre(juan).hombre(marco).hombre(luis).hombre(alex).hombre(diego).hombre(junior).hombre(pablo).hombre(pedro).hombre(alberto).

mujer(ross).mujer(katy).mujer(liz).mujer(rosa).mujer(blanca).mujer(andrea).mujer(vanessa).mujer(ana).mujer(paloma).mujer(yecenia).

%notastiene_nota(miguel,12).tiene_nota(juan,11).tiene_nota(alex,15).tiene_nota(luis,9).tiene_nota(ross,6).tiene_nota(katy,12).tiene_nota(liz,12).tiene_nota(rosa,19).tiene_nota(pablo,12).tiene_nota(ross,15).tiene_nota(pamela,14).tiene_nota(junior,11).tiene_nota(yecenia,11).tiene_nota(alberto,18).tiene_nota(luis,18).tiene_nota(ross,10).tiene_nota(katy,18).tiene_nota(liz,6).tiene_nota(rosa,5).tiene_nota(ana,5).tiene_nota(pedro,6).tiene_nota(diego,12).tiene_nota(marco,14).tiene_nota(blanca,17).tiene_nota(vanessa,16).

CONSULTA:

conocidas(X,Y):-alumno(X),alumno(Y),gestion(X),redes(Y),mujer(X).

RESULTADO:

5. Si PEPE es alumno de REDES listar los COMPAÑEROS (Hombres) de PEPE (7.5p)

CODIGO :

diplomado(redes).

diplomado(gestion).

curso(a).

curso(b).

curso(c).

curso(d).

curso(e).

curso(f).

alumno(X):-hombre(X).

alumno(X):-mujer(X).

es_curso_de(a,gestion).

es_curso_de(b,gestion).

es_curso_de(c,gestion).

es_curso_de(d,redes).

es_curso_de(e,redes).

es_curso_de(f,redes).

%cursos de gestion

lleva_el_curso(miguel,a).

lleva_el_curso(marco,a).

lleva_el_curso(diego,a).

lleva_el_curso(ross,a).

lleva_el_curso(alex,b).

lleva_el_curso(ana,b).

lleva_el_curso(alberto,b).

lleva_el_curso(rosa,b).

lleva_el_curso(junior,c).

lleva_el_curso(pablo,c).

lleva_el_curso(liz,c).

lleva_el_curso(katy,c).

%cursos de redes

lleva_el_curso(miguel,d).

lleva_el_curso(marco,d).

lleva_el_curso(yecenia,d).

lleva_el_curso(diego,e).

lleva_el_curso(alex,e).

lleva_el_curso(blanca,e).

lleva_el_curso(alberto,f).

lleva_el_curso(paloma,f).

lleva_el_curso(vanessa,f).

lleva_el_curso(andrea,f).

hombre(miguel).

hombre(juan).

hombre(marco).

hombre(luis).

hombre(alex).

hombre(diego).

hombre(junior).

hombre(pablo).

hombre(pedro).

hombre(alberto).

mujer(ross).

mujer(katy).

mujer(liz).

mujer(rosa).

mujer(blanca).

mujer(andrea).

mujer(vanessa).

mujer(ana).

mujer(paloma).

mujer(yecenia).

%notas

tiene_nota(miguel,12).

tiene_nota(juan,11).

tiene_nota(alex,15).

tiene_nota(luis,9).

tiene_nota(ross,6).

tiene_nota(katy,12).

tiene_nota(liz,12).

tiene_nota(rosa,19).

tiene_nota(pablo,12).

tiene_nota(ross,15).

tiene_nota(pamela,14).

tiene_nota(junior,11).

tiene_nota(yecenia,11).

tiene_nota(alberto,18).

tiene_nota(luis,18).

tiene_nota(ross,10).

tiene_nota(katy,18).

tiene_nota(liz,6).

tiene_nota(rosa,5).

tiene_nota(ana,5).

tiene_nota(pedro,6).

tiene_nota(diego,12).

tiene_nota(marco,14).

tiene_nota(blanca,17).

tiene_nota(vanessa,16).

alumna_diplomada(X):-es_alumno(X),mujer(X),alumno_redes(X).

alumnas_que_llevan_diplomado(X):-mujer(X),lleva_el_curso(X,Y),es_curso_de(Y,M),diplomado(M).

nota(X,desaprobado) :- X >= 0, X < 10.

nota(X,aprobado) :- X >= 10.

gestion(X):-curso(Y),es_curso_de(Y,gestion),lleva_el_curso(X,Y).

redes(X):-curso(Y),es_curso_de(Y,redes),lleva_el_curso(X,Y).

alumnos_aprobados_redes(X):-alumno(X),tiene_nota(X,Y),lleva_el_curso(X,Z),curso(Z),es_curso_de(Z,redes),Y>10.

conocidas(X,Y):-alumno(X),alumno(Y),gestion(X),redes(Y),mujer(X).

CONSULTA:

compañero(X,Y):-alumno(X),alumno(Y),redes(X),redes(Y),hombre(X).

compañero(X,Y):-alumno(X),alumno(Y),redes(X),redes(Y),mujer(X).

compañero(X,Y):-alumno(X),alumno(Y),gestion(X),gestion(Y),hombre(X).

compañero(X,Y):-alumno(X),alumno(Y),gestion(X),gestion(Y),mujer(X).

RESULTADO:

MIGUEL ANGEL TORIBIO SARMIENTO 09200116