Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
1.9 kB
2
Indexable
Never
/* X is a parent of Y */

/* abbas family */
parent(naseem,abdurrafay).
parent(shahida,abdurrafay).
parent(naseem,ibrahim).
parent(shahida,ibrahim).
parent(naseem,imaan).
parent(shahida,imaan).


/* dadas family */
parent(niaz,naseem).
parent(ayesha,naseem).
parent(niaz,shazia).
parent(ayesha,shazia).
parent(niaz,asim).
parent(ayesha,asim).


/*phopos family*/
parent(rizwan,azlan).
parent(shazia,azlan).
parent(rizwan,aiman).
parent(shazia,aiman).



/*chachas family*/
parent(khurram,usman).
parent(sameena,usman).
parent(khurram,zainab).
parent(sameena,zainab).


/* nanas family */
parent(sami,shahida).
parent(malka,shahida).
parent(sami,fareeda).
parent(malka,fareeda).
parent(sami,hafeez).
parent(malka,hafeez).


/* mamos family */
parent(hafeez,abdullah).
parent(ambreen,abdullah).
parent(hafeez,hania).
parent(ambreen,hania).
parent(hafeez,abdurrahman).
parent(ambreen,abdurrahman).


/* khalas family */
parent(ayyub,nouman).
parent(fareeda,nouman).
parent(ayyub,afshan).
parent(fareeda,afshan).



/* male */

male(abdurrafay).
male(naseem).
male(ibrahim).
male(niaz).
male(asim).
male(rizwan).
male(azlan).
male(khurram).
male(usman).
male(sami).
male(hafeez).
male(abdullah).
male(abdurrahman).
male(ayyub).
male(nouman).


/* female */

female(shahida).
female(imaan).
female(ayesha).
female(shazia).
female(aiman).
female(sameena).
female(zainab).
female(malka).
female(fareeda).
female(afshan).
female(ambreen).
female(hania).


/*predicates*/

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

mother(X,Y);-
parent(X,Y),
female(X).

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

married(X,Y);-
father(X,Z),
mother(Y,Z),
X\=Y.

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

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