title: Prolog: expressing that two lists have at least two elements in common
body: <p>I am trying to find out if two lists overlap. The predicate I want to write
   takes two lists and returns true if the lists have at least two elements in common.</p>
  
  <p>Sample queries with expected answer:</p>
  
  <pre><code>?- overlap([13,14,15], [17,18,13,19]).
  false.
  
  ?- overlap([13,14,15], [14,17,13,18,16]).
  true.
  </code></pre>
  
  <p>However, so far, I only got one element to work.</p>
  
  <pre><code>member(M, [M|_]).
  member(M, [_|T]) :-
     member(M, T).
  
  overlap(X, Y) :-
     member(M, X),
     member(M, Y).
  
  ?- overlap([a,b,c,d], [1,2,c,d]).
  </code></pre>
  
  <p>How can I make sure it checks two elements, not just one?</p>