I was looking through some prolog examples and stumbled upon http://www.anselm.edu/internet/compsci/faculty_staff/mmalita/HOMEPAGE/logic/bufalo.txt
first_names([keith,libby,margo,nora,otto]).
last_names([fell,grant,hall,ivey,jule]).
ages([2,3,4,5,6]).
start(Sol):- first_names(F),last_names(L),ages(A),
Sol=[[F1,L1,A1],[F2,L2,A2],[F3,L3,A3],[F4,L4,A4],[F5,L5,A5]],
F=[F1,F2,F3,F4,F5], % if order is not important!
member([libby,jule,_],Sol), % 1
set_equal([L1,L2,L3,L4,L5],L), % write correspondence
set_equal([A1,A2,A3,A4,A5],A),
member([keith,_,AgeK],Sol), % 2
member([_,ivey,AgeI],Sol),AgeK is AgeI+1,
member([nora,_,AgeN],Sol),AgeI is AgeN+1,
member([margo,_,AgeM],Sol),
member([_,fell,AgeF],Sol),AgeF is 3+AgeM,
member([otto,_,AgeO],Sol),member([_,hall,AgeH],Sol).
In this code example I have a general idea of how it works, but I'm really not sure on the specifics
I understand defining the hints as a list of atoms with the first field being first name, second field being last name, and third field being age with underscores showing missing information. However I'm not really sure why this is being called with member onto the Sol array. Not sure what it does in this context
Additionally, I don't really understand the purpose of the set_equal's and the F= in this code. It seems like it's setting three variables which are not referenced at all?
Thanks for your help!