Yes you can use findall/3. But depending on what you really want to do, there are often better ways. Do you want to bring something out? Then try the following:
print_participants :-
common_participant(Person, PairEvent),
write(Person), write(' participates in '), write(PairEvent), write('.'), nl,
fail.
print_participants :-
true.
Thus, you do not need to save all the combinations in a large list at the same time, but only the one that is necessary for printing. A.
: , Kaarel.