I am given a database and I am querying the database with a predicate
findmin(A,B,course(X,Y)):- course(X,Y),X >= A,Y =< B.
I have my database like,
course(a1,b1).
course(a2,b2).
course(a3,b3).
...
Now instead of using standard findall/3
predicate, I want to use my own findall,
finda(X,findmin(A,B,X),L)
If i use a recursion that will always take me to the beginning of database, I'm not getting how to use findmin recursively to give me distinct occurrences in database.