I have a predicate that has the following format:
pilot( ID1, ID2 ).
I'm searching for multiple values for pilot and Im able to get this predicate from a findall, but how can I go from there and use that new predicate to create a list like this:
[ pilot( ID1, ID2 ), pilot( ID1, ID2 ), pilot( ID1, ID2 ), pilot( ID1, ID2 ), ... ].
I do this: I ask for the ID of the flight: ID
and do this:
findall( flightS( PILOTS ), flight( ID, PILOTS, _, _, _, _), Xs).
And I get something like this:
[ flightS( 1, 2 ), flightS( 4, 7 ), flightS( ... ), ... ].
I then take that information and find the resulting pilots associated with the ID of the flightS. I can get each pilot and I'm able to write() them, my problem iss, I have multiple same pilots, because of the multiple flights, I want to put all of the pilots, that have this structure: pilot(ID,A,B,C,D,E), and put all of them in a list like this:
[ pilot(ID,A,B,C,D,E), pilot(ID,A,B,C,D,E), pilot(ID,A,B,C,D,E), ... ] so I can remove duplicate entries.