mirror of
https://github.com/Z3Prover/z3
synced 2025-08-25 20:46:01 +00:00
align updated version of lookahead with legacy heuristics
This commit is contained in:
parent
6ea68310c9
commit
d81de1a67e
4 changed files with 257 additions and 145 deletions
|
@ -38,7 +38,13 @@ namespace sls {
|
|||
unsigned restart_init = 1000;
|
||||
bool early_prune = true;
|
||||
unsigned max_moves = 0;
|
||||
unsigned max_moves_base = 200;
|
||||
unsigned max_moves_base = 800;
|
||||
unsigned propagation_base = 10000;
|
||||
bool ucb = true;
|
||||
double ucb_constant = 1.0;
|
||||
double ucb_forget = 0.1;
|
||||
bool ucb_init = false;
|
||||
double ucb_noise = 0.1;
|
||||
};
|
||||
|
||||
struct stats {
|
||||
|
@ -46,11 +52,13 @@ namespace sls {
|
|||
unsigned m_num_updates = 0;
|
||||
unsigned m_moves = 0;
|
||||
unsigned m_restarts = 0;
|
||||
unsigned m_num_propagations = 0;
|
||||
};
|
||||
|
||||
struct bool_info {
|
||||
unsigned weight = 0;
|
||||
unsigned weight = 40;
|
||||
double score = 0;
|
||||
unsigned touched = 1;
|
||||
};
|
||||
|
||||
bv_util bv;
|
||||
|
@ -66,51 +74,61 @@ namespace sls {
|
|||
double m_best_score = 0, m_top_score = 0;
|
||||
bvect m_best_value;
|
||||
expr* m_best_expr = nullptr;
|
||||
bool m_rescore = true;
|
||||
ptr_vector<expr> m_empty_vars;
|
||||
obj_map<expr, bool_info> m_bool_info;
|
||||
expr_mark m_is_root;
|
||||
unsigned m_touched = 1;
|
||||
|
||||
void init_updates();
|
||||
std::ostream& display_weights(std::ostream& out);
|
||||
|
||||
bv_valuation& wval(expr* e) const;
|
||||
|
||||
void insert_update_stack(expr* e);
|
||||
bool insert_update(expr* e);
|
||||
void restore_lookahead();
|
||||
double lookahead(expr* u, bvect const& new_value);
|
||||
double old_score(app* c);
|
||||
|
||||
bool_info& get_bool_info(expr* e);
|
||||
double lookahead_update(expr* u, bvect const& new_value);
|
||||
double old_score(app* c) { return get_bool_info(c).score; }
|
||||
void set_score(app* c, double d) { get_bool_info(c).score = d; }
|
||||
double new_score(app* c);
|
||||
void set_score(app* c, double d);
|
||||
void rescore(app* c);
|
||||
|
||||
void rescore();
|
||||
|
||||
|
||||
unsigned get_weight(expr* e);
|
||||
void inc_weight(expr* e);
|
||||
unsigned get_weight(expr* e) { return get_bool_info(e).weight; }
|
||||
void inc_weight(expr* e) { ++get_bool_info(e).weight; }
|
||||
void dec_weight(expr* e);
|
||||
void recalibrate_weights();
|
||||
bool is_root(expr* e) { return m_is_root.is_marked(e); }
|
||||
|
||||
void ucb_forget();
|
||||
unsigned get_touched(app* e) { return get_bool_info(e).touched; }
|
||||
void set_touched(app* e, unsigned t) { get_bool_info(e).touched = t; }
|
||||
void inc_touched(app* e) { ++get_bool_info(e).touched; }
|
||||
|
||||
void try_set(expr* u, bvect const& new_value);
|
||||
void add_updates(expr* u);
|
||||
void apply_update(expr* e, bvect const& new_value);
|
||||
bool apply_update();
|
||||
bool apply_random_move(ptr_vector<expr> const& vars);
|
||||
bool apply_guided_move(ptr_vector<expr> const& vars);
|
||||
bool apply_random_update(ptr_vector<expr> const& vars);
|
||||
bool apply_guided_update(ptr_vector<expr> const& vars);
|
||||
ptr_vector<expr> const& get_candidate_uninterp();
|
||||
|
||||
void check_restart();
|
||||
void reset_uninterp_in_false_literals();
|
||||
bool is_bv_literal(sat::literal lit);
|
||||
bool is_false_bv_literal(sat::literal lit);
|
||||
|
||||
void search();
|
||||
|
||||
|
||||
|
||||
public:
|
||||
bv_lookahead(bv_eval& ev);
|
||||
|
||||
void updt_params(params_ref const& p);
|
||||
|
||||
lbool search();
|
||||
|
||||
void start_propagation() { m_rescore = true; }
|
||||
void start_propagation();
|
||||
|
||||
bool on_restore(expr* e) const;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue