Untitled

 avatar
chamanEiqbal
prolog
2 years ago
2.2 kB
1
Indexable
Never
/* immediate family */
parent(gulshan,chandan).
parent(gulshan,phsuhpa).
parent(jagarti,chandan).
parent(jagarti,phushpa).

/* father's side cousins: */

parent(ameet,mohan).
parent(ameet,pari).
parent(monika,mohan).
parent(monika,pari).
parent(rekha,mohan).
parent(rekha,pari).
parent(nirmal,mohan).
parent(nirmal,pari).
parent(jai,mohan).
parent(jai,dropati).
parent(krishna,mohan).
parent(krishna,dropati).

parent(ganga,raju).
parent(ganga,kamla).
parent(pardeep,raju).
parent(pardeep,kamla).
parent(dileep,raju).
parent(dileep,kamla).
parent(ashok,raju).
parent(ashok,kamla).
parent(sangeeta,raju).
parent(sangeeta,kamla).
parent(baby,raju).
parent(baby,kamla).

/* mother's side cousins */


parent(damni,mathri).
parent(damni,ghansham).
parent(raja,mathri).
parent(raja,ghansham).
parent(jatendar,mathri).
parent(jatendar,ghansham).
parent(jatendar,mathri).

/* paternal grandfather's family */

parent(kamla,paroo).
parent(kamla,moole).
parent(mohan,paroo).
parent(mohan,moole).
parent(mirchoo,paroo).
parent(mirchoo,moole).
parent(chandan,paroo).
parent(chandan,moole).


/* maternal grandfather's family: */

parent(phushpa,ram).
parent(phushpa,seeta).


/* gender facts : */
male(gulshan).
male(chandan). 
male(mohan). 
male(ameet).
male(jai). 
male(mirchoo). 
male(raju). 
male(ashok). 
male(dileep).
male(pardeep).
male(ghansham). 
male(ram).
male(paroo).
male(raja). 
male(jatendar). 

female(dropati).
female(jagarti).
female(phushpa).
female(pari).
female(moole).
female(saroopi).
female(seeta).
female(damni).
female(ganga).
female(baby).
female(sangeeta).
female(monika).
female(rekha).
female(nirmal).
female(krishna).
female(kamla).

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

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

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

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

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

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

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


niece(X,Y):-
    uncle(Y,X),female(X).
nephew(X,Y):-
    aunt(Y,X),male(X).