Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- woman(dorina).
- woman(maria).
- woman(ana).
- man(marius).
- man(mihai).
- man(george).
- man(andrei).
- parent(maria,ana).
- parent(maria,andrei).
- parent(george,ana).
- parent(george,andrei).
- parent(marius,maria).
- parent(dorina,maria).
- parent(mihai,george).
- mother(X,Y):-woman(X), parent(X,Y).
- father(X,Y):-man(X), parent(X,Y).
- sibling(X,Y):-parent(Z,X), parent(Z,Y), X\=Y.
- brother(X,Y):-sibling(X,Y), man(X).
- uncle(X,Y):-brother(X,Z), parent(Z,Y).
- grandmother(X,Y):-mother(X,Z), parent(Z,Y).
- grandfather(X,Y):-father(X,Z), parent(Z,Y).
- ancestor(X,Y):-parent(X,Y).
- ancestor(X,Y):-parent(Z,Y), ancestor(X,Z).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement