I have a large number of facts within my program, listing developers and designers in a company, as well as previous projects, like so..
% project(Project Name,Year)
project(efnet, 2007).
% designer(Project Name, Name, Role)
designer(efnet, jane_cole, lead).
% developer(Project Name, Name, Role)
developer(efnet, alex_tobbs, architect).
I have also build a definition that displays a list of either designers or developers working on a project
% employees(Single Project, List of Employees
employees(Project, E)
What I want is to create a new definition that take a list of either designers or developers and displays a list of all the project titles they have BOTH worked on (P); like so..
% projects_of_all(List of Staff, List of Projects)
projects_of_all(S,P):- ...
I can do this easily with findall (or bagof) if I have to find the movies of a single person, but I am not sure how I would do this with a list of the employees. Can someone give me a helping hand with this?