Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
2.5 kB
1
Indexable
Never
male(huzaifa).
male(osama).
male(iftikhar).
male(waqar).
male(waqas).
male(murawwat).
male(shujahat).
male(wajahat).
male(farrukh).
male(nisar).
male(asad).
male(saad).
male(ali).
male(mubashir).
male(ahmed).


female(majeedanbegum).
female(afshan).
female(urooj).
female(amna).
female(hafsa).
female(ayesha).
female(nasreen).
female(alishbah).
female(amber).
female(sara).
female(rida). 
female(suneela).
female(shanzay).
female(minha).
female(shagufta).


parent(nisar,ifikhar).
parent(majeedanbegum,iftikhar).
parent(nisar,waqar).
parent(majeedanbegum,waqar).
parent(nisar,zeeshan).
parent(majeedanbegum,zeeshan).
parent(nisar,nasreen).
parent(majeedanbegum,nasreen).
parent(iftikhar,huzaifa).
parent(afshan,huzaifa).
parent(iftikhar,alishbah).
parent(afshan,alishbah).
parent(waqar,waqas).
parent(waqar,rida).
parent(zeeshan,ahmed).
parent(urooj,ahmed).
parent(zeeshan,amber).
parent(zeeshan,urooj).
parent(zeeshan,mubashir).
parent(zeeshan,ali).
parent(nasreen,sara).
parent(asad,sara).
parent(nasreen,saad).
parent(asad,saad).
parent(nasreen,suneela).
parent(asad,suneela).


parent(shujahat,hafsa).
parent(amber,hafsa).
parent(shujahat,wajahat).
parent(amber,wajahat).
parent(shujahat,shanzay).
parent(gulzarbegham,shanzay).
parent(nazia,huzaifa).
parent(nazia,afshan).
parent(wajahat,farrukh).
parent(alishbah,farrukh).
parent(wajahat,amna).
parent(alishbah,amna).
parent(wajahat,murawwat).
parent(alishbah,murawwat).
parent(wajahat,mubashir).
parent(alishbah,mubashir).
parent(shanzay,minha).
parent(shanzay,shagufta).
parent(shanzay,ahmed).



father(X,Y) :- parent(X,Y), male(X).

sibling(X, Y) :-
    parent(Z, X),
    parent(Z, Y),
    X \= Y.

uncle(X, Y) :-
    male(X), sibling(X, Z), parent(Z, Y).



aunt(X, Y) :- female(X), sibling(X, Z), parent(Z, Y).

aunt_unique(X,Y) :- 
            parent(Y, X), sister(Y, Z), mother(Z).

father_uncle(X, Y) :- male(X), brother(X, Z), father(Z, Y).



mother_aunt(X, Y) :- female(X), sister(X, Z), mother(Z, Y).



niece(X, Y) :- female(X), parent(Z, Y), sibling(Z, P), parent(P, X).



nephew(X, Y) :- male(X), parent(Z, Y), sibling(Z, P), parent(P, X).

cousin(X,Y):-
parent(Z,X),parent(W,Y),sibling(Z,W),
X \= Y.




cousin_sister(X, Y) :-
cousin(X,Y),
female(X),
X \= Y.
/*female(X), parent(Z, Y), sibling(Z, P), parent(Q, P), parent(Q, X).*/




cousin_brother(X, Y) :- male(X), parent(Z, Y), sibling(Z, P), parent(Q, P), parent(Q, X).