0
I’m having a hard time making relationships. Follows the table:
homem(jose).
homem(ananias).
homem(helio).
homem(jurandir).
homem(valdir).
homem(delio).
homem(fabiano).
homem(willian).
homem(diego).
homem(mateus).
homem(henrique).
mulher(generosa).
mulher(tereza).
mulher(maria).
mulher(nilzete).
mulher(ildete).
mulher(jaqueline).
mulher(gislaine).
mulher(jaqueline).
mulher(livia).
mulher(isabela).
mulher(maria_e).
casado(jose, generosa).
casado(ananias, tereza).
casado(delio, maria).
casado(jurandir, nilzete).
casado(delio, ildete).
casado(willian, jaqueline).
casado(diego, gislaine).
progenitor(jose, helio).
progenitor(generosa, helio).
progenitor(jose, jurandir).
progenitor(generosa, jurandir).
progenitor(ananias, nilzete).
progenitor(tereza, nilzete).
progenitor(ananias, valdir).
progenitor(tereza, valdir).
progenitor(ananias, ildete).
progenitor(tereza, ildete).
progenitor(helio, fabiano).
progenitor(maria, fabiano).
progenitor(jurandir, willian).
progenitor(nilzete, willian).
progenitor(jurandir, gislaine).
progenitor(nilzete, gislaine).
progenitor(delio, jaqueline).
progenitor(ildete, jaqueline).
progenitor(willian, henrique).
progenitor(jaqueline, henrique).
progenitor(willian, livia).
progenitor(jaqueline, livia).
progenitor(diego, isabela).
progenitor(gislaine, isabela).
progenitor(diego, maria_e).
progenitor(gislaine, maria_e).
progenitor(fabiano, mateus).
I need the following relationship rule: Father, mother, paternal grandmother, siblings, brother, full siblings, father-in-law, uncle, grandson, ancestor relationship.
Father and mother I’m doing this way:
pai(X,Y) :- homem(Y), progenitor(Y,X).
mae(X,Y) :- mulher(Y), progenitor(Y,X).
But after returning the mother or father, there is a return false
.
Brothers I did it this way:
irmao(X,Y) :- progenitor(HOMEM,X), progenitor(HOMEM,Y), X \== Y.
But in this case only brother returns from father. I need a rule to return brother with at least one parent relationship.