Grandmother(X,Y) :- female(X),mother(X,Z),father(Z,Y). Grandfather(X,Y) :- male(X),father(X,Z),mother(Z,Y). Hii Some conditions didnt fully work, some of them just explore one side of the family tree… I add some conditions to make it work all way round on the family tree… The only thing I cant make work yet (round way) is the cousin part Grandfather(X,Y) :- male(X),father(X,Z),father(Z,Y). Implementation of Family tree with predicates likeįather, mother, son, daughter, grandfather,aunt,uncle,Ĭousin, ancestor for facts like male,female,parent,
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |