3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-09-06 01:48:02 +00:00

Added justifications for intermediate values [e.g., 2 * x in the pdd (2 * x) + y]

This might allow propagation in both directions
This commit is contained in:
Clemens Eisenhofer 2022-12-21 13:52:27 +01:00
parent ec06027515
commit c8b9127028
6 changed files with 475 additions and 172 deletions

View file

@ -53,8 +53,6 @@ namespace polysat {
constraint(constraint_manager& m, ckind_t k): m_kind(k) {}
bool has_bvar() const { return m_bvar != sat::null_bool_var; }
public:
virtual ~constraint() {}
@ -85,7 +83,7 @@ namespace polysat {
bool is_currently_false(solver const& s, bool is_positive) const { return is_currently_true(s, !is_positive); }
virtual void narrow(solver& s, bool is_positive, bool first) = 0;
virtual void propagate_bits(solver& s, bool is_positive) {}
virtual bool propagate_bits(solver& s, bool is_positive) { return true; }
/**
* If possible, produce a lemma that contradicts the given assignment.
* This method should not modify the solver's search state.
@ -105,6 +103,7 @@ namespace polysat {
unsigned_vector const& vars() const { return m_vars; }
unsigned var(unsigned idx) const { return m_vars[idx]; }
bool contains_var(pvar v) const { return m_vars.contains(v); }
bool has_bvar() const { return m_bvar != sat::null_bool_var; }
sat::bool_var bvar() const { SASSERT(has_bvar()); return m_bvar; }
std::string bvar2string() const;