is true if the given Element occurs in the given List. Its purpose is to test for membership. Normally, the two arguments are ground.
list of term
In the context of this predicate, a term occurs in a list if it can be unified with an element of the list.
The predicate is determinate and commits to the first successful unification, if any.
| ?- memberchk(bar, [foo,bar,baz]). yes