3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-04 06:15:46 +00:00

Add support for bailout lemma

This commit is contained in:
Jakob Rath 2021-09-08 16:37:47 +02:00
parent f2c79b851f
commit a0570908fb
5 changed files with 28 additions and 21 deletions

View file

@ -25,13 +25,17 @@ namespace polysat {
// TODO: this is now incorporated in conflict_core
class clause_builder {
solver& m_solver;
solver* m_solver;
sat::literal_vector m_literals;
p_dependency_ref m_dep;
unsigned m_level = 0;
public:
clause_builder(solver& s);
clause_builder(clause_builder const& s) = delete;
clause_builder(clause_builder&& s) = default;
clause_builder& operator=(clause_builder const& s) = delete;
clause_builder& operator=(clause_builder&& s) = default;
bool empty() const { return m_literals.empty() && m_dep == nullptr && m_level == 0; }
void reset();
@ -43,15 +47,9 @@ namespace polysat {
void add_dependency(p_dependency* d);
/// 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(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);
using const_iterator = decltype(m_literals)::const_iterator;
const_iterator begin() const { return m_literals.begin(); }
const_iterator end() const { return m_literals.end(); }