anne     has [gender=female, father=boris,    mother=betty, rank=0].
amber    has [gender=female, father=buck,     mother=barbara, rank=0]. 
barbara  has [gender=female, father=charles,  mother=carla,   rank=0]. 
betty    has [gender=female, father=cuthbert, mother=cora,    rank=1]. 
carla    has [gender=female, rank=1]. 
cora     has [gender=female, rank=2]. 

al       has [gender=male, mother=barbara, father=buck, rank=0]. 
arthur   has [gender=male, father=buck,    mother=barbara, rank=0].
boris    has [gender=male, father=charles, mother=carla, rank=0]. 
buck     has [gender=male, father=calvin,  mother=ceclia, rank=1]. 
charles  has [gender=male, rank=1].
cuthbert has [gender=male, rank=2]. 

X of Y =< N :- oav(Y,X,N1), N1 =< N.
X of Y >= N :- oav(Y,X,N1), N1 >= N.
X of Y \= N :- oav(Y,X,N1), N1 \= N.
X of Y <  N :- oav(Y,X,N1), N1 <  N.
X of Y >  N :- oav(Y,X,N1), N1 >  N.
X of Y =  N :- oav(Y,X,N).

parental(X,Y) :- father of X = Y.
parental(X,Y) :- mother of X = Y.

grandfatheral(X,Y) :- parental(X,Z),father of Z = Y.
