occ(E,C,N):-
	calcfreq(C,F),
	member([E,N],F).

calcfreq([],[]).
calcfreq([H|T],R2):-
	calcfreq(T,R1),
	adic(H,R1,R2).
adic(V,[],[[V,1]]).
adic(V,[[V,F]|R],[[V,F1]|R]):-
	!, F1 is F+1.
adic(V,[H|T],[H|T1]):-
	adic(V,T,T1).
