Reasoner example with some rules for relatives

Allikas: Lambda
% see syntax docs:
% https://www.mcs.anl.gov/research/projects/AR/otter/otter33.pdf
%
% for advanced syntax see
% http://tptp.cs.miami.edu/TPTP/TR/TPTPTR.shtml#ProblemPresentation

father(john,pete).
father(pete,mark).
mother(mary,pete).
mother(elizabeth,mark).
brother(andrew,pete).

-brother(X,Y) | brother(Y,X).
-sister(X,Y) | sister(Y,X).
-father(X,Y) | childof(Y,X).
-mother(X,Y) | childof(Y,X).

-sister(X,Y) | female(X).
-mother(X,Y) | female(X).
-father(X,Y) | male(X).
-father(X,Y) | male(X).

-father(X,Y) | -father(Y,Z) | grandfather(X,Z).
-mother(X,Y) | -father(Y,Z) | grandfather(X,Z).
-father(X,Y) | -mother(Y,Z) | grandmother(X,Z).
-mother(X,Y) | -mother(Y,Z) | grandmother(X,Z).

-brother(X,Y) | relative(X,Y).
-sister(X,Y) | relative(X,Y).
-father(X,Y) | relative(X,Y).
-mother(X,Y) | relative(X,Y).

-relative(X,Y) | relative(Y,X).
-relative(X,Y) | -relative(Y,Z) | relative(X,Z).

-married(X,Y) | married(Y,X).
-married(X,Y) | -male(X) | husband(X,Y).
-married(X,Y) | -female(X) | wife(X,Y).

married(elizabeth,pete).

%-grandfather(john,X) | ans(X).
%-male(X) | ans(X).
%-husband(X,elizabeth) | ans(X).

male(jaan).

% is jaan female?
%-female(jaan).

-male(X) | -female(X).

% is jaan not female?
female(jaan).