I'm having quite a bit of trouble with recursion in Prolog. I have this predicate that works with removed things from one list and adding them to another list if they fulfill some requisites. The thing is that's not working for some reason, and only returning me a boolean value.
I tried debugging it with trace, in which I saw the process is correct and indeed the list gets the elements in want to, but it simply only returns a true/false value,.
I also tried replicating my problem by creating a predicate rcu(L1,L2) to reverse a List. How would I make this work (with just 2 arguments, or at least, a predicate starting with 2 arguments)?
rcu([], List2).
rcu([H | Rest], List2) :-
rcu(Rest, [H | List2]).