jueves, 12 de septiembre de 2013

PowerLoom 1

Código PL de relaciones familiares:
(in-package "STELLA")

(defmodule "PL-KERNEL/PL-USER/FAMILIA")

(in-module "FAMILIA")

(clear-module "FAMILIA")

(in-dialect :KIF)

(defconcept Person)

(defconcept Male (?m Person)
:<=>(not (Female ?m)))

(defconcept Female (?f Person)
:<=>(not (Male ?f)))

(defrelation Spouse-of ((?spouse1 Person) (?spouse2 Person)))

(assert (forall (?x ?y) (<=> (Spouse-of ?y ?x) (Spouse-of ?x ?y))))
(assert (forall (?x ?y) (<=>(exists ?c (and (Parent-of ?x ?c) (Parent-of ?y ?c))) (Spouse-of ?x ?y))))

(defrelation Parent-of ((?p1 Person) (?p2 Person))
:<=> (not (= ?p1 ?p2)))

(defrelation Child-of ((?p1 Person) (?p2 Person))
:<=> (Parent-of ?p2 ?p1))

(defrelation Son-of ((?p1 Person) (?p2 Person))
:<=> (and (Child-of ?p1 ?p2) (Male ?p1)))

(defrelation Daughter-of ((?p1 Person) (?p2 Person))
:<=> (and (Child-of ?p1 ?p2) (Female ?p1)))

(defrelation Mother-of ((?m Person) (?c Person))
:<=> (and (Female ?m) (Parent-of ?m ?c)))

(defrelation Father-of ((?h Person) (?c Person))
:<=> (and (Male ?h) (Parent-of ?h ?c)))

(defrelation Husband-of ((?h Person) (?w Person))
:<=> (and (Male ?h) (Spouse-of ?h ?w)))

(defrelation Wife-of ((?w Person) (?h Person))
:<=> (and (Female ?w) (Spouse-of ?w ?h)))

(defrelation Grandparent-of ((?g Person) (?c Person))
:<=> (exists ?p (and (Parent-of ?g ?p) (Parent-of ?p ?c))))

(defrelation Granny-of ((?m Person) (?c Person))
:<=> (and (Female ?m) (Grandparent-of ?m ?c)))

(defrelation Grandpa-of ((?h Person) (?c Person))
:<=> (and (Male ?h) (Grandparent-of ?h ?c)))

(defrelation Sibling-of ((?x Person) (?y Person))
:<=> (and (exists ?p (and (Parent-of ?p ?x) (Parent-of ?p ?y) (not (= ?x ?y))))))

(defrelation Brother-of ((?h Person) (?c Person))
:<=> (and (Male ?h) (Sibling-of ?h ?c)))

(defrelation Sister-of ((?m Person) (?c Person))
:<=> (and (Female ?m) (Sibling-of ?m ?c)))

(defrelation Uncle-of ((?t Person) (?c Person))
:<=> (exist ?p (and (Parent-of ?p ?c) (Brother-of ?t ?p))))

(defrelation Aunt-of ((?t Person) (?c Person))
:<=> (exist ?p (and (Parent-of ?p ?c) (Sister-of ?t ?p))))

(defrelation Primo-of ((?o Person) (?c Person))
:<=> (and (exist ?t (and (or (Uncle-of ?t ?c) (Aunt-of ?t ?c)) (Parent-of ?t ?o))) (Male ?o)))

(defrelation Prima-of ((?a Person) (?c Person))
:<=> (and (exist ?t (and (or (Uncle-of ?t ?c) (Aunt-of ?t ?c)) (Parent-of ?t ?a))) (Female ?a)))

(defrelation Cuñado-of ((?h Person) (?c Person))
:<=> (exists ?m (or (and (Spouse-of ?m ?c) (Brother-of ?h ?m)) (and (Sister-of ?m ?c) (Husband-of ?h ?m)))))

(defrelation Cuñada-of ((?m Person) (?c Person))
:<=> (exists ?h (or (and (Spouse-of ?h ?c) (Brother-of ?m ?h)) (and (Sister-of ?h ?c) (Husband-of ?m ?h)))))

(defrelation Suegro-of ((?s Person) (?c Person))
:<=> (exists ?p (and (Spouse-of ?p ?c) (Father-of ?s ?p))))

(defrelation Suegra-of ((?s Person) (?c Person))
:<=> (exists ?p (and (Spouse-of ?p ?c) (Mother-of ?s ?p))))

(defrelation Concuño-of ((?o Person) (?c Person))
:<=> (exists (?p ?q) (and (Spouse-of ?c ?p) (Sibling-of ?p ?q) (Husband-of ?o ?q))))

(defrelation Concuña-of ((?a Person) (?c Person))
:<=> (exists (?p ?q) (and (Spouse-of ?c ?p) (Sibling-of ?p ?q) (Wife-of ?a ?q))))

(defrelation Consuegro-of ((?o Person) (?c Person))
:<=> (exists (?p ?q) (and (Parent-of ?c ?p) (Spouse-of ?p ?q) (Father-of ?o ?q))))

(defrelation Consuegra-of ((?a Person) (?c Person))
:<=> (exists (?p ?q) (and (Parent-of ?c ?p) (Spouse-of ?p ?q) (Mother-of ?a ?q))))

(defrelation Nietx-of ((?x Person) (?c Person))
:<=> (exists ?p (and (Parent-of ?c ?p) (Parent-of ?p ?x))))

(defrelation Nieto-of ((?o Person) (?c Person))
:<=> (and (Male ?o) (Nietx-of ?o ?c)))

(defrelation Nieta-of ((?a Person) (?c Person))
:<=> (and (Female ?a) (Nietx-of ?a ?c)))

(defrelation Bisnieto-of ((?o Person) (?c Person))
:<=> (exists ?p (and (Parent-of ?c ?p) (Nieto-of ?o ?p))))

(defrelation Bisnieta-of ((?a Person) (?c Person))
:<=> (exists ?p (and (Parent-of ?c ?p) (Nieta-of ?a ?p))))

(defrelation Sobrinx-of ((?s Person) (?p Person))
:<=> (exists ?x (and (Sibling-of ?x ?p) (Parent-of ?x ?s))))

(defrelation Sobrina-of ((?s Person) (?p Person))
:<=> (and (Female ?s) (Sobrinx-of ?s ?p)))

(defrelation Sobrino-of ((?s Person) (?p Person))
:<=> (and (Male ?s) (Sobrinx-of ?s ?p)))





;;;(assert (forall (?x ?y) (exists ?z (<= (and (Sibling-of ?x ?y) (Sibling-of ?x ?z)) (Sibling-of ?y ?z)))));;;
;;;(assert (forall (?x ?y) (exists ?p (=> (and (Sibling-of ?x ?y) (Parent-of ?p ?x)) (Parent-of ?p ?y)))));;;
;;;(assert (forall (?x ?y ?z) (<=> (and (Mother-of ?x ?z) (Mother-of ?y ?z)) (= ?x ?y))));;;
;;;(assert (forall (?x ?y ?z) (<=> (and (Father-of ?x ?z) (Father-of ?y ?z)) (= ?x ?y))));;;






(assert (Male Miguel))

(assert (Male Alejandro))

(assert (Male Fernando))

(assert (Female Carmen))

(assert (Male Alberto))

(assert (Male Marcos))

(assert (Female María))

(assert (Male Tomás))

(assert (Female Lucía))

(assert (Female Berta))

(assert (Female Patricia))


(assert (or (Parent-of Miguel Alejandro) (Parent-of Alejandro Miguel)))
(assert (exists (?hermano Person) (Brother-of Fernando ?hermano)))
(assert (forall (?x ?y) (=> (and (Brother-of Fernando ?x) (Brother-of Fernando ?y)) (= ?x ?y))))
(assert (Sibling-of Alejandro Carmen))
(assert (exists (?madre) (and (Mother-of ?madre Marcos) (Father-of Alberto ?madre))))
(assert (exists (?h1 ?h2) (and (Child-of ?h1 María) (Child-of ?h2 María))))
(assert (range-cardinality Parent-of María 2))
(assert (exists (?h1 ?h2) (and (Child-of ?h1 Carmen) (Child-of ?h2 Carmen))))
(assert (range-cardinality Parent-of Carmen 2))
(assert (exists (?h1 ?h2) (and (Child-of ?h1 Alberto) (Child-of ?h2 Alberto))))
(assert (range-cardinality Parent-of Alberto 2))
(assert (Cuñado-of Tomás Lucía))
(assert (exists (?hermana ?hermano) (and (Sister-of ?hermana Berta) (and (Brother-of ?hermano ?hermana) (Brother-of ?hermano Berta)))))
(assert (Sobrinx-of Patricia Carmen))



(retrieve all ?p (and (Person ?p) (Parent-of Alberto ?p)))
(retrieve all ?p (and (Person ?p) (Parent-of Alejandro ?p)))
(retrieve all ?p (and (Person ?p) (Parent-of Miguel ?p)))
(retrieve all ?p (and (Person ?p) (Parent-of Fernando ?p)))
(retrieve all ?p (and (Person ?p) (Parent-of Marcos ?p)))
(retrieve all ?p (and (Person ?p) (Parent-of María ?p)))
(retrieve all ?p (and (Person ?p) (Parent-of Carmen ?p)))
(retrieve all ?p (and (Person ?p) (Parent-of Tomás ?p)))
(retrieve all ?p (and (Person ?p) (Parent-of Lucía ?p)))
(retrieve all ?p (and (Person ?p) (Parent-of Patricia ?p)))
(retrieve all ?p (and (Person ?p) (Parent-of Berta ?p)))
(retrieve all ?p (and (Person ?p) (Grandpa-of Alberto ?p)))

Actividades 2 y 3
Asserts
(assert (Male Miguel))
(assert (Male Alejandro))
(assert (Male Fernando))
(assert (Female Carmen))
(assert (Male Alberto))
(assert (Male Marcos))
(assert (Female María))
(assert (Male Tomás))
(assert (Female Lucía))
(assert (Female Berta))
(assert (Female Patricia))

(assert (or (Parent-of Miguel Alejandro) (Parent-of Alejandro Miguel)))
(assert (exists (?hermano Person) (Brother-of Fernando ?hermano)))
(assert (forall (?x ?y) (=> (and (Brother-of Fernando ?x) (Brother-of Fernando ?y)) (= ?x ?y))))
(assert (Sibling-of Alejandro Carmen))
(assert (exists (?madre) (and (Mother-of ?madre Marcos) (Father-of Alberto ?madre))))
(assert (exists (?h1 ?h2) (and (Child-of ?h1 María) (Child-of ?h2 María))))
(assert (range-cardinality Parent-of María 2))
(assert (exists (?h1 ?h2) (and (Child-of ?h1 Carmen) (Child-of ?h2 Carmen))))
(assert (range-cardinality Parent-of Carmen 2))
(assert (exists (?h1 ?h2) (and (Child-of ?h1 Alberto) (Child-of ?h2 Alberto))))
(assert (range-cardinality Parent-of Alberto 2))
(assert (Cuñado-of Tomás Lucía))
(assert (exists (?hermana ?hermano) (and (Sister-of ?hermana Berta) (and (Brother-of ?hermano ?hermana) (Brother-of ?hermano Berta)))))
(assert (Sobrinx-of Patricia Carmen))

Queries
(retrieve all ?p (and (Person ?p) (Parent-of Alberto ?p)))
(retrieve all ?p (and (Person ?p) (Parent-of Alejandro ?p)))
(retrieve all ?p (and (Person ?p) (Parent-of Miguel ?p)))
(retrieve all ?p (and (Person ?p) (Parent-of Fernando ?p)))
(retrieve all ?p (and (Person ?p) (Parent-of Marcos ?p)))
(retrieve all ?p (and (Person ?p) (Parent-of María ?p)))
(retrieve all ?p (and (Person ?p) (Parent-of Carmen ?p)))
(retrieve all ?p (and (Person ?p) (Parent-of Tomás ?p)))
(retrieve all ?p (and (Person ?p) (Parent-of Lucía ?p)))
(retrieve all ?p (and (Person ?p) (Parent-of Patricia ?p)))
(retrieve all ?p (and (Person ?p) (Parent-of Berta ?p)))
(retrieve all ?p (and (Person ?p) (Grandpa-of Alberto ?p)))


Actividad 4


(in-package "STELLA")

(defmodule "PL-KERNEL/PL-USER/EINSTEIN")

(in-module "EINSTEIN")

(clear-module "EINSTEIN")

(in-dialect :KIF)

(defconcept Color)

(assert (Color blanca))

(assert (Color amarilla))

(assert (Color roja))

(assert (Color verde))

(assert (Color azul))


(defconcept Casa)

(assert (Casa uno))

(assert (Casa dos))

(assert (Casa tres))

(assert (Casa cuatro))

(assert (Casa cinco))


(defconcept Cigarro)

(assert (Cigarro PallMall))

(assert (Cigarro Bluemaster))

(assert (Cigarro Dunhill))

(assert (Cigarro Blend))

(assert (Cigarro Prince))


(defconcept Bebida)

(assert (Bebida cerveza))

(assert (Bebida agua))

(assert (Bebida leche))

(assert (Bebida cafe))

(assert (Bebida te))


(defconcept Mascota)

(assert (Mascota perro))

(assert (Mascota pajaros))

(assert (Mascota gatos))

(assert (Mascota caballos))

(assert (Mascota pez))


(defconcept Nacionalidad)

(assert (Nacionalidad noruego))

(assert (Nacionalidad ingles))

(assert (Nacionalidad danes))

(assert (Nacionalidad sueco))

(assert (Nacionalidad aleman))


(defrelation Casa-para-Nacionalidad ((?c Casa) (?n Nacionalidad)))

(defrelation Nacionalidad-para-Casa ((?n Nacionalidad) (?c Casa)))

(assert (inverse Casa-para-Nacionalidad Nacionalidad-para-Casa))

(assert (forall (?i) (= (range-cardinality Nacionalidad-para-Casa ?i) (1))))

(assert (forall (?i) (= (range-cardinality Casa-para-Nacionalidad ?i) (1))))


(defrelation Mascota-de-Casa ((?m Mascota) (?c Casa)))

(defrelation Casa-de-Mascota ((?c Casa) (?m Mascota)))

(assert (inverse Mascota-de-Casa Casa-de-Mascota))

(assert (forall (?i) (= (range-cardinality Mascota-de-Casa ?i) (1))))

(assert (forall (?i) (= (range-cardinality Casa-de-Mascota ?i) (1))))


(defrelation Bebida-de-Casa ((?b Bebida) (?c Casa)))

(defrelation Casa-de-Bebida ((?c Casa) (?b Bebida)))

(assert (inverse Bebida-de-Casa Casa-de-Bebida))

(assert (range-cardinality Bebida-de-Casa Casa 1))

(assert (range-cardinality Casa-de-Bebida Bebida 1))

(assert (forall (?i) (= (range-cardinality Bebida-de-Casa ?i) (1))))

(assert (forall (?i) (= (range-cardinality Casa-de-Bebida ?i) (1))))


(defrelation Cigarro-de-Casa ((?g Cigarro) (?c Casa)))

(defrelation Casa-de-Cigarro ((?c Casa) (?g Cigarro)))

