function clause = BR_s2clause(s)
% BR_s2clause - convert logical string to clause
% On input:
%     s (string): logical sentence (dijunction; fully parenthesized)
% On output:
%     clause (vector): or clause (represented as integers)
% Call:
%     cl = BR_s2clause('((1)v(2))';
% Author:
%     T. Henderson
%     UU
%     Fall 2018
%

MINUS = '-';

clause = [];

len_s = length(s);
d = isstrprop(s,'digit');

for c = 1:len_s
    if d(c)
        index = c;
        val = 0;
        while d(index)
            val = 10*val + str2num(s(index));
            index = index + 1;
        end
        if s(c-1)==MINUS
            val = -val;
        end
        clause = [clause,val];
    end
end

        