mirror of
https://github.com/Z3Prover/z3
synced 2025-05-04 06:15:46 +00:00
build_lemma returns clause_builder; adjust reason in revert_bool_decision
This commit is contained in:
parent
733c21bb20
commit
24f96acf4f
8 changed files with 83 additions and 75 deletions
|
@ -27,16 +27,17 @@ namespace polysat {
|
|||
class clause_builder {
|
||||
solver& m_solver;
|
||||
sat::literal_vector m_literals;
|
||||
scoped_ptr_vector<constraint> m_new_constraints;
|
||||
p_dependency_ref m_dep;
|
||||
unsigned m_level = 0;
|
||||
|
||||
public:
|
||||
clause_builder(solver& s);
|
||||
|
||||
bool empty() const { return m_literals.empty() && m_new_constraints.empty() && m_dep == nullptr && m_level == 0; }
|
||||
bool empty() const { return m_literals.empty() && m_dep == nullptr && m_level == 0; }
|
||||
void reset();
|
||||
|
||||
unsigned level() const { return m_level; }
|
||||
|
||||
/// Build the clause. This will reset the clause builder so it can be reused.
|
||||
clause_ref build();
|
||||
|
||||
|
@ -45,9 +46,15 @@ namespace polysat {
|
|||
/// Add a literal to the clause.
|
||||
/// Intended to be used for literals representing a constraint that already exists.
|
||||
void push_literal(sat::literal lit);
|
||||
|
||||
void push(signed_constraint c);
|
||||
|
||||
/// Add a constraint to the clause that does not yet exist in the solver so far.
|
||||
void push_new_constraint(signed_constraint c);
|
||||
// void push_new_constraint(signed_constraint c);
|
||||
|
||||
using const_iterator = decltype(m_literals)::const_iterator;
|
||||
const_iterator begin() const { return m_literals.begin(); }
|
||||
const_iterator end() const { return m_literals.end(); }
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue