domains
list=symbol*
predicates
len(list)
findlen(list,integer)
clauses
len(X):-
findlen(X,Count),
write("\nLength Of List : "),
write(Count).
findlen([],X):-
X=0.
findlen([X|Tail],Count):-
findlen(Tail,Prev),
Count = Prev + 1.
OUT PUT
=======
Goal: len([a,b,c,d,e])
Length Of List : 5
Yes