mirror of
https://github.com/Z3Prover/z3
synced 2025-10-09 09:21:56 +00:00
fix cancelation within nex.
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
37c9534d04
commit
ac80dfaa8b
4 changed files with 18 additions and 7 deletions
|
@ -19,6 +19,8 @@
|
||||||
--*/
|
--*/
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
#include "util/util.h"
|
||||||
|
#include "util/rlimit.h"
|
||||||
#include "math/lp/nex.h"
|
#include "math/lp/nex.h"
|
||||||
#include "math/lp/nex_creator.h"
|
#include "math/lp/nex_creator.h"
|
||||||
|
|
||||||
|
@ -26,10 +28,11 @@ namespace nla {
|
||||||
class cross_nested {
|
class cross_nested {
|
||||||
|
|
||||||
// fields
|
// fields
|
||||||
|
reslimit& m_limit;
|
||||||
nex * m_e = nullptr;
|
nex * m_e = nullptr;
|
||||||
std::function<bool (const nex*)> m_call_on_result;
|
std::function<bool (const nex*)> m_call_on_result;
|
||||||
std::function<bool (unsigned)> m_var_is_fixed;
|
std::function<bool (unsigned)> m_var_is_fixed;
|
||||||
std::function<unsigned ()> m_random;
|
random_gen m_random;
|
||||||
bool m_done = false;
|
bool m_done = false;
|
||||||
ptr_vector<nex> m_b_split_vec;
|
ptr_vector<nex> m_b_split_vec;
|
||||||
int m_reported = 0;
|
int m_reported = 0;
|
||||||
|
@ -45,11 +48,13 @@ public:
|
||||||
|
|
||||||
cross_nested(std::function<bool (const nex*)> call_on_result,
|
cross_nested(std::function<bool (const nex*)> call_on_result,
|
||||||
std::function<bool (unsigned)> var_is_fixed,
|
std::function<bool (unsigned)> var_is_fixed,
|
||||||
std::function<unsigned ()> random,
|
reslimit& limit,
|
||||||
nex_creator& nex_cr) :
|
unsigned random_seed,
|
||||||
|
nex_creator& nex_cr) :
|
||||||
|
m_limit(limit),
|
||||||
m_call_on_result(call_on_result),
|
m_call_on_result(call_on_result),
|
||||||
m_var_is_fixed(var_is_fixed),
|
m_var_is_fixed(var_is_fixed),
|
||||||
m_random(random),
|
m_random(random_seed),
|
||||||
m_done(false),
|
m_done(false),
|
||||||
m_reported(0),
|
m_reported(0),
|
||||||
m_mk_scalar([this]{return m_nex_creator.mk_scalar(rational(1));}),
|
m_mk_scalar([this]{return m_nex_creator.mk_scalar(rational(1));}),
|
||||||
|
@ -279,6 +284,8 @@ public:
|
||||||
TRACE(nla_cn, tout << "m_e=" << *m_e << "\nc=" << **c << "\nj = " << nex_creator::ch(j) << "\nfront="; print_front(front, tout) << "\n";);
|
TRACE(nla_cn, tout << "m_e=" << *m_e << "\nc=" << **c << "\nj = " << nex_creator::ch(j) << "\nfront="; print_front(front, tout) << "\n";);
|
||||||
if (!split_with_var(*c, j, front))
|
if (!split_with_var(*c, j, front))
|
||||||
return;
|
return;
|
||||||
|
if (!m_limit.inc())
|
||||||
|
return;
|
||||||
TRACE(nla_cn, tout << "after split c=" << **c << "\nfront="; print_front(front, tout) << "\n";);
|
TRACE(nla_cn, tout << "after split c=" << **c << "\nfront="; print_front(front, tout) << "\n";);
|
||||||
if (front.empty()) {
|
if (front.empty()) {
|
||||||
#ifdef Z3DEBUG
|
#ifdef Z3DEBUG
|
||||||
|
|
|
@ -90,7 +90,9 @@ bool horner::lemmas_on_row(const T& row) {
|
||||||
cross_nested cn(
|
cross_nested cn(
|
||||||
[this, dep](const nex* n) { return c().m_intervals.check_nex(n, dep); },
|
[this, dep](const nex* n) { return c().m_intervals.check_nex(n, dep); },
|
||||||
[this](unsigned j) { return c().var_is_fixed(j); },
|
[this](unsigned j) { return c().var_is_fixed(j); },
|
||||||
[this]() { return c().random(); }, m_nex_creator);
|
c().reslim(),
|
||||||
|
c().random(),
|
||||||
|
m_nex_creator);
|
||||||
bool ret = lemmas_on_expr(cn, to_sum(e));
|
bool ret = lemmas_on_expr(cn, to_sum(e));
|
||||||
c().m_intervals.get_dep_intervals().reset(); // clean the memory allocated by the interval bound dependencies
|
c().m_intervals.get_dep_intervals().reset(); // clean the memory allocated by the interval bound dependencies
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -678,7 +678,9 @@ namespace nla {
|
||||||
cross_nested cn(
|
cross_nested cn(
|
||||||
[this, dep](const nex* n) { return c().m_intervals.check_nex(n, dep); },
|
[this, dep](const nex* n) { return c().m_intervals.check_nex(n, dep); },
|
||||||
[this](unsigned j) { return c().var_is_fixed(j); },
|
[this](unsigned j) { return c().var_is_fixed(j); },
|
||||||
[this]() { return c().random(); }, nc);
|
c().reslim(),
|
||||||
|
c().random(),
|
||||||
|
nc);
|
||||||
cn.run(to_sum(e));
|
cn.run(to_sum(e));
|
||||||
bool ret = cn.done();
|
bool ret = cn.done();
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -192,7 +192,7 @@ namespace smt {
|
||||||
ctx = alloc(context, m, m_smt_params, p.ctx.get_params());
|
ctx = alloc(context, m, m_smt_params, p.ctx.get_params());
|
||||||
context::copy(p.ctx, *ctx, true);
|
context::copy(p.ctx, *ctx, true);
|
||||||
ctx->set_random_seed(id + m_smt_params.m_random_seed);
|
ctx->set_random_seed(id + m_smt_params.m_random_seed);
|
||||||
|
|
||||||
smt_parallel_params pp(p.ctx.m_params);
|
smt_parallel_params pp(p.ctx.m_params);
|
||||||
m_config.m_threads_max_conflicts = ctx->get_fparams().m_threads_max_conflicts;
|
m_config.m_threads_max_conflicts = ctx->get_fparams().m_threads_max_conflicts;
|
||||||
m_config.m_max_conflicts = ctx->get_fparams().m_max_conflicts;
|
m_config.m_max_conflicts = ctx->get_fparams().m_max_conflicts;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue