mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 09:05:31 +00:00
fix #4794
This commit is contained in:
parent
9156e355d8
commit
12198d13ac
10 changed files with 42 additions and 28 deletions
|
@ -142,11 +142,6 @@ namespace sat {
|
|||
buffer[len++] = '\n';
|
||||
m_out->write(buffer, len);
|
||||
|
||||
if (n == 3 && c[0] == literal(9357, true) && c[1] == literal(25, true) && c[2] == literal(8691, false)) {
|
||||
m_out->flush();
|
||||
SASSERT(false);
|
||||
UNREACHABLE();
|
||||
}
|
||||
}
|
||||
|
||||
void drat::dump_activity() {
|
||||
|
|
|
@ -3486,7 +3486,6 @@ namespace sat {
|
|||
return value(v) != l_undef && lvl(v) <= new_lvl;
|
||||
};
|
||||
|
||||
|
||||
for (unsigned i = old_num_vars; i < sz; ++i) {
|
||||
bool_var v = m_active_vars[i];
|
||||
if (is_visited(v) || is_active(v)) {
|
||||
|
@ -3496,7 +3495,9 @@ namespace sat {
|
|||
}
|
||||
else {
|
||||
set_eliminated(v, true);
|
||||
m_free_vars.push_back(v);
|
||||
if (!is_external(v) || true) {
|
||||
m_free_vars.push_back(v);
|
||||
}
|
||||
}
|
||||
}
|
||||
m_active_vars.shrink(j);
|
||||
|
|
|
@ -669,6 +669,7 @@ namespace sat {
|
|||
void set_should_simplify() { m_next_simplify = m_conflicts_since_init; }
|
||||
bool_var_vector const& get_vars_to_reinit() const { return m_vars_to_reinit; }
|
||||
bool is_probing() const { return m_is_probing; }
|
||||
bool is_free(bool_var v) const { return m_free_vars.contains(v); }
|
||||
|
||||
public:
|
||||
void user_push() override;
|
||||
|
|
|
@ -436,6 +436,7 @@ namespace arith {
|
|||
if (_has_var)
|
||||
return v;
|
||||
theory_var w = mk_evar(n);
|
||||
internalize_term(n);
|
||||
svector<lpvar> vars;
|
||||
for (unsigned i = 0; i < p; ++i)
|
||||
vars.push_back(register_theory_var_in_lar_solver(w));
|
||||
|
|
|
@ -360,11 +360,12 @@ namespace bv {
|
|||
case bv_justification::kind_t::eq2bit:
|
||||
++s_count;
|
||||
// std::cout << "eq2bit " << s_count << "\n";
|
||||
#if 1
|
||||
#if 0
|
||||
if (s_count == 1899) {
|
||||
std::cout << "eq2bit " << mk_bounded_pp(var2expr(c.m_v1), m) << " == " << mk_bounded_pp(var2expr(c.m_v2), m) << "\n";
|
||||
std::cout << mk_bounded_pp(literal2expr(~c.m_antecedent), m, 2) << "\n";
|
||||
std::cout << mk_bounded_pp(literal2expr(c.m_consequent), m, 2) << "\n";
|
||||
std::cout << mk_bounded_pp(literal2expr(~c.m_antecedent), m, 4) << "\n";
|
||||
std::cout << mk_bounded_pp(literal2expr(c.m_consequent), m, 4) << "\n";
|
||||
std::cout << literal2expr(c.m_consequent) << "\n";
|
||||
#if 0
|
||||
solver_ref slv = mk_smt2_solver(m, ctx.s().params());
|
||||
slv->assert_expr(eq);
|
||||
|
@ -779,8 +780,6 @@ namespace bv {
|
|||
}
|
||||
|
||||
sat::justification solver::mk_eq2bit_justification(theory_var v1, theory_var v2, sat::literal c, sat::literal a) {
|
||||
if (v1 == 3202 && v2 == 3404) std::cout << a << " -> " << c << "\n";
|
||||
SASSERT(!(v1 == 3202 && v2 == 3404 && c.var() == 8691));
|
||||
void* mem = get_region().allocate(bv_justification::get_obj_size());
|
||||
sat::constraint_base::initialize(mem, this);
|
||||
auto* constraint = new (sat::constraint_base::ptr2mem(mem)) bv_justification(v1, v2, c, a);
|
||||
|
|
|
@ -76,7 +76,8 @@ namespace euf {
|
|||
if (!use_drat())
|
||||
return;
|
||||
literal_vector lits;
|
||||
for (literal lit : r) lits.push_back(~lit);
|
||||
for (literal lit : r)
|
||||
lits.push_back(~lit);
|
||||
if (l != sat::null_literal)
|
||||
lits.push_back(l);
|
||||
get_drat().add(lits, sat::status::th(true, get_id()));
|
||||
|
|
|
@ -692,6 +692,13 @@ namespace euf {
|
|||
finish_reinit();
|
||||
for (auto* e : m_solvers)
|
||||
e->pop_reinit();
|
||||
|
||||
#if 0
|
||||
for (enode* n : m_egraph.nodes()) {
|
||||
if (n->bool_var() != sat::null_bool_var && s().is_free(n->bool_var()))
|
||||
std::cout << "has free " << n->bool_var() << "\n";
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
bool solver::validate() {
|
||||
|
|
|
@ -213,7 +213,7 @@ struct goal2sat::imp : public sat::sat_internalizer {
|
|||
sat::bool_var to_bool_var(expr* e) override {
|
||||
sat::literal l;
|
||||
sat::bool_var v = m_map.to_bool_var(e);
|
||||
if (v != sat::null_bool_var)
|
||||
if (v != sat::null_bool_var)
|
||||
return v;
|
||||
if (is_app(e) && m_cache.find(to_app(e), l) && !l.sign())
|
||||
return l.var();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue