member/2

Gets or checks a member of a list

member(Term,List) -(i,i),(o,i)

?Term <term>

?List <list> or <variable>

Compatibility: LPA Win-Prolog.

Remarks:

1) This predicate succeeds when its first argument is bound to a Term which is a member of the List bound to the second argument. The latter may be a fully or partially instantiated list, or simply a variable; member/2 can backtrack to generate alternative solutions where appropriate.

2) This predicate is a part of most standard Prolog libraries, but it is usually not a built-in Predicate. However, it is very frequently used, and the G.I.S. Prolog internal implementation is more efficient than any external source-code for this predicate. Some Prolog compilers (e.g. LPA Win-Prolog) also contain member/2 as a built-in predicate. For these reasons, it was decided to implement it as a built-in predicate of G.I.S. Prolog.

See also: member/3, append/3, remove/3.