Here is my code:
getMin([Y|List1],X):-
getMin(List, Y, X).
getMin([A|List],B,X):-
A=<B,
getMin(List,A,X);
B=<A,
getMin(List,B,X).
getMin([],X,X).
When entering getMin/3 A is supposed to be 1 as I understand, but at A=< B I get "Arguments are not sufficiently instantiated" error. Why and how to fix it?
I also found this but since I'm very new to Prolog, I don't realize where exactly they got the error there and why the argument where not instantiated there. (There are lot's of other similar posts but it is hard to make the connection between other a bit different programs and yours.)