title: How to calculate intersection of Lists using recursion?
body: <p>The code successfully finds right intersection (runtime/debug, <code>gtrace</code>) but after there is no common elements(intersections) in either list it does some <em>stuff</em> and returns false. It has to return a list of intersections. How to fix it?</p>
  
  <pre><code>remove(S,[S|T],L) :-
     remove(S,T,L),
     !.  
  remove(S,[U|T],[U|L]) :-
     remove(S,T,L).
  remove(_,[],[]).
  remove(El,[El|List],List1) :-
     remove(El,List,List1).
  remove(El,[El1|List],[El1|List1]) :-
     remove(El,List,List1).
  
  l_inclusion(El,[]) :-
     fail.
  l_inclusion(El,[El|_]).
  l_inclusion(El,[El1|List]) :- 
     !,
     l_inclusion(El,List).
  
  int(List1,List2,Result) :-
     l_inclusion(El,List1),
     l_inclusion(El,List2),
     remove(El,List1,NewList1),
     remove(El,List2,NewList2),
     int(NewList1,NewList2,[El|Result]),
     write(Result),
     nl.
  </code></pre>
  
  <p>Sample query with expected result and output:      </p>
  
  <pre><code>?- int([1,3,5,2,4],[6,1,2],[]).
  [1,2]                            % expected: output by side-effect
  true.                            % expected: query succeeds
  </code></pre>