title: Prolog cousin once removed and half sister/brother rules
body: <p>Am working on a prolog genealogy project and cannot figure out how to make the rules for cousin once removed and half sister/brother rules. Below is what I have and cannot get it to work. Any help or suggestions would be appreciated. I have placed in bold what I have tried. I'm sure its something simple in the way I'm trying to code it.I just cannot figure it out. </p>
  
  <pre><code>person(marc,male).
  person(faith,female).
  person(alan,male).
  person(kim,female).
  person(missy,female).
  person(eric,male).
  person(charles,male).
  person(eleanor,female).
  person(roland,male).
  person(corey,male).
  person(amy,female).
  person(tyler,male).
  person(matty,male).
  person(kaydi,female).
  person(jenna,female).
  person(allison,female).
  person(emma,female).
  person(hayley,female).
  person(jaylin,female).
  person(lukus,male).
  person(brendon,male).
  person(bradley,male).
  person(tylerh,male).
  person(dayna,female).
  person(victor,male).
  person(jacoby,male).
  person(javi,male).
  person(jordan,male).
  person(jaxson,male).
  person(kenzie,female).
  person(richard,male).
  person(reggie,male).
  person(reggiejr,male).
  person(beverly,female).
  person(floyd,male).
  person(marjorie,female).
  person(kevin,male).
  
  
  parent(marc,alan).
  parent(faith,alan).
  parent(charles,marc).
  parent(charles,kim).
  parent(charles,missy).
  parent(charles,eric).
  parent(eleanor,marc).
  parent(eleanor,kim).
  parent(eleanor,missy).
  parent(eleanor,eric).
  parent(eric,matty).
  parent(eric,tyler).
  parent(eric,kaydi).
  parent(amy,matty).
  parent(amy,tyler).
  parent(amy,kaydi).
  parent(missy,jordan).
  parent(missy,jaxson).
  parent(missy,kenzie).
  parent(richard,jordan).
  parent(corey,kenzie).
  parent(corey,jaxson).
  parent(kim,allison).
  parent(kim,jenna).
  parent(kim,emma).
  parent(kim,jaylin).
  parent(kim,hayley).
  parent(kim,dayna).
  parent(roland,allison).
  parent(roland,jenna).
  parent(roland,emma).
  parent(roland,jaylin).
  parent(roland,hayley).
  parent(roland,dayna).
  parent(dayna,javi).
  parent(dayna,jacoby).
  parent(victor,javi).
  parent(victor,jacoby).
  parent(jenna,bradley).
  parent(brendon,bradley).
  parent(tylerh,lukus).
  parent(allison,lukus).
  parent(reggie,reggiejr).
  parent(beverly,reggiejr).
  parent(floyd,beverly).
  parent(marjorie,beverly).
  parent(reggiejr,kevin).
  parent(floyd,eleanor).
  parent(marjorie,eleanor).
  
  
  married(marc,faith).
  married(charles,eleanor).
  married(kim,roland).
  married(eric,amy).
  married(missy,corey).
  married(dayna,victor).
  married(allison,tylerh).
  married(marjorie,floyd).
  married(beverly,reggie).
  
  
  
  
  
  father(X, Y)             :-   parent(X, Y),  person(X,male).
  mother(X, Y)             :-   parent(X, Y),  person(female,Y).
  
  son(X, Y)                :-  parent(Y,X),    person(X,male).
  daughter(X, Y)           :-  parent(X,Y),    person(Y,female).
  grandparent(X, Z)        :-  parent(X, Y),  parent(Y, Z).
  grandfather(X, Z)        :-  grandparent(X, Z),  person(X,male).
  grandmother(X, Z)        :-  grandparent(X, Z),  person(female,Y).
  grandson(X, Z)           :-  grandchild(X, Z),  person(X,male).
  granddaughter(Y, Z)      :-  grandchild(Y, Z),  person(Y,female).
  grandchild(X, Z)         :-  grandparent(Z, X).
  sibling(X,Y)             :- parent(Z,X),    parent(Z,Y).  
  brother(Y, X)            :- sibling(Y,X),  person(X,male), not(X=Y).
  sister(X, Y)             :-  sibling(X, Y),  person(Y,female).       
  
  auntoruncle(X, W)        :-  sibling(X, Y), parent(Y, W).
  auntoruncle(X, Z)        :-  married(X,Y),  sibling(Y,W),    parent(W,Z).
  uncle(X, W)              :- auntoruncle(X, W),    person(X,male).
  aunt(X, W)               :- auntoruncle(X, W),     person(female,Y).
  cousin(X, Y)             :-  parent(Z, X),  auntoruncle(Z, Y), Y\=X.
  nieceornephew(X, Y)      :-  parent(Z, X),  sibling(Z, Y).
  nephew(X, Y)             :-  nieceornephew(X, Y), person(X,male).
  niece(X, Y)              :-  nieceornephew(Y, X), person(Y,female).
  greatgrandparent(X, Z)   :-  parent(X, Y),  grandparent(Y, Z).
  greatgrandfather(X, Z)   :-  greatgrandparent(X, Z),  person(X,male).
  greatgrandmother(X, Z)   :-  greatgrandparent(X, Z),  person(female,Y).
  greatgrandchild(X, Z)    :-  child(X, Y),   grandchild(X, Z).
  greatgrandson(X, Z)      :-  greatgrandchild(X, Z), person(X,male).
  greatgranddaughter(X, Z) :-  greatgrandchild(X, Z),  person(female,Y).
  married_to(X,Y) :- married(X,Y), not divorced(X,Y).
  whatgender(X,Y)     :- person(X,Y). 
  
  **child(X, Y)              :-  parent(Y, X).
  cousinonceremoved(X, Y)  :-  cousin(Z, Y), child(X, Z).
  halfsibling(X,Y) :- parent(Z,X), parent(Z,Y), parent(P,X), \+parent(P,Y).
  halfbrother(X,Y) :- halfsibling(X,Y), male(X).
  halfsister(X,Y) :- halfsibling(X,Y), female(X).**
  </code></pre>
  
  <p><strong>strong text</strong></p>