function S_probs = BR_KB_ap2Sp(KB,ap)
% BR_KB_ap2Sp - determine sentence probabilities from atom probabilities
%               assuming independence
% On input:
%     KB (KB struct): CNF knowledge base
%     ap (nx1 vector): atom probabilities
% On output:
%     S_probs (mx1 vector): sentence probabilities
% Call:
%     Sp = BR_KB_ap2Sp(KB,ap);
% Author:
%     T. Henderson
%     UU
%     Fall 2017
%

num_clauses = length(KB);

S_probs = zeros(num_clauses,1);

for c = 1:num_clauses
    S_probs(c) = BR_prob_or_atom_probs(KB(c).clauses,ap);
end
