mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 03:45:51 +00:00
Merge branch 'bvsls' of https://git01.codeplex.com/z3 into opt
Conflicts: src/tactic/sls/sls_compilation_settings.h Signed-off-by: Christoph M. Wintersteiger <cwinter@microsoft.com>
This commit is contained in:
commit
ac206bacbf
8 changed files with 475 additions and 1702 deletions
|
@ -37,17 +37,13 @@ public:
|
|||
stopwatch m_stopwatch;
|
||||
unsigned m_full_evals;
|
||||
unsigned m_incr_evals;
|
||||
unsigned m_moves, m_flips, m_incs, m_decs, m_invs, m_umins, m_mul2s, m_mul3s, m_div2s;
|
||||
unsigned m_moves, m_flips, m_incs, m_decs, m_invs;
|
||||
|
||||
stats() :
|
||||
m_restarts(0),
|
||||
m_full_evals(0),
|
||||
m_incr_evals(0),
|
||||
m_moves(0),
|
||||
m_umins(0),
|
||||
m_mul2s(0),
|
||||
m_mul3s(0),
|
||||
m_div2s(0),
|
||||
m_flips(0),
|
||||
m_incs(0),
|
||||
m_decs(0),
|
||||
|
@ -75,13 +71,22 @@ protected:
|
|||
sls_evaluator m_evaluator;
|
||||
ptr_vector<expr> m_assertions;
|
||||
|
||||
unsigned m_restart_limit;
|
||||
unsigned m_max_restarts;
|
||||
unsigned m_plateau_limit;
|
||||
unsigned m_walksat;
|
||||
unsigned m_walksat_repick;
|
||||
unsigned m_wp;
|
||||
unsigned m_vns_mc;
|
||||
unsigned m_vns_repick;
|
||||
unsigned m_paws;
|
||||
unsigned m_paws_sp;
|
||||
unsigned m_restart_base;
|
||||
unsigned m_restart_next;
|
||||
unsigned m_restart_init;
|
||||
unsigned m_early_prune;
|
||||
unsigned m_random_offset;
|
||||
unsigned m_rescore;
|
||||
|
||||
ptr_vector<mpz> m_old_values;
|
||||
|
||||
typedef enum { MV_FLIP = 0, MV_INC, MV_DEC, MV_INV, MV_UMIN, MV_MUL2, MV_MUL3, MV_DIV2 } move_type;
|
||||
typedef enum { MV_FLIP = 0, MV_INC, MV_DEC, MV_INV } move_type;
|
||||
|
||||
public:
|
||||
sls_engine(ast_manager & m, params_ref const & p);
|
||||
|
@ -104,15 +109,11 @@ public:
|
|||
bool full_eval(model & mdl);
|
||||
|
||||
void mk_add(unsigned bv_sz, const mpz & old_value, mpz & add_value, mpz & result);
|
||||
void mk_mul2(unsigned bv_sz, const mpz & old_value, mpz & result);
|
||||
void mk_div2(unsigned bv_sz, const mpz & old_value, mpz & result);
|
||||
void mk_inc(unsigned bv_sz, const mpz & old_value, mpz & incremented);
|
||||
void mk_dec(unsigned bv_sz, const mpz & old_value, mpz & decremented);
|
||||
void mk_inv(unsigned bv_sz, const mpz & old_value, mpz & inverted);
|
||||
void mk_flip(sort * s, const mpz & old_value, unsigned bit, mpz & flipped);
|
||||
|
||||
void init_tracker(void);
|
||||
|
||||
lbool search(void);
|
||||
|
||||
lbool operator()();
|
||||
|
@ -120,36 +121,25 @@ public:
|
|||
|
||||
protected:
|
||||
void checkpoint();
|
||||
double get_restart_armin(unsigned cnt_restarts);
|
||||
|
||||
bool what_if(func_decl * fd, const unsigned & fd_inx, const mpz & temp,
|
||||
double & best_score, unsigned & best_const, mpz & best_value);
|
||||
bool what_if(expr * e, func_decl * fd, const mpz & temp,
|
||||
double & best_score, mpz & best_value, unsigned i);
|
||||
bool what_if_local(expr * e, func_decl * fd, const unsigned & fd_inx, const mpz & temp,
|
||||
double & best_score, unsigned & best_const, mpz & best_value);
|
||||
|
||||
double top_score();
|
||||
double rescore();
|
||||
double serious_score(func_decl * fd, const mpz & new_value);
|
||||
double incremental_score(func_decl * fd, const mpz & new_value);
|
||||
|
||||
#if _EARLY_PRUNE_
|
||||
double incremental_score_prune(func_decl * fd, const mpz & new_value);
|
||||
#endif
|
||||
double find_best_move(ptr_vector<func_decl> & to_evaluate, double score,
|
||||
unsigned & best_const, mpz & best_value, unsigned & new_bit, move_type & move);
|
||||
double find_best_move_local(expr * e, func_decl * fd, mpz & best_value, unsigned i);
|
||||
double find_best_move_local(expr * e, ptr_vector<func_decl> & to_evaluate,
|
||||
unsigned & best_const, mpz & best_value, unsigned & new_bit, move_type & move);
|
||||
double find_best_move_vns(ptr_vector<func_decl> & to_evaluate, double score,
|
||||
unsigned & best_const, mpz & best_value, unsigned & new_bit, move_type & move);
|
||||
|
||||
double find_best_move_mc(ptr_vector<func_decl> & to_evaluate, double score,
|
||||
unsigned & best_const, mpz & best_value);
|
||||
|
||||
void mk_random_move(ptr_vector<func_decl> & unsat_constants);
|
||||
void mk_random_move();
|
||||
|
||||
bool handle_plateau(void);
|
||||
bool handle_plateau(double old_score);
|
||||
|
||||
//inline double get_restart_armin(unsigned cnt_restarts);
|
||||
inline unsigned check_restart(unsigned curr_value);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue