mirror of
https://github.com/Z3Prover/z3
synced 2025-08-03 01:40:22 +00:00
parent
aa6ec418e3
commit
6202cd5394
3 changed files with 22 additions and 32 deletions
|
@ -47,7 +47,6 @@ def_module_params(module_name='smt',
|
||||||
('induction', BOOL, False, 'enable generation of induction lemmas'),
|
('induction', BOOL, False, 'enable generation of induction lemmas'),
|
||||||
('bv.reflect', BOOL, True, 'create enode for every bit-vector term'),
|
('bv.reflect', BOOL, True, 'create enode for every bit-vector term'),
|
||||||
('bv.enable_int2bv', BOOL, True, 'enable support for int2bv and bv2int operators'),
|
('bv.enable_int2bv', BOOL, True, 'enable support for int2bv and bv2int operators'),
|
||||||
('bv.eq_axioms', BOOL, True, 'add dynamic equality axioms'),
|
|
||||||
('bv.watch_diseq', BOOL, False, 'use watch lists instead of eager axioms for bit-vectors'),
|
('bv.watch_diseq', BOOL, False, 'use watch lists instead of eager axioms for bit-vectors'),
|
||||||
('bv.delay', BOOL, True, 'delay internalize expensive bit-vector operations'),
|
('bv.delay', BOOL, True, 'delay internalize expensive bit-vector operations'),
|
||||||
('arith.random_initial_value', BOOL, False, 'use random initial values in the simplex-based procedure for linear arithmetic'),
|
('arith.random_initial_value', BOOL, False, 'use random initial values in the simplex-based procedure for linear arithmetic'),
|
||||||
|
|
|
@ -26,7 +26,6 @@ void theory_bv_params::updt_params(params_ref const & _p) {
|
||||||
m_hi_div0 = rp.hi_div0();
|
m_hi_div0 = rp.hi_div0();
|
||||||
m_bv_reflect = p.bv_reflect();
|
m_bv_reflect = p.bv_reflect();
|
||||||
m_bv_enable_int2bv2int = p.bv_enable_int2bv();
|
m_bv_enable_int2bv2int = p.bv_enable_int2bv();
|
||||||
m_bv_eq_axioms = p.bv_eq_axioms();
|
|
||||||
m_bv_delay = p.bv_delay();
|
m_bv_delay = p.bv_delay();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +37,6 @@ void theory_bv_params::display(std::ostream & out) const {
|
||||||
DISPLAY_PARAM(m_bv_reflect);
|
DISPLAY_PARAM(m_bv_reflect);
|
||||||
DISPLAY_PARAM(m_bv_lazy_le);
|
DISPLAY_PARAM(m_bv_lazy_le);
|
||||||
DISPLAY_PARAM(m_bv_cc);
|
DISPLAY_PARAM(m_bv_cc);
|
||||||
DISPLAY_PARAM(m_bv_eq_axioms);
|
|
||||||
DISPLAY_PARAM(m_bv_blast_max_size);
|
DISPLAY_PARAM(m_bv_blast_max_size);
|
||||||
DISPLAY_PARAM(m_bv_enable_int2bv2int);
|
DISPLAY_PARAM(m_bv_enable_int2bv2int);
|
||||||
DISPLAY_PARAM(m_bv_delay);
|
DISPLAY_PARAM(m_bv_delay);
|
||||||
|
|
|
@ -224,8 +224,6 @@ namespace smt {
|
||||||
};
|
};
|
||||||
|
|
||||||
void theory_bv::add_new_diseq_axiom(theory_var v1, theory_var v2, unsigned idx) {
|
void theory_bv::add_new_diseq_axiom(theory_var v1, theory_var v2, unsigned idx) {
|
||||||
if (!params().m_bv_eq_axioms)
|
|
||||||
return;
|
|
||||||
m_prop_diseqs.push_back(bv_diseq(v1, v2, idx));
|
m_prop_diseqs.push_back(bv_diseq(v1, v2, idx));
|
||||||
ctx.push_trail(push_back_vector<svector<bv_diseq>>(m_prop_diseqs));
|
ctx.push_trail(push_back_vector<svector<bv_diseq>>(m_prop_diseqs));
|
||||||
}
|
}
|
||||||
|
@ -432,8 +430,6 @@ namespace smt {
|
||||||
};
|
};
|
||||||
|
|
||||||
void theory_bv::add_fixed_eq(theory_var v1, theory_var v2) {
|
void theory_bv::add_fixed_eq(theory_var v1, theory_var v2) {
|
||||||
if (!params().m_bv_eq_axioms)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (v1 > v2) {
|
if (v1 > v2) {
|
||||||
std::swap(v1, v2);
|
std::swap(v1, v2);
|
||||||
|
@ -1152,8 +1148,6 @@ namespace smt {
|
||||||
}
|
}
|
||||||
|
|
||||||
void theory_bv::expand_diseq(theory_var v1, theory_var v2) {
|
void theory_bv::expand_diseq(theory_var v1, theory_var v2) {
|
||||||
if (!params().m_bv_eq_axioms)
|
|
||||||
return;
|
|
||||||
|
|
||||||
SASSERT(get_bv_size(v1) == get_bv_size(v2));
|
SASSERT(get_bv_size(v1) == get_bv_size(v2));
|
||||||
if (v1 > v2) {
|
if (v1 > v2) {
|
||||||
|
@ -1320,30 +1314,29 @@ namespace smt {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ctx.assign(consequent, mk_bit_eq_justification(v1, v2, consequent, antecedent));
|
ctx.assign(consequent, mk_bit_eq_justification(v1, v2, consequent, antecedent));
|
||||||
if (params().m_bv_eq_axioms) {
|
|
||||||
literal_vector lits;
|
literal_vector lits;
|
||||||
lits.push_back(~consequent);
|
lits.push_back(~consequent);
|
||||||
lits.push_back(antecedent);
|
lits.push_back(antecedent);
|
||||||
literal eq = mk_eq(get_expr(v1), get_expr(v2), false);
|
literal eq = mk_eq(get_expr(v1), get_expr(v2), false);
|
||||||
lits.push_back(~eq);
|
lits.push_back(~eq);
|
||||||
//
|
//
|
||||||
// Issue #3035:
|
// Issue #3035:
|
||||||
// merge_eh invokes assign_bit, which updates the propagation queue and includes the
|
// merge_eh invokes assign_bit, which updates the propagation queue and includes the
|
||||||
// theory axiom for the propagated equality. When relevancy is non-zero, propagation may get
|
// theory axiom for the propagated equality. When relevancy is non-zero, propagation may get
|
||||||
// lost on backtracking because the propagation queue is reset on conflicts.
|
// lost on backtracking because the propagation queue is reset on conflicts.
|
||||||
// An alternative approach is to ensure the propagation queue is chronological with
|
// An alternative approach is to ensure the propagation queue is chronological with
|
||||||
// backtracking scopes (ie., it doesn't get reset, but shrunk to a previous level, and similar
|
// backtracking scopes (ie., it doesn't get reset, but shrunk to a previous level, and similar
|
||||||
// with a qhead indicator.
|
// with a qhead indicator.
|
||||||
//
|
//
|
||||||
ctx.mark_as_relevant(lits[0]);
|
ctx.mark_as_relevant(lits[0]);
|
||||||
ctx.mark_as_relevant(lits[1]);
|
ctx.mark_as_relevant(lits[1]);
|
||||||
ctx.mark_as_relevant(lits[2]);
|
ctx.mark_as_relevant(lits[2]);
|
||||||
{
|
{
|
||||||
scoped_trace_stream _sts(*this, lits);
|
scoped_trace_stream _sts(*this, lits);
|
||||||
ctx.mk_th_axiom(get_id(), lits.size(), lits.data());
|
ctx.mk_th_axiom(get_id(), lits.size(), lits.data());
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_wpos[v2] == idx)
|
if (m_wpos[v2] == idx)
|
||||||
find_wpos(v2);
|
find_wpos(v2);
|
||||||
// REMARK: bit_eq_justification is marked as a theory_bv justification.
|
// REMARK: bit_eq_justification is marked as a theory_bv justification.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue