Artificial Intelligence

Download Report

Transcript Artificial Intelligence

Lógica de Predicados

Dr. Rogelio Dávila Pérez Profesor-Investigador Depto. de Tecnologías de la Información ITESM, Campus Guadalajara

Lógica de Predicados

I. Sintaxis 1. Vocabulario (a) (b) (c) (d) (e) (f) (g) (h) Constantes lógicas:  Conectores lógicos:  ,  ,  ,  , = Cuantificadores:  ,  Símbolos de puntuación: ‘(’ , ‘)’ , ‘,’ Símbolos predicados: R n , P m , Q s , … Símbolos de función: f n , g m , r s , … Símbolos constantes: a, b, c, … Variables individuales: x, y, z 2. Términos (i) (ii) (iii) Un símbolo constante es un término. Una variable individual es un término.

Si f n es un símbolo de función n-aria y, t 1 , …, t n entonces f n (t 1 , …, t n ) es un término.

son términos

Lógica de Predicados

3. Fórmulas bien-formadas (fbfs) (a) (b) (c) La constante  , llamada contradicción, es una fbf. Si R n es un símbolo predicado n-ario , y t 1 , …, t n entonces R n (t 1 , …, t n ) es una fbf.

Si  y  son fbfs, entonces  ,  ,  son términos y  también fbfs.

(d) (e) Si   es una fbf y x es una variable, entonces  x.

 (x) y x.

 (x) son ambas fbfs.

Nada fuera de lo indicado en (a)-(d) es una fbf.

Lógica de Predicados

II. Reglas de Inferencia (a) Todas las reglas de inferencia de la lógica proposicional son válidas en la lógica de predicados.

(b) Reglas del cuantificador Universal  -Intro  -Elim (Instanciación Universal)  (a) …  (a)  x.

  (x) (a)  x.(  (x)   (x)) Solo en el caso de que  (a) y  (a) no sean premisas, y ‘a’ no aparezca en las premisas.

Lógica de Predicados

(a) Reglas del cuantificador Existencial  -Intro  (a)  y.  (y)  -Elim  y.  (y)  (a) …   Sólo en el caso de que ‘a’ no aparezca en ‘  ’.

Identidades de la lógica de predicados

(a)       v  (b) Ley de Contraposición:          (c) Leyes Distributivas: (i)  v (    )  (  (ii)   (  v  )  v  )  (  v  ) (    ) v (    ) (e) Leyes de DeMorgan: (i)  (  v  )       (ii)  (    )    v   (f)   x.  (x) (g)   x.  (x)    x.   (x)  x.   (x)

Lógica de Predicados

 Traduzca las siguientes oraciones a lógica (a) Monica likes some of her students.

(b) Monica likes all her students.

(c) All men are created equal.

(d) Roses are red; violets are blue.

(e) Some freshmen are intelligent.

(f) All freshmen are intelligent.

(g) No freshmen are intelligent.

(h) One of the coats in the closet belongs to Sarah.

(i) Some Juniors date only Seniors.

(j) Not all birds can fly.

Lógica de Predicados

(k) Every elephant has a trunk.

(l) Adams is not married to anyone.

(m) No freshmen are not serious.

(n) Someone profited from the great depression.

(o) All fish except sharks are kind to children.

(p) Anyone with two or more spouses is a bigamist.

(q) John married Mary and she got pregnant.

(r) If all sophomores like Greek, then some freshmen do.

(s) Everyone loves somebody and no one loves everybody, or somebody loves everybody and someone loves nobody.

Lógica de Predicados

Ejemplos de argumentos

(a) (b) (c) The mother will die unless the doctor kills the child. If the doctor kills the child, the doctor will be taking life. If the mother dies, the doctor will be taking life. Therefore, the doctor will be taking life.

If the soil is suitable for carrots, then it is deep, sandy and free of stones. The soil is not suitable for linseed if it is sandy or a heavy clay. soil is not suitable for both carrots and linseed.

Therefore the Bank-notes all carry a metal strip. Anything with a metal strip can be detected by X-rays. Therefore , bank-notes can be detected by X-rays.

(d) All the birds are either chiff-chaffs or willow warblers. The birds are singing near the ground. Chiff-chaffs don’t sing near the ground. Therefore the birds are all willow-warblers.