Toggle navigation
?
users online
Logout
Open hangout
Open chat for current file
% KNOWLEDGE BASE % FACTS: % MALES male(abraham). male(clancy). male(mr_burns). male(homero). male(seymur_skinner). male(bart). male(milhouse). male(kang). male(santas_little_helper). male(snowball). % FEMALES female(mona). female(jacqueline). female(marge). female(paty). female(selma). female(edna_krabappel). female(lisa). female(maggie). % FATHERS father_of(abraham, homero). father_of(clancy, marge). father_of(clancy, paty). father_of(clancy, selma). father_of(homero, bart). father_of(homero, lisa). father_of(kang, maggie). % MOTHERS mother_of(mona, homero). mother_of(jacqueline, marge). mother_of(jacqueline, paty). mother_of(jacqueline, selma). mother_of(marge, bart). mother_of(marge, lisa). mother_of(marge, maggie). % RULES: % El ";" equivale al OR lógico % La "," equivale al AND lógico parent(X, Y) :- father_of(X, Y); mother_of(X, Y). child_of(X, Y) :- parent(Y, X). son_of(X, Y) :- child_of(X, Y), male(X). daughter_of(X, Y) :- child_of(X, Y), female(X). siblings(X, Y) :- parent(Z, X), parent(Z, Y), X \= Y. brother_of(X, Y) :- siblings(X, Y), male(X). sister_of(X, Y) :- siblings(X, Y), female(X). grandparent(X, Y) :- parent(X, Z), parent(Z, Y). grandpa(X, Y) :- grandparent(X, Y), male(X). grandma(X, Y) :- grandparent(X, Y), female(X). grandchild(X, Y) :- grandparent(Y, X). grandson(X, Y) :- grandchild(X, Y), male(X). granddaughter(X, Y) :- grandchild(X, Y), female(X). parent_siblings(X, Y) :- parent(Z, Y), siblings(Z, X), X \= Y. uncle_of(X, Y) :- parent_siblings(X, Y), male(X). aunt_of(X, Y) :- parent_siblings(X, Y), female(X).