I'm new to prolog and I need help understanding how returning value works. I know that it's either
pred(Y, X) :- X is Y.
So when giving input
?- pred(5, X).
output is:
X = 5.
or when input is
?- pred(5,5).
we get:
true .
Now I would like to obtain the first output from the predicate that looks like this:
main_pred(List, RES) :-
sort(List, SortedList),
check(SortedList).
The RES should be either T if check(SortedList) is true or N if check(SortedList) is false.
For now my result is just true/false, but I would like to get RES = T/N.
Is it possible? Thanks