3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-06 06:03:23 +00:00

debugging

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-06-27 13:18:20 -07:00
parent 94416bea52
commit 6f4c873b29
9 changed files with 139 additions and 102 deletions

View file

@ -381,6 +381,9 @@ namespace sat {
return l_false;
}
if (index > p.size() || num_watch > p.size()) {
std::cout << "size: " << p.size() << "index: " << index << " num watch: " << num_watch << "\n";
}
// swap out the watched literal.
--num_watch;
SASSERT(num_watch > 0);
@ -1711,6 +1714,7 @@ namespace sat {
}
void card_extension::simplify() {
return;
s().pop_to_base_level();
unsigned trail_sz;
do {

View file

@ -1734,11 +1734,14 @@ namespace sat {
}
IF_VERBOSE(1, verbose_stream() << "(sat-lookahead :units " << num_units << ")\n";);
if (num_units > 0 && !m_s.inconsistent()) {
if (m_s.inconsistent()) return;
if (num_units > 0) {
m_s.propagate_core(false);
m_s.m_simplifier(false);
}
m_lookahead.reset();
}
//

View file

@ -162,7 +162,7 @@ namespace sat {
for (unsigned i = 0; i < sz; ++i)
e.m_clauses.push_back(c[i]);
e.m_clauses.push_back(null_literal);
TRACE("sat_mc_bug", tout << "adding (wrapper): "; for (literal l : c) tout << l << " "; tout << "\n";);
// TRACE("sat_mc_bug", tout << "adding (wrapper): "; for (literal l : c) tout << l << " "; tout << "\n";);
}
bool model_converter::check_invariant(unsigned num_vars) const {

View file

@ -1415,11 +1415,17 @@ namespace sat {
}
if (m_config.m_lookahead_simplify) {
{
lookahead lh(*this);
lh.simplify();
lh.collect_statistics(m_aux_stats);
}
{
lookahead lh(*this);
lh.scc();
lh.collect_statistics(m_aux_stats);
}
}
sort_watch_lits();
CASSERT("sat_simplify_bug", check_invariant());
@ -1450,7 +1456,7 @@ namespace sat {
m_next_simplify = m_conflicts_since_init + m_config.m_simplify_max;
}
#if 1
#if 0
static unsigned file_no = 0;
#pragma omp critical (print_sat)
{

View file

@ -28,6 +28,19 @@ bound_manager::~bound_manager() {
reset();
}
bound_manager* bound_manager::translate(ast_manager& dst_m) {
bound_manager* result = alloc(bound_manager, dst_m);
ast_translation tr(m(), dst_m);
expr_dependency_translation edtr(tr);
for (auto& kv : m_lowers) result->m_lowers.insert(tr(kv.m_key), kv.m_value);
for (auto& kv : m_uppers) result->m_uppers.insert(tr(kv.m_key), kv.m_value);
for (auto& kv : m_lower_deps) result->m_lower_deps.insert(tr(kv.m_key), edtr(kv.m_value));
for (auto& kv : m_upper_deps) result->m_upper_deps.insert(tr(kv.m_key), edtr(kv.m_value));
for (expr* e : m_bounded_vars) result->m_bounded_vars.push_back(tr(e));
return result;
}
static decl_kind swap_decl(decl_kind k) {
switch (k) {
case OP_LE: return OP_GE;

View file

@ -47,6 +47,8 @@ public:
bound_manager(ast_manager & m);
~bound_manager();
bound_manager* translate(ast_manager& dst_m);
ast_manager & m() const { return m_util.get_manager(); }
void operator()(goal const & g);

View file

@ -73,8 +73,17 @@ public:
}
}
virtual solver* translate(ast_manager& m, params_ref const& p) {
return alloc(bounded_int2bv_solver, m, p, m_solver->translate(m, p));
virtual solver* translate(ast_manager& dst_m, params_ref const& p) {
flush_assertions();
bounded_int2bv_solver* result = alloc(bounded_int2bv_solver, dst_m, p, m_solver->translate(dst_m, p));
ast_translation tr(m, dst_m);
for (auto& kv : m_int2bv) result->m_int2bv.insert(tr(kv.m_key), tr(kv.m_value));
for (auto& kv : m_bv2int) result->m_bv2int.insert(tr(kv.m_key), tr(kv.m_value));
for (auto& kv : m_bv2offset) result->m_bv2offset.insert(tr(kv.m_key), kv.m_value);
for (func_decl* f : m_bv_fns) result->m_bv_fns.push_back(tr(f));
for (func_decl* f : m_int_fns) result->m_int_fns.push_back(tr(f));
for (bound_manager* b : m_bounds) result->m_bounds.push_back(b->translate(dst_m));
return result;
}
virtual void assert_expr(expr * t) {

View file

@ -49,7 +49,7 @@ public:
virtual ~pb2bv_solver() {}
virtual solver* translate(ast_manager& m, params_ref const& p) {
flush_assertions();
return alloc(pb2bv_solver, m, p, m_solver->translate(m, p));
}