(defrule parent (http://www.daml.org/2001/01/gedcom/gedcom#childIn ?child ?family) (http://www.daml.org/2001/01/gedcom/gedcom#spouseIn ?parent ?family) => (assert (http://www.daml.org/2001/01/gedcom/gedcom#parent ?child ?parent))) (defrule father (http://www.daml.org/2001/01/gedcom/gedcom#parent ?child ?parent) (http://www.daml.org/2001/01/gedcom/gedcom#sex ?parent "M") => (assert (http://www.daml.org/2001/01/gedcom/gedcom#father ?child ?parent))) (defrule mother (http://www.daml.org/2001/01/gedcom/gedcom#parent ?child ?parent) (http://www.daml.org/2001/01/gedcom/gedcom#sex ?parent "F") => (assert (http://www.daml.org/2001/01/gedcom/gedcom#mother ?child ?parent))) (defrule child (http://www.daml.org/2001/01/gedcom/gedcom#parent ?child ?parent) => (assert (http://www.daml.org/2001/01/gedcom/gedcom#child ?parent ?child))) (defrule son (http://www.daml.org/2001/01/gedcom/gedcom#child ?parent ?child) (http://www.daml.org/2001/01/gedcom/gedcom#sex ?child "M") => (assert (http://www.daml.org/2001/01/gedcom/gedcom#son ?parent ?child))) (defrule daughter (http://www.daml.org/2001/01/gedcom/gedcom#child ?parent ?child) (http://www.daml.org/2001/01/gedcom/gedcom#sex ?child "F") => (assert (http://www.daml.org/2001/01/gedcom/gedcom#daughter ?parent ?child))) (defrule grandparent (http://www.daml.org/2001/01/gedcom/gedcom#parent ?child ?parent) (http://www.daml.org/2001/01/gedcom/gedcom#parent ?parent ?grandparent) => (assert (http://www.daml.org/2001/01/gedcom/gedcom#grandparent ?child ?grandparent))) (defrule grandfather (http://www.daml.org/2001/01/gedcom/gedcom#grandparent ?child ?grandparent) (http://www.daml.org/2001/01/gedcom/gedcom#sex ?grandparent "M") => (assert (http://www.daml.org/2001/01/gedcom/gedcom#grandfather ?child ?grandparent))) (defrule grandmother (http://www.daml.org/2001/01/gedcom/gedcom#grandparent ?child ?grandparent) (http://www.daml.org/2001/01/gedcom/gedcom#sex ?grandparent "F") => (assert (http://www.daml.org/2001/01/gedcom/gedcom#grandmother ?child ?grandparent))) (defrule grandchild (http://www.daml.org/2001/01/gedcom/gedcom#grandparent ?child ?grandparent) => (assert (http://www.daml.org/2001/01/gedcom/gedcom#grandchild ?grandparent ?child))) (defrule grandson (http://www.daml.org/2001/01/gedcom/gedcom#grandparent ?child ?grandparent) (http://www.daml.org/2001/01/gedcom/gedcom#sex ?child "M") => (assert (http://www.daml.org/2001/01/gedcom/gedcom#grandson ?grandparent ?child))) (defrule granddaughter (http://www.daml.org/2001/01/gedcom/gedcom#grandparent ?child ?grandparent) (http://www.daml.org/2001/01/gedcom/gedcom#sex ?child "F") => (assert (http://www.daml.org/2001/01/gedcom/gedcom#granddaughter ?child ?grandparent))) (defrule sibling (http://www.daml.org/2001/01/gedcom/gedcom#childIn ?child1 ?family) (http://www.daml.org/2001/01/gedcom/gedcom#childIn ?child2 ?family) => (assert (http://www.daml.org/2001/01/gedcom/gedcom#sibling ?child1 ?child2))) (defrule siblingSymmetric (http://www.daml.org/2001/01/gedcom/gedcom#sibling ?child2 ?child1) => (assert (http://www.daml.org/2001/01/gedcom/gedcom#sibling ?child1 ?child2))) (defrule brother (http://www.daml.org/2001/01/gedcom/gedcom#sibling ?child ?sibling) (http://www.daml.org/2001/01/gedcom/gedcom#sex ?sibling "M") => (assert (http://www.daml.org/2001/01/gedcom/gedcom#brother ?child ?sibling))) (defrule sister (http://www.daml.org/2001/01/gedcom/gedcom#sibling ?child ?sibling) (http://www.daml.org/2001/01/gedcom/gedcom#sex ?sibling "F") => (assert (http://www.daml.org/2001/01/gedcom/gedcom#sister ?child ?sibling))) (defrule spouse (http://www.daml.org/2001/01/gedcom/gedcom#spouseIn ?spouse1 ?family) (http://www.daml.org/2001/01/gedcom/gedcom#spouseIn ?spouse2 ?family) => (assert (http://www.daml.org/2001/01/gedcom/gedcom#spouse ?spouse1 ?spouse2))) (defrule spouseSymmetric (http://www.daml.org/2001/01/gedcom/gedcom#spouse ?spouse2 ?spouse1) => (assert (http://www.daml.org/2001/01/gedcom/gedcom#spouse ?spouse1 ?spouse2))) (defrule husband (http://www.daml.org/2001/01/gedcom/gedcom#spouse ?spouse ?husband) (http://www.daml.org/2001/01/gedcom/gedcom#sex ?husband "M") => (assert (http://www.daml.org/2001/01/gedcom/gedcom#husband ?spouse ?husband))) (defrule wife (http://www.daml.org/2001/01/gedcom/gedcom#spouse ?spouse ?wife) (http://www.daml.org/2001/01/gedcom/gedcom#sex ?wife "F") => (assert (http://www.daml.org/2001/01/gedcom/gedcom#wife ?spouse ?wife))) (defrule uncle1 (http://www.daml.org/2001/01/gedcom/gedcom#parent ?child ?parent) (http://www.daml.org/2001/01/gedcom/gedcom#brother ?parent ?uncle) => (assert (http://www.daml.org/2001/01/gedcom/gedcom#uncle ?child ?uncle))) (defrule uncle2 (http://www.daml.org/2001/01/gedcom/gedcom#aunt ?child ?aunt) (http://www.daml.org/2001/01/gedcom/gedcom#spouse ?aunt ?uncle) => (assert (http://www.daml.org/2001/01/gedcom/gedcom#uncle ?child ?uncle))) (defrule aunt1 (http://www.daml.org/2001/01/gedcom/gedcom#parent ?child ?parent) (http://www.daml.org/2001/01/gedcom/gedcom#sister ?parent ?aunt) => (assert (http://www.daml.org/2001/01/gedcom/gedcom#aunt ?child ?aunt))) (defrule aunt2 (http://www.daml.org/2001/01/gedcom/gedcom#uncle ?child ?uncle) (http://www.daml.org/2001/01/gedcom/gedcom#spouse ?uncle ?aunt) => (assert (http://www.daml.org/2001/01/gedcom/gedcom#aunt ?child ?aunt))) (defrule niece (http://www.daml.org/2001/01/gedcom/gedcom#daughter ?parent ?child) (http://www.daml.org/2001/01/gedcom/gedcom#sibling ?parent ?sibling) => (assert (http://www.daml.org/2001/01/gedcom/gedcom#niece ?sibling ?child))) (defrule nephew (http://www.daml.org/2001/01/gedcom/gedcom#son ?parent ?child) (http://www.daml.org/2001/01/gedcom/gedcom#sibling ?parent ?sibling) => (assert (http://www.daml.org/2001/01/gedcom/gedcom#nephew ?sibling ?child))) (defrule firstCousin (http://www.daml.org/2001/01/gedcom/gedcom#parent ?cousin1 ?sibling1) (http://www.daml.org/2001/01/gedcom/gedcom#parent ?cousin2 ?sibling2) (http://www.daml.org/2001/01/gedcom/gedcom#sibling ?sibling1 ?sibling2) => (assert (http://www.daml.org/2001/01/gedcom/gedcom#firstCousin ?cousin1 ?cousin2))) (defrule ancestor1 (http://www.daml.org/2001/01/gedcom/gedcom#parent ?child ?parent) => (assert (http://www.daml.org/2001/01/gedcom/gedcom#ancestor ?child ?parent))) (defrule ancestor2 (http://www.daml.org/2001/01/gedcom/gedcom#parent ?child ?parent) (http://www.daml.org/2001/01/gedcom/gedcom#ancestor ?parent ?ancestor) => (assert (http://www.daml.org/2001/01/gedcom/gedcom#ancestor ?child ?ancestor))) (defrule descendent (http://www.daml.org/2001/01/gedcom/gedcom#ancestor ?child ?ancestor) => (assert (http://www.daml.org/2001/01/gedcom/gedcom#descendent ?ancestor ?child))) (defrule cousin (http://www.daml.org/2001/01/gedcom/gedcom#sibling ?sibling1 ?sibling2) (http://www.daml.org/2001/01/gedcom/gedcom#descendent ?sibling1 ?descendent1) (http://www.daml.org/2001/01/gedcom/gedcom#descendent ?sibling2 ?descendent2) => (assert (http://www.daml.org/2001/01/gedcom/gedcom#cousin ?descendent1 ?descendent2)))