library(aggregate) could be a good starting point, but to put it to good use I think you need to decouple the tasks, and use sub_atom/5 that actually can 'search' multiple occurrences:
tags_count(Tags, Title, Count) :-
downcase_atom(Title, Downcase),
aggregate_all(count, (member(T,Tags), sub_atom(Downcase, _,_,_, T)), Count).
counters(Tags, L) :-
findall(C, (document(T,_), tags_count(Tags,T,C)), L).
test:
document('Rules; Semantic Technology; and Cross-Industry Standards',_).
document('Rule Transformation and Extraction',_).
document('Rules and Uncertainty',_).
document('Rules and Rules',_).
?- counters([rule], L), max_list(L, Max), sum_list(L, Sum), Tot is Sum + Max.
L = [1, 1, 1, 2],
Max = 2,
Sum = 5,
Tot = 7.
edit Really, all work is done 'inside' aggregate_all/3
tags_tot_max_title(Tags, Tot, Max, Title) :-
aggregate_all(info(sum(C), max(C, T)), (
document(T, _), tags_count(Tags, T, C)
), info(Sum, max(Max, Title))),
Tot is Sum + Max.
yields
?- tags_tot_max_title([rule], Tot, Max, Title).
Tot = 7,
Max = 2,
Title = 'Rules and Rules'.