father(donnie, donna). %donna is my aunt father(donnie, randy). %donnie is my grandpa father(donnie, mac). %mac is my uncle father(donnie, barney). %barney is my uncle father(donnie, nancy). %nancy is my aunt father(donnie, audrey). %audrey is my aunt father(randy, amy). %amy is my sister father(randy, liza). %liza is my sister father(randy, travis). %randy is my father father(mac, erin). %erin is my cousin father(mac, dustin). %dustin is my cousin father(barney, jani). %jani is my cousin father(barney, jodi). %jodi is my cousin father(rudy, sharon). %rudy is my grandpa father(rudy, pam). %pam is my aunt mother(ruth, sharon). %ruth is my grandma mother(ruth, pam). %pam is my aunt mother(pam, david). %david is my cousin mother(sharon, amy). %amy is my sister mother(sharon, liza). %liza is my sister mother(sharon, travis). %sharon is my mother mother(annie, donna). %donna is my aunt mother(annie, randy). %randy is my father mother(annie, mac). %mac is my uncle mother(annie, barney). %barney is my uncle mother(annie, nancy). %nancy is my aunt mother(annie, audrey). %audrey is my aunt mother(donna, troy). %troy is my cousin mother(nancy, kyla). %kyla is my cousin mother(nancy, annie). %annie is my cousin mother(nancy, dove). %dove is my cousin mother(nancy, daniel). %daniel is my cousin mother(audrey, alex). %alex is my cousin mother(audrey, brandon). %brandon is my cousin mother(audrey, courtney). %courtney is my cousin sibling(X, Y) :- father(Z, X), father(Z, Y). sibling(X, Y) :- mother(Z, X), mother(Z, Y). parent_of(X, Y) :- father(X, Y). parent_of(X, Y) :- mother(X, Y). write_list([]). write_list([H|T]) :- write_ln(H), write_list(T). cousin(X, Y) :- findall(Y, (parent_of(Z, X), parent_of(W, Y), sibling(Z, W), not(sibling(X, Y))), L), list_to_set(L, S), write_list(S).