الجمعة، 26 ديسمبر 2014

family tree prolog

male(meshhen).
male(issa).
male(jameel).
male(mosa).
male(ryad).
male(zuher).
male(muzzamle).
male(mohammad).
male(bader).
male(abd).

female(horia).
female(rabaa).
female(rana).

father(meshhen,jameel).
father(jameel,zuher).
father(zuher,mohammad).



prother(zuher,ryad).
prother(zuher,muzzamle).
prother(zuher,rabaa).
prother(zuher,horia).
prother(jameel,issa).
prother(jameel,mosa).
prother(bader,mohammad).
prother(mohammad,abd).
prother(mohammad,rana).


grandFather(X,Z):-father(Y,Z),father(X,Y).
uncle(X,Z):-father(Y,Z),prother(Y,X),male(X).
unti(X,Z):-father(Y,Z),prother(Y,X),female(X).
sibling(X,Y):-father(F,X),father(F,Y).


















ليست هناك تعليقات:

إرسال تعليق