mirror of
https://github.com/Z3Prover/z3
synced 2025-12-01 17:49:04 +00:00
Merge branch 'master' into polysat
This commit is contained in:
commit
220a63e8bd
223 changed files with 508 additions and 505 deletions
|
|
@ -18,6 +18,7 @@
|
|||
The truth table covers up to 6 inputs, which fits in 64 bits.
|
||||
|
||||
--*/
|
||||
#pragma once
|
||||
|
||||
static uint64_t compute_shift(uint64_t x, unsigned code) {
|
||||
switch (code) {
|
||||
|
|
|
|||
|
|
@ -1812,9 +1812,9 @@ namespace sat {
|
|||
CTRACE("resolve_bug", !c1.contains(l) || !c2.contains(~l), tout << c1 << "\n" << c2 << "\nl: " << l << "\n";);
|
||||
if (m_visited.size() <= 2*s.num_vars())
|
||||
m_visited.resize(2*s.num_vars(), false);
|
||||
if (c1.was_removed())
|
||||
if (c1.was_removed() && !c1.contains(l))
|
||||
return false;
|
||||
if (c2.was_removed())
|
||||
if (c2.was_removed() && !c2.contains(~l))
|
||||
return false;
|
||||
SASSERT(c1.contains(l));
|
||||
SASSERT(c2.contains(~l));
|
||||
|
|
|
|||
|
|
@ -115,8 +115,6 @@ public:
|
|||
return m_solver.get_config().m_incremental;
|
||||
}
|
||||
|
||||
~inc_sat_solver() override {}
|
||||
|
||||
solver* translate(ast_manager& dst_m, params_ref const& p) override {
|
||||
if (m_num_scopes > 0) {
|
||||
throw default_exception("Cannot translate sat solver at non-base level");
|
||||
|
|
|
|||
|
|
@ -351,7 +351,6 @@ namespace bv {
|
|||
|
||||
public:
|
||||
solver(euf::solver& ctx, theory_id id);
|
||||
~solver() override {}
|
||||
void set_lookahead(sat::lookahead* s) override { }
|
||||
void init_search() override {}
|
||||
double get_reward(literal l, sat::ext_constraint_idx idx, sat::literal_occs_fun& occs) const override;
|
||||
|
|
|
|||
|
|
@ -1823,7 +1823,7 @@ namespace pb {
|
|||
}
|
||||
|
||||
bool solver::validate_watch(pbc const& p, literal alit) const {
|
||||
if (value(p.lit()) != l_true)
|
||||
if (p.lit() == sat::null_literal || value(p.lit()) != l_true)
|
||||
return true;
|
||||
for (unsigned i = 0; i < p.size(); ++i) {
|
||||
literal l = p[i].second;
|
||||
|
|
|
|||
|
|
@ -3744,9 +3744,6 @@ namespace q {
|
|||
reset_pp_pc();
|
||||
}
|
||||
|
||||
~mam_impl() override {
|
||||
}
|
||||
|
||||
void add_pattern(quantifier * qa, app * mp) override {
|
||||
SASSERT(m.is_pattern(mp));
|
||||
TRACE("trigger_bug", tout << "adding pattern\n" << mk_ismt2_pp(qa, m) << "\n" << mk_ismt2_pp(mp, m) << "\n";);
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@ namespace q {
|
|||
arith_util a;
|
||||
public:
|
||||
arith_projection(ast_manager& m) : projection_function(m), a(m) {}
|
||||
~arith_projection() override {}
|
||||
bool operator()(expr* e1, expr* e2) const override { return lt(a, e1, e2); }
|
||||
expr* mk_lt(expr* x, expr* y) override { return a.mk_lt(x, y); }
|
||||
};
|
||||
|
|
@ -54,7 +53,6 @@ namespace q {
|
|||
bv_util bvu;
|
||||
public:
|
||||
ubv_projection(ast_manager& m) : projection_function(m), bvu(m) {}
|
||||
~ubv_projection() override {}
|
||||
bool operator()(expr* e1, expr* e2) const override { return lt(bvu, e1, e2); }
|
||||
expr* mk_lt(expr* x, expr* y) override { return m.mk_not(bvu.mk_ule(y, x)); }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -95,7 +95,6 @@ namespace q {
|
|||
public:
|
||||
|
||||
model_fixer(euf::solver& ctx, solver& qs);
|
||||
~model_fixer() override {}
|
||||
|
||||
/**
|
||||
* Update model in order to best satisfy quantifiers.
|
||||
|
|
|
|||
|
|
@ -65,7 +65,6 @@ namespace q {
|
|||
public:
|
||||
|
||||
solver(euf::solver& ctx, family_id fid);
|
||||
~solver() override {}
|
||||
bool is_external(sat::bool_var v) override { return false; }
|
||||
void get_antecedents(sat::literal l, sat::ext_justification_idx idx, sat::literal_vector& r, bool probing) override;
|
||||
void asserted(sat::literal l) override;
|
||||
|
|
|
|||
|
|
@ -189,7 +189,6 @@ namespace euf {
|
|||
|
||||
public:
|
||||
th_euf_solver(euf::solver& ctx, symbol const& name, euf::theory_id id);
|
||||
virtual ~th_euf_solver() {}
|
||||
virtual theory_var mk_var(enode* n);
|
||||
unsigned get_num_vars() const { return m_var2enode.size(); }
|
||||
euf::enode* e_internalize(expr* e);
|
||||
|
|
|
|||
|
|
@ -131,6 +131,21 @@ namespace user_solver {
|
|||
m_id2justification.setx(v, lits, sat::literal_vector());
|
||||
m_fixed_eh(m_user_context, this, var2expr(v), lit.sign() ? m.mk_false() : m.mk_true());
|
||||
}
|
||||
|
||||
void solver::new_eq_eh(euf::th_eq const& eq) {
|
||||
if (!m_eq_eh)
|
||||
return;
|
||||
force_push();
|
||||
m_eq_eh(m_user_context, this, var2expr(eq.v1()), var2expr(eq.v2()));
|
||||
}
|
||||
|
||||
void solver::new_diseq_eh(euf::th_eq const& de) {
|
||||
if (!m_diseq_eh)
|
||||
return;
|
||||
force_push();
|
||||
m_diseq_eh(m_user_context, this, var2expr(de.v1()), var2expr(de.v2()));
|
||||
}
|
||||
|
||||
|
||||
void solver::push_core() {
|
||||
th_euf_solver::push_core();
|
||||
|
|
|
|||
|
|
@ -144,6 +144,10 @@ namespace user_solver {
|
|||
bool get_case_split(sat::bool_var& var, lbool &phase) override;
|
||||
|
||||
void asserted(sat::literal lit) override;
|
||||
bool use_diseqs() const override { return (bool)m_diseq_eh; }
|
||||
void new_eq_eh(euf::th_eq const& eq) override;
|
||||
void new_diseq_eh(euf::th_eq const& de) override;
|
||||
|
||||
sat::check_result check() override;
|
||||
void push_core() override;
|
||||
void pop_core(unsigned n) override;
|
||||
|
|
|
|||
|
|
@ -93,10 +93,6 @@ struct goal2sat::imp : public sat::sat_internalizer {
|
|||
updt_params(p);
|
||||
}
|
||||
|
||||
~imp() override {
|
||||
}
|
||||
|
||||
|
||||
sat::cut_simplifier* aig() {
|
||||
return m_solver.get_cut_simplifier();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ public:
|
|||
|
||||
public:
|
||||
mc(ast_manager& m);
|
||||
~mc() override {}
|
||||
// flush model converter from SAT solver to this structure.
|
||||
void flush_smc(sat::solver& s, atom2bool_var const& map);
|
||||
void operator()(sat::model& m);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue