3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-06 17:44:08 +00:00

handle exception internally, avoid passing rationals to integer operations

This commit is contained in:
Nikolaj Bjorner 2025-01-28 20:09:59 -08:00
parent 5b175c1bcd
commit fe5d17d515
2 changed files with 12 additions and 2 deletions

View file

@ -586,6 +586,8 @@ namespace sls {
if (mx == 0)
continue;
auto valmx = divide(x, val, mx);
if (p > 1 && !is_int(x))
continue;
auto r = root_of(p, valmx);
add_update(x, r - value(x));
if (p % 2 == 0)
@ -1786,7 +1788,9 @@ namespace sls {
// val / mx = x^p
if (mx == 0)
continue;
auto valmx = divide(x, val, mx);
if (p > 1 && !is_int(x))
continue;
auto valmx = divide(x, val, mx);
auto r = root_of(p, valmx);
add_update(x, r - value(x));
if (p % 2 == 0)

View file

@ -101,7 +101,13 @@ namespace sls {
void smt_plugin::run() {
if (!m_ddfw)
return;
m_result = m_ddfw->check(0, nullptr);
try {
m_result = m_ddfw->check(0, nullptr);
}
catch (std::exception& ex) {
IF_VERBOSE(0, verbose_stream() << "sls-exception " << ex.what() << "\n");
m_result = l_undef;
}
IF_VERBOSE(3, verbose_stream() << "sls-result " << m_result << "\n");
for (auto v : m_shared_bool_vars) {
auto w = m_smt_bool_var2sls_bool_var[v];