function s_index = BR_clause_sym_max(KB,c_index,samp)
%

m = length(KB);
indexes = sort(abs(KB(c_index).clauses));
num_indexes = length(indexes);

s_index = 0;
max_OK = 0;
for k = 1:num_indexes
    num_OK = 0;
    ind = indexes(k);
    k_samp = samp;
    k_samp(ind) = mod(k_samp(ind)+1,2);
    for c = 1:m
        num_OK = num_OK + BR_sat(KB(c).clauses,k_samp);
    end
    if num_OK>max_OK
        max_OK = num_OK;
        s_index = k;
    end
end
