q:-halt. %I married a widow who had a grown-up daughter. male(me). female(widow). female(daughter). parent(widow,daughter). married(me, widow). % So I became the stepfather of her daughter. parent(me,daughter). %Some months later, my wife gave birth to a son. parent(widow, son). parent(me, son). male(son). %My father, who visited us halte often, fell in love with my step-daughter, %and married her. male(father). parent(father, me). %Hence, my father became my son-in-law, and my stepdaughter became my mother. parent(daughter, me). parent(me, father). %The wife of my father, that is my step-daughter, also had a son. parent(daughter, anotherson). parent(father, anotherson). male(anotherson). %My son became became my brother-in-law. %of my father as well as my uncle. %and I got a brother and at the same time a grandson. :-consult('/u/faculty/dick/cs320/prolog/family.pl'). :-trace [parent, married, brother, family]. %My wife is my grandmother, %since she is my mother's mother. %Hence, I am my wife's husband and at the same time her step-grandson; %in other words, I am my own grandfather. ?-grandfather(me, me).