3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-28 19:35:50 +00:00

move some grobner settings to pdd_solver.m_config

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2020-01-10 11:06:01 -08:00
parent bb6511b425
commit 00e1049ff2
6 changed files with 35 additions and 16 deletions

View file

@ -70,17 +70,18 @@ namespace dd {
}
void solver::set_thresholds(unsigned eqs_growth, unsigned expr_size_growth, unsigned expr_degree_growth) {
void solver::adjust_cfg() {
auto & cfg = m_config;
IF_VERBOSE(3, verbose_stream() << "start saturate\n"; display_statistics(verbose_stream()));
m_config.m_eqs_threshold = static_cast<unsigned>(eqs_growth * ceil(log(1 + m_to_simplify.size()))* m_to_simplify.size());
m_config.m_expr_size_limit = 0;
m_config.m_expr_degree_limit = 0;
cfg.m_eqs_threshold = static_cast<unsigned>(cfg.m_eqs_growth * ceil(log(1 + m_to_simplify.size()))* m_to_simplify.size());
cfg.m_expr_size_limit = 0;
cfg.m_expr_degree_limit = 0;
for (equation* e: m_to_simplify) {
m_config.m_expr_size_limit = std::max(m_config.m_expr_size_limit, (unsigned)e->poly().tree_size());
m_config.m_expr_degree_limit = std::max(m_config.m_expr_degree_limit, e->poly().degree());
cfg.m_expr_size_limit = std::max(cfg.m_expr_size_limit, (unsigned)e->poly().tree_size());
cfg.m_expr_degree_limit = std::max(cfg.m_expr_degree_limit, e->poly().degree());
}
m_config.m_expr_size_limit *= expr_size_growth;
m_config.m_expr_degree_limit *= expr_degree_growth;;
cfg.m_expr_size_limit *= cfg.m_expr_size_growth;
cfg.m_expr_degree_limit *= cfg.m_expr_degree_growth;;
IF_VERBOSE(3, verbose_stream() << "set m_config.m_eqs_threshold to 10 * " << 10 * ceil(log(m_to_simplify.size())) << "* " << m_to_simplify.size() << " = " << m_config.m_eqs_threshold << "\n";
verbose_stream() << "set m_config.m_expr_size_limit to " << m_config.m_expr_size_limit << "\n";

View file

@ -55,6 +55,10 @@ public:
unsigned m_max_simplified;
unsigned m_random_seed;
bool m_enable_exlin;
unsigned m_eqs_growth;
unsigned m_expr_size_growth;
unsigned m_expr_degree_growth;
unsigned m_number_of_conflicts_to_report;
config() :
m_eqs_threshold(UINT_MAX),
m_expr_size_limit(UINT_MAX),
@ -62,7 +66,11 @@ public:
m_max_steps(UINT_MAX),
m_max_simplified(UINT_MAX),
m_random_seed(0),
m_enable_exlin(false)
m_enable_exlin(false),
m_eqs_growth(10),
m_expr_size_growth(10),
m_expr_degree_growth(5),
m_number_of_conflicts_to_report(1)
{}
};
@ -121,6 +129,7 @@ public:
void set(print_dep_t& pd) { m_print_dep = pd; }
void set(config const& c) { m_config = c; }
void adjust_cfg();
void reset();
void add(pdd const& p) { add(p, nullptr); }
@ -138,7 +147,7 @@ public:
std::ostream& display_statistics(std::ostream& out) const;
const stats& get_stats() const { return m_stats; }
stats& get_stats() { return m_stats; }
void set_thresholds(unsigned eqs_growth, unsigned expr_size_growth, unsigned expr_degree_growth);
unsigned number_of_conflicts_to_report() const { return m_config.m_number_of_conflicts_to_report; }
private:
bool step();
@ -185,7 +194,6 @@ private:
scoped_process(solver& g, equation* e): g(g), e(e) {}
~scoped_process();
};
void update_stats_max_degree_and_size(const equation& e);
};