(assert (inverse Cigarro-de-Casa Casa-de-Cigarro))

(assert (forall (?i) (= (range-cardinality Cigarro-de-Casa ?i) (1))))

(assert (forall (?i) (= (range-cardinality Casa-de-Cigarro ?i) (1))))


(defrelation Color-de-Casa ((?l Color) (?c Casa)))

(defrelation Casa-de-Color ((?c Casa) (?l Color)))

(assert (inverse Color-de-Casa Casa-de-Color))

(assert (forall (?i) (= (range-cardinality Color-de-Casa ?i) (1))))

(assert (forall (?i) (= (range-cardinality Casa-de-Color ?i) (1))))



(defrelation next ((?c2 Casa) (?c1 Casa)))

(defrelation junto-a ((?c1 Casa) (?c2 Casa))
:<=> (or (next ?c1 ?c2) (next ?c2 ?c1)))

(assert (next dos uno))

(assert (next tres dos))

(assert (next cuatro tres))

(assert (next cinco cuatro))

;;;(assert (range-cardinality Casa-de-Color Color 1));;;

Actividad 5
1. ¿Qué relación tiene conmigo Lola si su madre fue la única hija de mi madre?

(assert (Female Lola))
(assert (Female MamáDeLola))
(assert (Female MiMamá))
(assert (Male Yo))

(assert (Mother-of MamáDeLola Lola))
(assert (Mother-of MiMamá Yo))
(assert (Daughter-of MamáDeLola MiMamá))
(assert (forall (?x) (=> (Daughter-of ?x ?MiMamá) (= ?x MamáDeLola))))

(ask (Uncle-of Yo Lola))

2. ¿Qué es de mí el abuelo paterno de la hija de mi único hermano?
(assert (Male Hermano))
(assert (Female Hija))
(assert (Male Abuelo))
(assert (Male Yo))

(assert (Brother-of Hermano Yo))
(assert (Daughter-of Hija Hermano))
(assert (Grandpa-of Abuelo Hija))

(ask (Father-of Abuelo Yo))

3. Tito es tío de Tota, Tota es hermana de Toña, Toña es madre de Pepe. ¿Qué es Tito de Pepe?
(defrelation TíoAbuelo-de ((?g Person) (?c Person))
:<=> (exists ?p (and (Uncle-of ?g ?p) (Parent-of ?p ?c))))

(assert (Male Tito))
(assert (Female Tota))
(assert (Female Toña))
(assert (Male Pepe))

(assert (Uncle-of Tito Tota))
(assert (Sister-of Tota Toña))
(assert (Mother-of Toña Pepe))

(ask (TíoAbuelo-de Tito Pepe))

4. ¿Quién es el único nieto del padre del padre de Jorge?
(assert (Male Jorge))
(assert (Male Padre))
(assert (Male PadreDelPadre))

(assert (Father-of Padre Jorge))
(assert (Father-of PadreDelPadre Padre))

(retrieve all ?p (Grandpa-of Jorge ?p))

5. ¿Qué parentesco tiene conmigo un joven que es el hijo de la esposa del único hijo de mi abuela?
(assert (Female Abuela))
(assert (Male ÚnicoHijo))
(assert (Female Esposa))
(assert (Male Hijo))
(assert (Female Yo))

(assert (Mother-of Abuela ÚnicoHijo))
(assert (forall (?x) (=> (Mother-of Abuela ?x) (= ?x ÚnicoHijo))))
(assert (Granny-of Abuela Yo))
(assert (Wife-of Esposa ÚnicoHijo))
(assert (Mother-of Esposa Hijo))

(ask (Brother-of Hijo Yo))   

martes, 3 de septiembre de 2013

Del español a lógica de primer orden

Rafael Alcaraz
Montserrat Romero
Luis S. Gatica

Símbolos de apoyo: ∃ ˄ ˅ ¬ 

Ejercicios de Lógica de Primer Orden

No todos los estudiantes toman Inteligencia Artificial y Sistemas Distribuidos
e Estudiante(e) ˄ (¬Cursa(e, InteligenciaArtificial) ˅ ¬Cursa(e, SistemasDistribuidos))

Solo un estudiante reprobó Inteligencia Artificial
e∀a Reprobó(a,InteligenciaArtificial) → a=e

Solo un estudiante reprobó tanto Inteligencia Artificial como Sistemas Distribuidos
e∀a (Reprobó(a,InteligenciaArtificial) ˄ Reprobó(a,SistemasDistribuidos)) → a=e

La mejor calificación en Inteligencia Artificial fue más alta que la primera calificación en Sistemas Distribuidos
MejorCalificación(InteligenciaArtificial) > PrimeraCalificación(SistemasDistribuidos)

Cualquier persona a quien le caigan mal los vegetarianos es lista
x,y (Persona(x) ˄ (Vegetariano(y) → CaerMal(y, x))) → Listo(x)
(O en una formulación más sencilla, posiblemente útil dependiendo de lo que nos interese)
x CaenMalVegetarianos(x) → Listo(x)

Nadie quiere a un vegetariano listo
x,y (Persona(x) ˄ Vegetariano(y) ˄ Listo(y)) → ¬Quiere(x, y)

Existe una mujer que quiere a todos los hombres que no son vegetarianos
m∀h Mujer(m) ˄ ((Hombre(h) ˄ ¬Vegetariano(h))  ˄ Quiere(m, h))

Existe un barbero en la ciudad que rasura a todos los hombres que no se rasuran solos.
b∀h barbero(b) ˄ enLaCiudad(b) ˄ (¬rasura(x,x) → rasura(b,x))

Reconocemos algunas de esas palabras de la paradoja del barbero de Russell, que puede representarse de esta manera:

Wikipedia:




Nadie quiere al profesor a menos que el profesor sea inteligente
x,y (Profesor(x) ˄ Persona(y) ˄ Quiere(y, x)) → Inteligente(x)

Los políticos pueden engañar a algunas personas todo el tiempo y pueden engañar a todas las personas algún tiempo pero no pueden engañar a todas las personas todo el tiempo
o Político(o) ((∃p∀t engaña(o,p,t)) ˄ (∃t∀p engaña(o,p,t)) ˄ ¬(∀p∀t engaña(o,p,t)))

domingo, 1 de septiembre de 2013

La familia: lógica de primer orden en un mundo heteronormativo

Rafael Alcaraz
Montserrat Romero
Luis S. Gatica

Solución hecha en clase:
∀ x Male(x) ⇔ ¬ Female (x)
∀ x,y Spouse(x,y) ⇔ Spouse (y,x)
Madre: ∀ m,c Mother(c) = m ⇔ Female (m) ^ Parent(m,c)
Esposo: ∀ h,w Husband(h,w)⇔ Male(h) ^ Spouse(h,w)
Abuelx: ∀ g,c Grandparent (g,c) ⇔ ∃ p Parent(g,p) ^ Parent(p,c)
Hermanx: ∀ x,y Sibling (x,y) ⇔ x != y ∃ p Parent(p,x) ^ Parent(p,y)
Hermano: ∀ h,c Brother(c) = h ⇔ Male(h) ^ Sibling(h,c)
Hermana: ∀ m,c Sister(c) = m ⇔ Female(m) ^ Sibling(m,c)
Padre: ∀ h,c Father(c) = h ⇔ Male (h) ^ Parent(h,c)
Esposa: ∀ h,w Wife(w,h) ⇔ Female(w) ^ Spouse(w,h)
Abuela: ∀ m,c Granny(c) = m ⇔ Female(m) ^ Grandparent(m,c)
Abuelo: ∀ h,c Grandpa(c) = h ⇔ Male(h) ^ Grandparent(h,c)
Tío: ∀ t,c Uncle(t,c) ⇔ ∃ p Parent(p,c) ^ Brother(t,p)
Tía: ∀ t,c Aunt (t,c) ⇔ ∃ p Parent(p,c) ^ Sister(t,p)
Primo: ∀ o,c Primo(o,c) ⇔ (∃ t (Uncle(t,c) v Aunt(t,c)) ^ Parent(t,o)) ^ Male(o)
Prima: ∀ a,c Prima(a,c) ⇔ (∃ t (Uncle(t,c) v Aunt(t,c)) ^ Parent(t,a)) ^ Female(a)
Hijo: ∀ h,c Son(c) = h ⇔ Male(h) ^ Child(h,c)
Hija: ∀ m,c Daughter(c) = m ⇔ Female(m) ^ Child(m,c)
Cuñado: ∀ h,c Cuñado(h,c) ⇔ ∃ m (Spouse(m,c) ^ Brother(h,m)) v (Sister(m,c) ^ Husband(h,m))
Cuñada: ∀ m,c Cuñada(m,c) ⇔ ∃ h (Spouse(h,c) ^ Sister(m,h)) v (Brother(h,c) ^ Wife(m,h))
Suegro: ∀ s,c Suegro(s,c) ⇔ ∃ p Spouse(p,c) ^ Father(s,p)
Suegra: ∀ s,c Suegra(s,c) ⇔ ∃ p Spouse(p,c) ^ Mother(s,p)
Concuño: ∀ o,c Concuño(o,c) ⇔ ∃ p,q Spouse(c,p) ^ Sibling(p,q) ^ Husband(o,q)
Concuña: ∀ a,c Concuña(a,c) ⇔∃ p,q Spouse(c,p) ^ Sibling(p,q) ^ Wife(a,q)
Consuegra: ∀ a,c Consuegra(a,c) ⇔ ∃ p,q Parent(c,p) ^ Spouse(p,q) ^ Mother(a,q)
Consuegro: ∀ o,c Consuegro(o,c) ⇔ ∃ p,q Parent(c,p) ^ Spouse(p,q) ^ Father(o,q)
Nietx: ∀ x,c Nietx(x,c) ⇔ ∃ p Parent(c,p) ^ Parent(p,x)
Nieta: ∀ a,c Nieta(c) = a ⇔ Female(a) ^ Nietx(a,c)
Nieto: ∀ o,c Nieto(c) = o ⇔ Male(o) ^ Nietx(o,c)
Bisnieta: ∀ a,c Bisnieta(a,c) ⇔ ∃ p Parent(c,p) ^ Nieta(a,p)
Bisnieto: ∀ o,c Bisnieto(o,c) ⇔ ∃ p Parent(c,p) ^ Nieta(o,p)


Reglas -distintas- de la versión modificada (para que exista congruencia en el uso de los siguientes predicados):
Madre: ∀ m,c Mother(m,c) ⇔ Female (m) ^ Parent(m,c)
Hermano: ∀ h,c Brother(h,c) ⇔ Male(h) ^ Sibling(h,c)
Hermana: ∀ m,c Sister(m,c) ⇔ Female(m) ^ Sibling(m,c)

Padre: ∀ h,c Father(h,c) ⇔ Male (h) ^ Parent(h,c)
Abuela: ∀ m,c Granny(m,c) ⇔ Female(m) ^ Grandparent(m,c)
Abuelo: ∀ h,c Grandpa(h,c) ⇔ Male(h) ^ Grandparent(h,c)
Hijo: ∀ h,c Son(h,c) ⇔ Male(h) ^ Child(h,c)
Hija: ∀ m,c Daughter(m,c) ⇔ Female(m) ^ Child(m,c)
Nieta: ∀ a,c Nieta(a, c) ⇔ Female(a) ^ Nietx(a,c)
Nieto: ∀ o,c Nieto(o, c) ⇔ Male(o) ^ Nietx(o,c)