I have a some problem understaing the flow of prolog. here is the code:
h(X):- 1 is X mod 2, write(X), nl, 0 is X mod 3, !, fail.
h(_).
t(_,[],0).
t(M,[_|LS],1):-member(M,LS),write('member'), nl,fail.
t(_,[H|_],H).
r([X|LS],R):-h(X), M is 2*X+1,t(M, LS, R), write(R), nl, fail.
now I am runing 3 things: 1. r([3,7,9],R). 2. r([5,11,13],R). 3. r([2,3,5],R). and I cant understand the answers I get. the answers are: 1. 3 false. 2. 5 11 false. 3. member 3 false.
hope for help!