Created
February 2, 2023 01:23
-
-
Save veer66/0ff150d726e81ac4f2e863813b388c94 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
male(tom). | |
male(bob). | |
male(jim). | |
female(liz). | |
female(pat). | |
female(ann). | |
female(pam). | |
parent(pam,bob). | |
parent(tom,bob). | |
parent(tom,liz). | |
parent(bob,ann). | |
parent(bob,pat). | |
father(X,Y) :- parent(X,Y), male(X). | |
mother(X,Y) :- parent(X,Y),female(X). | |
grandparent(X,Z) :- parent(X,Y), parent(Y,Z). | |
sister(X,Y) :- parent(Z,X), parent(Z,Y), female(X), X\=Y. | |
same(X,Y) :- X=Y. | |
diff(X,Y) :- not(same(X,Y)). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment