title: Prolog recursion base case
body: <p>I have a slightly complex recursive function in prolog. What it does isn't super important because I'm pretty sure my problem lies in the method headers.</p>
  
  <ul>
  <li>V is a list that doesn't change in the entire function</li>
  <li>Vset is a list of lists - In the function I pull off one of the individual lists, multiply it by list V, and store that value. That individual list gets removed from the list of lists.</li>
  <li><p>Dlist is a list comprised of all the values computed</p>
  
  <pre><code>distanceAllVectors(V, [], [H|T]).
  distanceAllVectors(V, Vset, Dlist) :-   
     #function code here
  </code></pre></li>
  </ul>
  
  <p>I've traced the function in prolog and at one point Dlist is full of the correct values and Vset is empty. That's the point at which I need this function to end.</p>
  
  <p>I apologize for not posting the entire code, but it's comprised of a few different methods that would take more time to explain when I'm 99% sure this is the root of my problem.</p>
  
  <p>I'm confused about what my base case should be, and how base cases work in prolog in general.</p>
  
  <p>Thank you! </p>