Below i want to check if
p(b) are members of the list. But after the fist call to
L is instantiated to
p(a) so the second call to
member/2 fails. Is there a way to avoid this? Ie checking for membership without changing the list that involves anonymous variables?
myList([p(_)]). main:- myList(L), member(p(a), L), member(p(b), L).