function prob = BR_prob_or(clause,L_probs)
% BR_prob_or - compute probability of or clause
% On input:
%     clause (1xk vector): disjuction of literals
%     L_probs (1xn vector): probabilities of literals
% On output:
%     prob (float): probability of disjunction
% Call:
%     p = BR_prob_or(clause,L_probs);
% Author:
%     T. Henderson
%     UU
%     Spring 2017
%

prob = 0;
if isempty(clause)
    return
end
len_clause = length(clause);
if len_clause==1
    prob = L_probs(abs(clause(1)));
    return
end
p1 = L_probs(abs(clause(1)));
p2 = BR_prob_or(clause(2:end),L_probs);
prob = p1 + p2 - p1*p2;
