I given below program use basic terms of AI used.That's term are study in structure of AI for click below Back sign. That's term used in the program.In this program used to identify relatton other perionship with other person.That relation defined in the program.And program used it.
Example:
Given relation for member of family.That is given as prediction of user.That is useful for identify user interface for it.
Given three relations child(X,Y):X is a child of Y, male(X):X is male,female(X):X is female.Give a program to find relations like brother(X,Y),father(X,Y),mother(X,Y),grandfather(X,Y), grandmother(X,Y), uncle(X,Y),sister(X,Y), ancestor(X,Y) between different members of a family.
The below example consist of the relation member of the family.That's the above person relation need to be defines.There is also need to define some basic requirement assumption that's used.The program are given below:
Given three relations child(X,Y):X is a child of Y, male(X):X is male,female(X):X is female.Give a program to find relations like brother(X,Y),father(X,Y),mother(X,Y),grandfather(X,Y), grandmother(X,Y), uncle(X,Y),sister(X,Y), ancestor(X,Y) between different members of a family.
- Gita and Raman
- Ashok and Rajesh
- Payal and Bhaumik
The below example consist of the relation member of the family.That's the above person relation need to be defines.There is also need to define some basic requirement assumption that's used.The program are given below:
predicates
female(symbol)
male(symbol)
child(symbol,symbol)
mother(symbol,symbol)
father(symbol,symbol)
grandmother(symbol,symbol)
grandfather(symbol,symbol)
sister(symbol,symbol)
brother(symbol,symbol)
uncle(symbol,symbol)
ancestor(symbol,symbol)
clauses
female(gita).
female(payal).
male(raman).
male(ashok).
male(rajesh).
male(bhaumik).
male(arjun).
child(ashok,gita).
child(rajesh,gita).
child(ashok,raman).
child(rajesh,raman).
child(payal,rajesh).
child(bhaumik,rajesh).
child(arjun,bhaumik).
mother(X,Y):-
female(X),
child(Y,X).
father(X,Y):-
male(X),
child(Y,X).
grandmother(X,Y):-
female(X),
child(Z,X),
child(Y,Z).
grandfather(X,Y):-
male(X),
child(Z,X),
child(Y,Z).
sister(X,Y):-
X<>Y,
female(X),
child(X,Z),
child(Y,Z).
brother(X,Y):-
X<>Y,
male(X),
child(X,Z),
child(Y,Z).
uncle(X,Y):-
male(X),