diff --git a/src/smt/smt_consequences.cpp b/src/smt/smt_consequences.cpp index b1c277792..65dca4918 100644 --- a/src/smt/smt_consequences.cpp +++ b/src/smt/smt_consequences.cpp @@ -23,9 +23,9 @@ Revision History: namespace smt { - expr_ref context::antecedent2fml(uint_set const& vars) { + expr_ref context::antecedent2fml(index_set const& vars) { expr_ref_vector premises(m_manager); - uint_set::iterator it = vars.begin(), end = vars.end(); + index_set::iterator it = vars.begin(), end = vars.end(); for (; it != end; ++it) { expr* e = bool_var2expr(*it); premises.push_back(get_assignment(*it) != l_false ? e : m_manager.mk_not(e)); @@ -42,14 +42,14 @@ namespace smt { // - e is an equality between a variable and value that is to be fixed. // - e is a data-type recognizer of a variable that is to be fixed. // - void context::extract_fixed_consequences(literal lit, obj_map& vars, uint_set const& assumptions, expr_ref_vector& conseq) { + void context::extract_fixed_consequences(literal lit, obj_map& vars, index_set const& assumptions, expr_ref_vector& conseq) { ast_manager& m = m_manager; datatype_util dt(m); expr* e1, *e2; expr_ref fml(m); if (lit == true_literal) return; expr* e = bool_var2expr(lit.var()); - uint_set s; + index_set s; if (assumptions.contains(lit.var())) { s.insert(lit.var()); } @@ -86,7 +86,11 @@ namespace smt { } } m_antecedents.insert(lit.var(), s); - TRACE("context", display_literal_verbose(tout, lit); tout << " " << s << "\n";); + TRACE("context", display_literal_verbose(tout, lit); + for (index_set::iterator it = s.begin(), end = s.end(); it != end; ++it) { + tout << " " << *it; + } + tout << "\n";); bool found = false; if (vars.contains(e)) { found = true; @@ -116,7 +120,7 @@ namespace smt { } } - void context::extract_fixed_consequences(unsigned& start, obj_map& vars, uint_set const& assumptions, expr_ref_vector& conseq) { + void context::extract_fixed_consequences(unsigned& start, obj_map& vars, index_set const& assumptions, expr_ref_vector& conseq) { pop_to_search_lvl(); SASSERT(!inconsistent()); literal_vector const& lits = assigned_literals(); @@ -204,7 +208,7 @@ namespace smt { if (!m.is_bool(k) && are_equal(k, v)) { literal_vector literals; m_conflict_resolution->eq2literals(get_enode(v), get_enode(k), literals); - uint_set s; + index_set s; for (unsigned i = 0; i < literals.size(); ++i) { SASSERT(get_assign_level(literals[i]) <= get_search_level()); s |= m_antecedents.find(literals[i].var()); @@ -254,7 +258,7 @@ namespace smt { return is_sat; } obj_map var2val; - uint_set _assumptions; + index_set _assumptions; for (unsigned i = 0; i < assumptions.size(); ++i) { _assumptions.insert(get_literal(assumptions[i]).var()); } @@ -440,7 +444,7 @@ namespace smt { return is_sat; } obj_map var2val; - uint_set _assumptions; + index_set _assumptions; for (unsigned i = 0; i < assumptions.size(); ++i) { _assumptions.insert(get_literal(assumptions[i]).var()); } diff --git a/src/smt/smt_context.h b/src/smt/smt_context.h index 01471c603..98093d6ed 100644 --- a/src/smt/smt_context.h +++ b/src/smt/smt_context.h @@ -1343,10 +1343,12 @@ namespace smt { static literal translate_literal( literal lit, context& src_ctx, context& dst_ctx, vector b2v, ast_translation& tr); - - u_map m_antecedents; - void extract_fixed_consequences(literal lit, obj_map& var2val, uint_set const& assumptions, expr_ref_vector& conseq); - void extract_fixed_consequences(unsigned& idx, obj_map& var2val, uint_set const& assumptions, expr_ref_vector& conseq); + + typedef hashtable index_set; + //typedef uint_set index_set; + u_map m_antecedents; + void extract_fixed_consequences(literal lit, obj_map& var2val, index_set const& assumptions, expr_ref_vector& conseq); + void extract_fixed_consequences(unsigned& idx, obj_map& var2val, index_set const& assumptions, expr_ref_vector& conseq); void display_consequence_progress(std::ostream& out, unsigned it, unsigned nv, unsigned fixed, unsigned unfixed, unsigned eq); @@ -1354,7 +1356,7 @@ namespace smt { unsigned extract_fixed_eqs(obj_map& var2val, expr_ref_vector& conseq); - expr_ref antecedent2fml(uint_set const& ante); + expr_ref antecedent2fml(index_set const& ante); literal mk_diseq(expr* v, expr* val); diff --git a/src/util/hashtable.h b/src/util/hashtable.h index ddf40f39f..44e05319d 100644 --- a/src/util/hashtable.h +++ b/src/util/hashtable.h @@ -558,14 +558,13 @@ public: core_hashtable& operator|=(core_hashtable const& other) { if (this == &other) return *this; - iterator i = begin(), e = end(); + iterator i = other.begin(), e = other.end(); for (; i != e; ++i) { insert(*i); } return *this; } - core_hashtable& operator&=(core_hashtable const& other) { if (this == &other) return *this; core_hashtable copy(*this);