Exercise:
1) Declare your own predicates, clauses and write a complete prolog program to
implement the rule given below.
friends (P1,P2):-
likes (P1,G), likes (P2,G), P1<>P2.
(Hint: find all friends.)
CPCS-331 Artificial Intelligence
Lab Manual by, Muhammad Shuaib Qureshi
FCIT/CS
Department of Computer Science
4
Lab:03 Compound queries with multiple variables
2) Assume the following \"likes\" facts knowledge base
likes (ali, football).
likes (ali, tennis).
likes (ahmad, tennis).
likes (ahmad, handball).
likes (samir, handball).
likes (samir, swimming).
likes (khaled, horseriding).
Find all the people who like more than one game.