3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-11 05:30:51 +00:00

pull unstable

Signed-off-by: Nikolaj Bjorner <nbjorner@hotmail.com>
This commit is contained in:
Nikolaj Bjorner 2015-04-01 14:57:11 -07:00
commit 52619b9dbb
337 changed files with 24943 additions and 30606 deletions

View file

@ -16,8 +16,7 @@ Author:
Notes:
--*/
#include<float.h>
#include<iomanip>
#include<float.h> // Need DBL_MAX
#include"map.h"
#include"ast_smt2_pp.h"
@ -570,8 +569,12 @@ void sls_engine::operator()(goal_ref const & g, model_converter_ref & mc) {
mc = 0;
}
lbool sls_engine::operator()() {
lbool sls_engine::operator()() {
m_tracker.initialize(m_assertions);
m_tracker.reset(m_assertions);
if (m_restart_init)
m_tracker.randomize(m_assertions);
lbool res = l_undef;
do {
@ -589,7 +592,7 @@ lbool sls_engine::operator()() {
}
} while (res != l_true && m_stats.m_restarts++ < m_max_restarts);
verbose_stream() << "(restarts: " << m_stats.m_restarts << " flips: " << m_stats.m_moves << " time: " << std::fixed << std::setprecision(2) << m_stats.m_stopwatch.get_current_seconds() << " fps: " << (m_stats.m_moves / m_stats.m_stopwatch.get_current_seconds()) << ")" << std::endl;
verbose_stream() << "(restarts: " << m_stats.m_restarts << " flips: " << m_stats.m_moves << " fps: " << (m_stats.m_moves / m_stats.m_stopwatch.get_current_seconds()) << ")" << std::endl;
return res;
}

View file

@ -147,8 +147,7 @@ tactic * mk_preamble(ast_manager & m, params_ref const & p) {
}
tactic * mk_qfbv_sls_tactic(ast_manager & m, params_ref const & p) {
tactic * t = and_then(mk_preamble(m, p), mk_sls_tactic(m));
//tactic * t = and_then(mk_simplify_tactic(m), mk_nnf_tactic(m, p), mk_sls_tactic(m));
tactic * t = and_then(mk_preamble(m, p), mk_sls_tactic(m, p));
t->updt_params(p);
return t;
}

View file

@ -23,8 +23,8 @@ Notes:
class ast_manager;
class tactic;
tactic * mk_sls_tactic(ast_manager & m, params_ref const & p = params_ref());
tactic * mk_qfbv_sls_tactic(ast_manager & m, params_ref const & p = params_ref());
/*
ADD_TACTIC("qfbv-sls", "(try to) solve using stochastic local search for QF_BV.", "mk_qfbv_sls_tactic(m, p)")
*/

View file

@ -40,7 +40,7 @@ class sls_tracker {
mpz m_zero, m_one, m_two;
struct value_score {
value_score() : m(0), value(unsynch_mpz_manager::mk_z(0)), score(0.0), distance(0), touched(1), score_prune(0.0), has_pos_occ(0), has_neg_occ(0) { };
value_score() : m(0), value(unsynch_mpz_manager::mk_z(0)), score(0.0), score_prune(0.0), has_pos_occ(0), has_neg_occ(0), distance(0), touched(1) {};
~value_score() { if (m) m->del(value); }
unsynch_mpz_manager * m;
mpz value;
@ -90,6 +90,7 @@ private:
unsigned m_track_unsat;
obj_map<expr, unsigned> m_weights;
double m_top_sum;
obj_hashtable<expr> m_temp_seen;
public:
sls_tracker(ast_manager & m, bv_util & bvu, unsynch_mpz_manager & mm, powers & p) :
@ -454,6 +455,7 @@ public:
}
}
m_temp_seen.reset();
for (unsigned i = 0; i < sz; i++)
{
expr * e = as[i];
@ -666,7 +668,14 @@ public:
app * a = to_app(n);
expr * const * args = a->get_args();
for (unsigned i = 0; i < a->get_num_args(); i++)
setup_occs(args[i]);
{
expr * child = args[i];
if (!m_temp_seen.contains(child))
{
setup_occs(child, false);
m_temp_seen.insert(child);
}
}
}
else if (m_manager.is_not(n))
{
@ -674,8 +683,7 @@ public:
app * a = to_app(n);
SASSERT(a->get_num_args() == 1);
expr * child = a->get_arg(0);
if (m_manager.is_and(child) || m_manager.is_or(child))
NOT_IMPLEMENTED_YET();
SASSERT(!m_manager.is_and(child) && !m_manager.is_or(child));
setup_occs(child, true);
}
else