i need help with a prolog rule. The database is outlined as follows
is_below(bob,jim).
is_below(jim,dave).
is_below(dave,sam).
is_below(sam,pete).
is_below(pete,colin).
is_below(colin,eric).
is_below(eric,steve).
is_below(steve,paul).
is_below(paul,jack).
It shows the rank people, bob is 1 place lower than Jim etc. I want to write a rule which returns the highest person?
top_person(X)
and also a rule to check if one person is higher than the next
higher(colin,jack).
Can you give me some help please?
is_below(bob,jim).
is_below(jim,dave).
is_below(dave,sam).
is_below(sam,pete).
is_below(pete,colin).
is_below(colin,eric).
is_below(eric,steve).
is_below(steve,paul).
is_below(paul,jack).
It shows the rank people, bob is 1 place lower than Jim etc. I want to write a rule which returns the highest person?
top_person(X)
and also a rule to check if one person is higher than the next
higher(colin,jack).
Can you give me some help please?