title: SWI-Prolog: finding the second minimum in a list
body: <p>I'm new to Prolog and I'm having trouble figuring out how to find the second minimum in the list that includes numbers and letters. When it includes a letter it should display an error and when it has one number then it should display an error. So far I have this but I'm not sure how to start off my code for having letters...</p>
  
  <pre><code>secondMin([_]) :- 
      print("ERROR: List has fewer than two unique elements."),
      !.
  secondMin(List, M2) :- 
      min_list(List, M1), 
      delete(List, M1, List1), 
      min_list(List1, M2).
  </code></pre>
  
  <p>The output should look like this: </p>
  
  <pre><code>?- secondMin([17,29,11,62,37,53], M2).
  M2 = 17
  ?- secondMin([512], M2).
  ERROR: List has fewer than two unique elements.
  ?- secondMin([7,5.2,3,6,-3.6,9,-2], M2).
  M2 = -2
  ?- secondMin([12,2,b,7], M2).
  ERROR: "b" is not a number.
  ?- secondMin([3,3,3], M2).
  ERROR: List has fewer than two unique elements.
  </code></pre>