title: Prolog: Filtering a list?
body: <p>I'm currently working on a very short project on Prolog, and just got stuck trying to apply a "filter" I have created to a list. I have what you could call the filter ready, but I can't apply it. It'd be better if I illustrate:</p>
  
  <pre><code>filter(A, B) 
  </code></pre>
  
  <p>...outputs 'true' if certain conditions are met.</p>
  
  <pre><code>filterList(A, [X, Y, Z])
  </code></pre>
  
  <p>...outputs a list which includes all elements from the second argument that make the filter output <strong>false</strong>. (So if filter(A, X) is true, the output is [Y, Z] ).</p>
  
  <p>I have the "filter" function ready, but now I need to apply it to a list as shown on the second example, excluding all elements for which the filter returns true when applied with the first argument. </p>
  
  <p>So, if the filter is a simple A == B, the function is supposed to receive A [A,B,A,C,D,A] and output [B,C,D], having removed all the elements for which the filter applies, obviously.</p>
  
  <p>I'm having trouble with the basic structure of the function, so if anyone could supply a basic outline for a function such as this it would be of great help. I've simplified my situation as much as possible so I can take whatever you may be able to provide and modify it for my needs.</p>
  
  <p>Thanks in advance!</p>