friends(phil,robin).
friends(chris,robin).
friends(phil,pat).
friends(jo,chris).
invitation(phil).
invitation(pat).
party(P) :- invitation(P).
party(P) :- friends(P,F),invitation(F).
party(P) :- friends(F,P),invitation(F).
