Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- man(igor).
- man(nikolayg).
- man(nikolay).
- man(mihail).
- woman(elena).
- woman(mariya).
- father(igor, mihail).
- father(igor, nikolay).
- mother(elena, mihail).
- mother(elena, mihail).
- mother(mariya, igor).
- brother(mihail, nikolay).
- brother(nikolay, mihail).
- grandmother(mariya, nikolay).
- grandmother(mariya, mihail).
- grandfather(nikolayg, nikolay).
- grandfather(nikolayg, mihail).
- %?-parent(X, Y), write(X), write(" - "), write(Y), nl, fail.
- %?-grandmother(X,Y), write(X), write(" - "), write(Y), nl, fail.
- older(mariya, igor).
- older(mariya, elena).
- older(mariya, mihail).
- older(mariya, nikolay).
- older(elena, mihail).
- older(elena, nikolay).
- older(igor, elena).
- older(igor, nikolay).
- older(igor, mihail).
- older(nikolay, mihail).
- older(X,Z):- older(X,Y), older(Y,Z).
- married(X,Z):- mother(X,Y), father(Z,Y).
- parent2(X,Z):- mother(X,Z) ; father(X,Z).
- havesameparent(X,Z):- (father(Y,X) ; mother(Y,X)), (father(Y,Z) ; mother(Y,Z)), X \= Z.
- dontbrorsist(X,Z):- \havesameparent(X,Z), X\=Z.
- %?-havesameparent(X,Z), write(X), write(" - "), write(Z), fail.
- ?-dontbrorsist(X,Z), write(X), write(" - "), write(Z), nl, fail.
- %?-older(elena, X), write(X), nl.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement