function [ clauses ] = BR_CNFto3CNF_Robert( clauses )
% BR_CNFto3CNF Converts a CNF data structure to 3CNF

max_var = max(abs([clauses.clauses])) + 1;

for i = 1:length(clauses)
    while length(clauses(i).clauses) > 3
        new_clause.clauses = [clauses(i).clauses(1:2), max_var];
        clauses(i).clauses = [-max_var, clauses(i).clauses(3:end)];
        max_var = max_var + 1;
        clauses(end+1).clauses = new_clause.clauses;
    end
end
