Consider
the following Prolog code
person(dana, sawad,
female, 40, chemist).
person(ahmad, abu_j,
male, 53, solicitor).
person(suna, jab,
female, 39, doctor).
person(osama, ahmad,
male, 43, architect).
person(sara, rami,
female, 30, engineer).
person(yazan, ali,
male, 27, programmer).
man(X):-person(X, _,
male,_,_).
woman(X):-person(X,_,
female, _, _).
whoisengineer(X):-person(X,_,_,_,
engineer).
canmarry(X,Y):-man(X),woman(Y),write(X),
write(' can marry '), write(Y), nl.
cantreat(X,Y):-person(X,_,_,_,doctor),person(Y),
write(X), write(' can treat '),
write(Y),nl.
Write a
query to find whom can treat osama?
Write a
query to check if ahmad is a man?
Write a
query to find who can marry the engineer?
Write a
rule that find all people who exceeds 50 years old, name it Above50().?