mirror of
https://github.com/Z3Prover/z3
synced 2025-06-03 21:01:22 +00:00
Merge branch 'master' of https://github.com/Z3Prover/z3
This commit is contained in:
commit
a5bae72bdf
2 changed files with 40 additions and 104 deletions
|
@ -596,6 +596,7 @@ template<typename Config>
|
||||||
template<bool ProofGen>
|
template<bool ProofGen>
|
||||||
void rewriter_tpl<Config>::main_loop(expr * t, expr_ref & result, proof_ref & result_pr) {
|
void rewriter_tpl<Config>::main_loop(expr * t, expr_ref & result, proof_ref & result_pr) {
|
||||||
if (m_cancel_check && m().canceled()) {
|
if (m_cancel_check && m().canceled()) {
|
||||||
|
reset();
|
||||||
throw rewriter_exception(m().limit().get_cancel_msg());
|
throw rewriter_exception(m().limit().get_cancel_msg());
|
||||||
}
|
}
|
||||||
SASSERT(!ProofGen || result_stack().size() == result_pr_stack().size());
|
SASSERT(!ProofGen || result_stack().size() == result_pr_stack().size());
|
||||||
|
@ -630,6 +631,7 @@ void rewriter_tpl<Config>::resume_core(expr_ref & result, proof_ref & result_pr)
|
||||||
SASSERT(!frame_stack().empty());
|
SASSERT(!frame_stack().empty());
|
||||||
while (!frame_stack().empty()) {
|
while (!frame_stack().empty()) {
|
||||||
if (m_cancel_check && m().canceled()) {
|
if (m_cancel_check && m().canceled()) {
|
||||||
|
reset();
|
||||||
throw rewriter_exception(m().limit().get_cancel_msg());
|
throw rewriter_exception(m().limit().get_cancel_msg());
|
||||||
}
|
}
|
||||||
SASSERT(!ProofGen || result_stack().size() == result_pr_stack().size());
|
SASSERT(!ProofGen || result_stack().size() == result_pr_stack().size());
|
||||||
|
|
|
@ -238,15 +238,8 @@ namespace smt {
|
||||||
if (m_fpa_util.is_fp(e)) {
|
if (m_fpa_util.is_fp(e)) {
|
||||||
expr * cargs[3] = { to_app(e)->get_arg(0), to_app(e)->get_arg(1), to_app(e)->get_arg(2) };
|
expr * cargs[3] = { to_app(e)->get_arg(0), to_app(e)->get_arg(1), to_app(e)->get_arg(2) };
|
||||||
res = m_bv_util.mk_concat(3, cargs);
|
res = m_bv_util.mk_concat(3, cargs);
|
||||||
|
|
||||||
try {
|
|
||||||
m_th_rw((expr_ref&)res);
|
m_th_rw((expr_ref&)res);
|
||||||
}
|
}
|
||||||
catch (rewriter_exception &) {
|
|
||||||
m_th_rw.reset();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
sort * es = m.get_sort(e);
|
sort * es = m.get_sort(e);
|
||||||
|
|
||||||
|
@ -302,15 +295,8 @@ namespace smt {
|
||||||
TRACE("t_fpa_detail", tout << "converting atom: " << mk_ismt2_pp(e, get_manager()) << std::endl;);
|
TRACE("t_fpa_detail", tout << "converting atom: " << mk_ismt2_pp(e, get_manager()) << std::endl;);
|
||||||
expr_ref res(m);
|
expr_ref res(m);
|
||||||
proof_ref pr(m);
|
proof_ref pr(m);
|
||||||
try {
|
|
||||||
m_rw(e, res);
|
m_rw(e, res);
|
||||||
m_th_rw(res, res);
|
m_th_rw(res, res);
|
||||||
}
|
|
||||||
catch (rewriter_exception &) {
|
|
||||||
m_rw.reset();
|
|
||||||
m_th_rw.reset();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
SASSERT(is_app(res));
|
SASSERT(is_app(res));
|
||||||
SASSERT(m.is_bool(res));
|
SASSERT(m.is_bool(res));
|
||||||
return res;
|
return res;
|
||||||
|
@ -323,18 +309,11 @@ namespace smt {
|
||||||
expr_ref e_conv(m), res(m);
|
expr_ref e_conv(m), res(m);
|
||||||
proof_ref pr(m);
|
proof_ref pr(m);
|
||||||
|
|
||||||
try {
|
|
||||||
m_rw(e, e_conv);
|
m_rw(e, e_conv);
|
||||||
}
|
|
||||||
catch (rewriter_exception &) {
|
|
||||||
m_rw.reset();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
TRACE("t_fpa_detail", tout << "term: " << mk_ismt2_pp(e, get_manager()) << std::endl;
|
TRACE("t_fpa_detail", tout << "term: " << mk_ismt2_pp(e, get_manager()) << std::endl;
|
||||||
tout << "converted term: " << mk_ismt2_pp(e_conv, get_manager()) << std::endl;);
|
tout << "converted term: " << mk_ismt2_pp(e_conv, get_manager()) << std::endl;);
|
||||||
|
|
||||||
try {
|
|
||||||
if (m_fpa_util.is_rm(e)) {
|
if (m_fpa_util.is_rm(e)) {
|
||||||
SASSERT(m_fpa_util.is_bv2rm(e_conv));
|
SASSERT(m_fpa_util.is_bv2rm(e_conv));
|
||||||
expr_ref bv_rm(m);
|
expr_ref bv_rm(m);
|
||||||
|
@ -352,12 +331,6 @@ namespace smt {
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
}
|
|
||||||
catch (rewriter_exception &)
|
|
||||||
{
|
|
||||||
m_th_rw.reset();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -366,15 +339,8 @@ namespace smt {
|
||||||
SASSERT(to_app(e)->get_family_id() == get_family_id());
|
SASSERT(to_app(e)->get_family_id() == get_family_id());
|
||||||
/* This is for the conversion functions fp.to_* */
|
/* This is for the conversion functions fp.to_* */
|
||||||
expr_ref res(get_manager());
|
expr_ref res(get_manager());
|
||||||
try {
|
|
||||||
m_rw(e, res);
|
m_rw(e, res);
|
||||||
m_th_rw(res, res);
|
m_th_rw(res, res);
|
||||||
}
|
|
||||||
catch (rewriter_exception &) {
|
|
||||||
m_rw.reset();
|
|
||||||
m_th_rw.reset();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -432,13 +398,7 @@ namespace smt {
|
||||||
}
|
}
|
||||||
m_converter.m_extra_assertions.reset();
|
m_converter.m_extra_assertions.reset();
|
||||||
|
|
||||||
try {
|
|
||||||
m_th_rw(res);
|
m_th_rw(res);
|
||||||
}
|
|
||||||
catch (rewriter_exception &) {
|
|
||||||
m_th_rw.reset();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
CTRACE("t_fpa", !m.is_true(res), tout << "side condition: " << mk_ismt2_pp(res, m) << std::endl;);
|
CTRACE("t_fpa", !m.is_true(res), tout << "side condition: " << mk_ismt2_pp(res, m) << std::endl;);
|
||||||
return res;
|
return res;
|
||||||
|
@ -481,15 +441,7 @@ namespace smt {
|
||||||
expr_ref bv_atom(convert_atom(atom));
|
expr_ref bv_atom(convert_atom(atom));
|
||||||
expr_ref bv_atom_w_side_c(m), atom_eq(m);
|
expr_ref bv_atom_w_side_c(m), atom_eq(m);
|
||||||
bv_atom_w_side_c = m.mk_and(bv_atom, mk_side_conditions());
|
bv_atom_w_side_c = m.mk_and(bv_atom, mk_side_conditions());
|
||||||
|
|
||||||
try {
|
|
||||||
m_th_rw(bv_atom_w_side_c);
|
m_th_rw(bv_atom_w_side_c);
|
||||||
}
|
|
||||||
catch (rewriter_exception &) {
|
|
||||||
m_th_rw.reset();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
atom_eq = m.mk_eq(atom, bv_atom_w_side_c);
|
atom_eq = m.mk_eq(atom, bv_atom_w_side_c);
|
||||||
assert_cnstr(atom_eq);
|
assert_cnstr(atom_eq);
|
||||||
return true;
|
return true;
|
||||||
|
@ -600,13 +552,7 @@ namespace smt {
|
||||||
else
|
else
|
||||||
c = m.mk_eq(xc, yc);
|
c = m.mk_eq(xc, yc);
|
||||||
|
|
||||||
try {
|
|
||||||
m_th_rw(c);
|
m_th_rw(c);
|
||||||
}
|
|
||||||
catch (rewriter_exception &) {
|
|
||||||
m_th_rw.reset();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
expr_ref xe_eq_ye(m), c_eq_iff(m);
|
expr_ref xe_eq_ye(m), c_eq_iff(m);
|
||||||
xe_eq_ye = m.mk_eq(xe, ye);
|
xe_eq_ye = m.mk_eq(xe, ye);
|
||||||
|
@ -652,13 +598,7 @@ namespace smt {
|
||||||
c = m.mk_not(xc_eq_yc);
|
c = m.mk_not(xc_eq_yc);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
m_th_rw(c);
|
m_th_rw(c);
|
||||||
}
|
|
||||||
catch (rewriter_exception &) {
|
|
||||||
m_th_rw.reset();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
|
|
||||||
expr_ref xe_eq_ye(m), not_xe_eq_ye(m), c_eq_iff(m);
|
expr_ref xe_eq_ye(m), not_xe_eq_ye(m), c_eq_iff(m);
|
||||||
xe_eq_ye = m.mk_eq(xe, ye);
|
xe_eq_ye = m.mk_eq(xe, ye);
|
||||||
|
@ -697,13 +637,7 @@ namespace smt {
|
||||||
|
|
||||||
expr_ref cnstr(m);
|
expr_ref cnstr(m);
|
||||||
cnstr = (is_true) ? m.mk_implies(e, converted) : m.mk_implies(converted, e);
|
cnstr = (is_true) ? m.mk_implies(e, converted) : m.mk_implies(converted, e);
|
||||||
try {
|
|
||||||
m_th_rw(cnstr);
|
m_th_rw(cnstr);
|
||||||
}
|
|
||||||
catch (rewriter_exception &) {
|
|
||||||
m_th_rw.reset();
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
assert_cnstr(cnstr);
|
assert_cnstr(cnstr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue