function [res,res2] = BR_test_ABCD(dx,v)
%

KB(1).clauses = [1,2,5];
KB(2).clauses = [3,4,-5];
KB(1).prob = 0;
KB(2).prob = 0;
query(1).clauses = [1,2,3,4];
query(1).prob = 0;
res2 = [];

x = [0:dx:1];
num_els = length(x);

res = zeros(num_els,num_els);

wb = waitbar(0,'ABCD');
for ind1 = 1:num_els
    waitbar(ind1/num_els);
    p1 = x(ind1);
    KB(1).prob = p1;
    for ind2 = 1:num_els
        p2 = x(ind2);
        if p1==0.4&p2==0.4
            tch = 0;
        end
        KB(2).prob = p2;
        P = BR_Nilsson(KB);
        res(ind1,ind2) = abs(v-BR_Nilsson_query(query,P));
        if res(ind1,ind2)<0.01
            res2 = [res2;ind1,ind2,p1,p2,res(ind1,ind2)];
        end
    end
end
close(wb);
