who([H|T], B) :-
member(H, B), !,
who(T, B).
who([_|_], _).
I want to understand this code I am new to learn Prolog
who([H|T], B) :-
member(H, B), !,
who(T, B).
who([_|_], _).
I want to understand this code I am new to learn Prolog
Do you know about gtrace/0 ?
No actually Iam not familiar with gtrace/0
I tried the using trace but actually not getting what these predicates are actually doing for what task they were wriiten
Then you need to get a book and work through it.
One of the best places to ask such a question is stackoverflow as mentionned by EricGT. Apart from gtrace/0 a complementary way to make tests is to use different inputs and look at the results that you get.