Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- male(john).
- male(jack).
- male(peter).
- male(sam).
- female(mary).
- female(linda).
- female(lisa).
- female(susan).
- parent(john, jack).
- parent(john, linda).
- parent(mary, jack).
- parent(mary, linda).
- parent(jack, sam).
- parent(lisa, sam).
- parent(peter, susan).
- parent(susan, linda).
- father(X, Y) :- male(X), parent(X, Y).
- mother(X, Y) :- female(X), parent(X, Y).
- sibling(X, Y) :- parent(P, X), parent(P, Y), X \= Y.
- grandparent(X, Y) :- parent(X, Z), parent(Z, Y).
- grandchild(X, Y) :- grandparent(Y, X).
- uncle_or_aunt(X, Y) :- sibling(X, Z), parent(Z, Y).
- cousin(X, Y) :- parent(P1, X), parent(P2, Y), sibling(P1, P2).
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement