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.
- V is a list that doesn't change in the entire function
- 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.
Dlist is a list comprised of all the values computed
distanceAllVectors(V, [], [H|T]). distanceAllVectors(V, Vset, Dlist) :- #function code here
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.
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.
I'm confused about what my base case should be, and how base cases work in prolog in general.
Thank you!