WAP
to search an element in a list.
domains
namelist=name*
name=symbol
predicates
member(name,namelist)
go
clauses
go:-
readln(X),
member(X,[a,s,d,f,g,h,j]).
member(Name,[Name|_]).
member(Name,[_|Tail])
if member(Name,Tail).
Output:-
Goal:
member(x,[a,b,c,x,y,z])
Yes
Goal:
member(x,[p,q,r,s])
No