mirror of
https://github.com/Z3Prover/z3
synced 2025-08-22 02:57:50 +00:00
remove template Context dependency in every trail object
This commit is contained in:
parent
df0a449f70
commit
a152bb1e80
65 changed files with 413 additions and 413 deletions
|
@ -47,7 +47,7 @@ namespace arith {
|
|||
get_one(false);
|
||||
get_zero(true);
|
||||
get_zero(false);
|
||||
ctx.push(value_trail<euf::solver, bool>(m_internalize_initialized));
|
||||
ctx.push(value_trail<bool>(m_internalize_initialized));
|
||||
m_internalize_initialized = true;
|
||||
}
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ namespace arith {
|
|||
}
|
||||
|
||||
void solver::found_unsupported(expr* n) {
|
||||
ctx.push(value_trail<euf::solver, expr*>(m_not_handled));
|
||||
ctx.push(value_trail<expr*>(m_not_handled));
|
||||
TRACE("arith", tout << "unsupported " << mk_pp(n, m) << "\n";);
|
||||
m_not_handled = n;
|
||||
}
|
||||
|
@ -125,7 +125,7 @@ namespace arith {
|
|||
if (var != UINT_MAX) {
|
||||
return var;
|
||||
}
|
||||
ctx.push(value_trail<euf::solver, lpvar>(var));
|
||||
ctx.push(value_trail<lpvar>(var));
|
||||
app_ref cnst(a.mk_numeral(rational(c), is_int), m);
|
||||
mk_enode(cnst);
|
||||
theory_var v = mk_evar(cnst);
|
||||
|
|
|
@ -423,7 +423,7 @@ namespace arith {
|
|||
if (b.first == UINT_MAX || (is_lower ? b.second < v : b.second > v)) {
|
||||
TRACE("arith", tout << "tighter bound " << tv.to_string() << "\n";);
|
||||
m_history.push_back(vec[ti]);
|
||||
ctx.push(history_trail<euf::solver, constraint_bound>(vec, ti, m_history));
|
||||
ctx.push(history_trail<constraint_bound>(vec, ti, m_history));
|
||||
b.first = ci;
|
||||
b.second = v;
|
||||
}
|
||||
|
@ -765,7 +765,7 @@ namespace arith {
|
|||
|
||||
void solver::updt_unassigned_bounds(theory_var v, int inc) {
|
||||
TRACE("arith_verbose", tout << "v" << v << " " << m_unassigned_bounds[v] << " += " << inc << "\n";);
|
||||
ctx.push(vector_value_trail<euf::solver, unsigned, false>(m_unassigned_bounds, v));
|
||||
ctx.push(vector_value_trail<unsigned, false>(m_unassigned_bounds, v));
|
||||
m_unassigned_bounds[v] += inc;
|
||||
}
|
||||
|
||||
|
@ -792,7 +792,7 @@ namespace arith {
|
|||
void solver::init_model() {
|
||||
if (m.inc() && m_solver.get() && get_num_vars() > 0) {
|
||||
TRACE("arith", display(tout << "update variable values\n"););
|
||||
ctx.push(value_trail<euf::solver, bool>(m_model_is_initialized));
|
||||
ctx.push(value_trail<bool>(m_model_is_initialized));
|
||||
m_model_is_initialized = true;
|
||||
lp().init_model();
|
||||
}
|
||||
|
@ -895,7 +895,7 @@ namespace arith {
|
|||
}
|
||||
|
||||
if (m_assume_eq_candidates.size() > old_sz)
|
||||
ctx.push(restore_size_trail<euf::solver, std::pair<theory_var, theory_var>, false>(m_assume_eq_candidates, old_sz));
|
||||
ctx.push(restore_size_trail<std::pair<theory_var, theory_var>, false>(m_assume_eq_candidates, old_sz));
|
||||
|
||||
return delayed_assume_eqs();
|
||||
}
|
||||
|
@ -904,7 +904,7 @@ namespace arith {
|
|||
if (m_assume_eq_head == m_assume_eq_candidates.size())
|
||||
return false;
|
||||
|
||||
ctx.push(value_trail<euf::solver, unsigned>(m_assume_eq_head));
|
||||
ctx.push(value_trail<unsigned>(m_assume_eq_head));
|
||||
while (m_assume_eq_head < m_assume_eq_candidates.size()) {
|
||||
std::pair<theory_var, theory_var> const& p = m_assume_eq_candidates[m_assume_eq_head];
|
||||
theory_var v1 = p.first;
|
||||
|
|
|
@ -28,14 +28,14 @@ namespace array {
|
|||
if (m_axioms.contains(idx))
|
||||
m_axiom_trail.pop_back();
|
||||
else
|
||||
ctx.push(push_back_vector<euf::solver, svector<axiom_record>>(m_axiom_trail));
|
||||
ctx.push(push_back_vector<svector<axiom_record>>(m_axiom_trail));
|
||||
}
|
||||
|
||||
bool solver::propagate_axiom(unsigned idx) {
|
||||
if (m_axioms.contains(idx))
|
||||
return false;
|
||||
m_axioms.insert(idx);
|
||||
ctx.push(insert_map<euf::solver, axiom_table_t, unsigned>(m_axioms, idx));
|
||||
ctx.push(insert_map<axiom_table_t, unsigned>(m_axioms, idx));
|
||||
return assert_axiom(idx);
|
||||
}
|
||||
|
||||
|
@ -75,11 +75,11 @@ namespace array {
|
|||
return false;
|
||||
}
|
||||
|
||||
struct solver::set_delay_bit : trail<euf::solver> {
|
||||
struct solver::set_delay_bit : trail {
|
||||
solver& s;
|
||||
unsigned m_idx;
|
||||
set_delay_bit(solver& s, unsigned idx) : s(s), m_idx(idx) {}
|
||||
void undo(euf::solver& euf) override {
|
||||
void undo(/*euf::solver& euf*/) override {
|
||||
s.m_axiom_trail[m_idx].m_delayed = false;
|
||||
}
|
||||
};
|
||||
|
@ -458,11 +458,11 @@ namespace array {
|
|||
func_decl* diag = nullptr;
|
||||
if (!m_sort2epsilon.find(s, eps)) {
|
||||
eps = m.mk_fresh_const("epsilon", s);
|
||||
ctx.push(ast2ast_trail<euf::solver, sort, app>(m_sort2epsilon, s, eps));
|
||||
ctx.push(ast2ast_trail<sort, app>(m_sort2epsilon, s, eps));
|
||||
}
|
||||
if (!m_sort2diag.find(s, diag)) {
|
||||
diag = m.mk_fresh_func_decl("diag", 1, &s, s);
|
||||
ctx.push(ast2ast_trail<euf::solver, sort, func_decl>(m_sort2diag, s, diag));
|
||||
ctx.push(ast2ast_trail<sort, func_decl>(m_sort2diag, s, diag));
|
||||
}
|
||||
return std::make_pair(eps, diag);
|
||||
}
|
||||
|
|
|
@ -210,8 +210,8 @@ namespace array {
|
|||
for (unsigned i = 0; i < dimension; ++i)
|
||||
result->push_back(a.mk_array_ext(s, i));
|
||||
m_sort2diff.insert(s, result);
|
||||
ctx.push(insert_map<euf::solver, obj_map<sort, func_decl_ref_vector*>, sort*>(m_sort2diff, s));
|
||||
ctx.push(new_obj_trail<euf::solver,func_decl_ref_vector>(result));
|
||||
ctx.push(insert_map<obj_map<sort, func_decl_ref_vector*>, sort*>(m_sort2diff, s));
|
||||
ctx.push(new_obj_trail<func_decl_ref_vector>(result));
|
||||
return *result;
|
||||
}
|
||||
|
||||
|
|
|
@ -176,7 +176,7 @@ namespace array {
|
|||
return false;
|
||||
force_push();
|
||||
bool prop = false;
|
||||
ctx.push(value_trail<euf::solver, unsigned>(m_qhead));
|
||||
ctx.push(value_trail<unsigned>(m_qhead));
|
||||
for (; m_qhead < m_axiom_trail.size() && !s().inconsistent(); ++m_qhead)
|
||||
if (propagate_axiom(m_qhead))
|
||||
prop = true;
|
||||
|
@ -269,7 +269,7 @@ namespace array {
|
|||
auto& d = get_var_data(find(v));
|
||||
if (d.m_prop_upward)
|
||||
return;
|
||||
ctx.push(reset_flag_trail<euf::solver>(d.m_prop_upward));
|
||||
ctx.push(reset_flag_trail(d.m_prop_upward));
|
||||
d.m_prop_upward = true;
|
||||
if (should_prop_upward(d))
|
||||
propagate_parent_select_axioms(v);
|
||||
|
|
|
@ -345,9 +345,9 @@ namespace bv {
|
|||
|
||||
void solver::set_delay_internalize(expr* e, internalize_mode mode) {
|
||||
if (!m_delay_internalize.contains(e))
|
||||
ctx.push(insert_obj_map<euf::solver, expr, internalize_mode>(m_delay_internalize, e));
|
||||
ctx.push(insert_obj_map<expr, internalize_mode>(m_delay_internalize, e));
|
||||
else
|
||||
ctx.push(remove_obj_map<euf::solver, expr, internalize_mode>(m_delay_internalize, e, m_delay_internalize[e]));
|
||||
ctx.push(remove_obj_map<expr, internalize_mode>(m_delay_internalize, e, m_delay_internalize[e]));
|
||||
m_delay_internalize.insert(e, mode);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,21 +23,21 @@ Author:
|
|||
|
||||
namespace bv {
|
||||
|
||||
class solver::add_var_pos_trail : public trail<euf::solver> {
|
||||
class solver::add_var_pos_trail : public trail {
|
||||
solver::atom* m_atom;
|
||||
public:
|
||||
add_var_pos_trail(solver::atom* a) :m_atom(a) {}
|
||||
void undo(euf::solver& euf) override {
|
||||
void undo() override {
|
||||
SASSERT(m_atom->m_occs);
|
||||
m_atom->m_occs = m_atom->m_occs->m_next;
|
||||
}
|
||||
};
|
||||
|
||||
class solver::add_eq_occurs_trail : public trail<euf::solver> {
|
||||
class solver::add_eq_occurs_trail : public trail {
|
||||
atom* m_atom;
|
||||
public:
|
||||
add_eq_occurs_trail(atom* a) :m_atom(a) {}
|
||||
void undo(euf::solver& euf) override {
|
||||
void undo() override {
|
||||
SASSERT(m_atom->m_eqs);
|
||||
m_atom->m_eqs = m_atom->m_eqs->m_next;
|
||||
if (m_atom->m_eqs)
|
||||
|
@ -45,12 +45,12 @@ namespace bv {
|
|||
}
|
||||
};
|
||||
|
||||
class solver::del_eq_occurs_trail : public trail<euf::solver> {
|
||||
class solver::del_eq_occurs_trail : public trail {
|
||||
atom* m_atom;
|
||||
eq_occurs* m_node;
|
||||
public:
|
||||
del_eq_occurs_trail(atom* a, eq_occurs* n) : m_atom(a), m_node(n) {}
|
||||
void undo(euf::solver& euf) override {
|
||||
void undo() override {
|
||||
if (m_node->m_next)
|
||||
m_node->m_next->m_prev = m_node;
|
||||
if (m_node->m_prev)
|
||||
|
@ -71,12 +71,12 @@ namespace bv {
|
|||
ctx.push(del_eq_occurs_trail(a, occ));
|
||||
}
|
||||
|
||||
class solver::mk_atom_trail : public trail<euf::solver> {
|
||||
class solver::mk_atom_trail : public trail {
|
||||
solver& th;
|
||||
sat::bool_var m_var;
|
||||
public:
|
||||
mk_atom_trail(sat::bool_var v, solver& th) : th(th), m_var(v) {}
|
||||
void undo(euf::solver& euf) override {
|
||||
void undo() override {
|
||||
solver::atom* a = th.get_bv2a(m_var);
|
||||
a->~atom();
|
||||
th.erase_bv2a(m_var);
|
||||
|
|
|
@ -24,7 +24,7 @@ Author:
|
|||
|
||||
namespace bv {
|
||||
|
||||
class solver::bit_trail : public trail<euf::solver> {
|
||||
class solver::bit_trail : public trail {
|
||||
solver& s;
|
||||
solver::var_pos vp;
|
||||
sat::literal lit;
|
||||
|
@ -36,14 +36,14 @@ namespace bv {
|
|||
}
|
||||
};
|
||||
|
||||
class solver::bit_occs_trail : public trail<euf::solver> {
|
||||
class solver::bit_occs_trail : public trail {
|
||||
atom& a;
|
||||
var_pos_occ* m_occs;
|
||||
|
||||
public:
|
||||
bit_occs_trail(solver& s, atom& a): a(a), m_occs(a.m_occs) {}
|
||||
|
||||
virtual void undo(euf::solver& euf) {
|
||||
virtual void undo() {
|
||||
a.m_occs = m_occs;
|
||||
}
|
||||
};
|
||||
|
@ -413,7 +413,7 @@ namespace bv {
|
|||
if (m_prop_queue_head == m_prop_queue.size())
|
||||
return false;
|
||||
force_push();
|
||||
ctx.push(value_trail<euf::solver, unsigned>(m_prop_queue_head));
|
||||
ctx.push(value_trail<unsigned>(m_prop_queue_head));
|
||||
for (; m_prop_queue_head < m_prop_queue.size() && !s().inconsistent(); ++m_prop_queue_head) {
|
||||
auto const p = m_prop_queue[m_prop_queue_head];
|
||||
if (p.m_atom) {
|
||||
|
@ -559,7 +559,7 @@ namespace bv {
|
|||
SASSERT(l2.var() == l.var());
|
||||
VERIFY(l2.var() == l.var());
|
||||
sat::literal r2 = (l.sign() == l2.sign()) ? r : ~r;
|
||||
ctx.push(vector2_value_trail<euf::solver, bits_vector, sat::literal>(m_bits, vp.first, vp.second));
|
||||
ctx.push(vector2_value_trail<bits_vector, sat::literal>(m_bits, vp.first, vp.second));
|
||||
m_bits[vp.first][vp.second] = r2;
|
||||
set_bit_eh(vp.first, r2, vp.second);
|
||||
}
|
||||
|
|
|
@ -372,7 +372,7 @@ namespace dt {
|
|||
}
|
||||
SASSERT(val == l_undef || (val == l_false && d->m_constructor == nullptr));
|
||||
d->m_recognizers[c_idx] = recognizer;
|
||||
ctx.push(set_vector_idx_trail<euf::solver, enode>(d->m_recognizers, c_idx));
|
||||
ctx.push(set_vector_idx_trail<enode>(d->m_recognizers, c_idx));
|
||||
if (val == l_false)
|
||||
propagate_recognizer(v, recognizer);
|
||||
}
|
||||
|
@ -455,7 +455,7 @@ namespace dt {
|
|||
auto* con2 = d2->m_constructor;
|
||||
if (con2 != nullptr) {
|
||||
if (con1 == nullptr) {
|
||||
ctx.push(set_ptr_trail<euf::solver, enode>(con1));
|
||||
ctx.push(set_ptr_trail<enode>(con1));
|
||||
// check whether there is a recognizer in d1 that conflicts with con2;
|
||||
if (!d1->m_recognizers.empty()) {
|
||||
unsigned c_idx = dt.get_constructor_idx(con2->get_decl());
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace euf {
|
|||
get_drat().def_add_arg(arg->get_id());
|
||||
get_drat().def_end();
|
||||
m_drat_asts.insert(e);
|
||||
push(insert_obj_trail<solver, ast>(m_drat_asts, e));
|
||||
push(insert_obj_trail<ast>(m_drat_asts, e));
|
||||
}
|
||||
else {
|
||||
IF_VERBOSE(0, verbose_stream() << "logging binders is TBD\n");
|
||||
|
@ -82,7 +82,7 @@ namespace euf {
|
|||
if (m_drat_asts.contains(f))
|
||||
return;
|
||||
m_drat_asts.insert(f);
|
||||
push(insert_obj_trail<solver, ast>(m_drat_asts, f));
|
||||
push(insert_obj_trail< ast>(m_drat_asts, f));
|
||||
std::ostringstream strm;
|
||||
smt2_pp_environment_dbg env(m);
|
||||
ast_smt2_pp(strm, f, env);
|
||||
|
|
|
@ -141,7 +141,7 @@ namespace euf {
|
|||
if (m.is_model_value(f))
|
||||
return;
|
||||
m_unhandled_functions.push_back(f);
|
||||
m_trail.push(push_back_vector<solver, func_decl_ref_vector>(m_unhandled_functions));
|
||||
m_trail.push(push_back_vector<func_decl_ref_vector>(m_unhandled_functions));
|
||||
IF_VERBOSE(0, verbose_stream() << mk_pp(f, m) << " not handled\n");
|
||||
}
|
||||
|
||||
|
|
|
@ -247,12 +247,12 @@ namespace euf {
|
|||
template <typename V>
|
||||
void push_vec(ptr_vector<V>& vec, V* val) {
|
||||
vec.push_back(val);
|
||||
push(push_back_trail<solver, V*, false>(vec));
|
||||
push(push_back_trail< V*, false>(vec));
|
||||
}
|
||||
template <typename V>
|
||||
void push_vec(svector<V>& vec, V val) {
|
||||
vec.push_back(val);
|
||||
push(push_back_trail<solver, V, false>(vec));
|
||||
push(push_back_trail< V, false>(vec));
|
||||
}
|
||||
euf_trail_stack& get_trail_stack() { return m_trail; }
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ namespace fpa {
|
|||
m.inc_ref(e);
|
||||
m.inc_ref(res);
|
||||
|
||||
ctx.push(insert_ref2_map<euf::solver, ast_manager, expr, expr>(m, m_conversions, e, res.get()));
|
||||
ctx.push(insert_ref2_map<ast_manager, expr, expr>(m, m_conversions, e, res.get()));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -120,12 +120,12 @@ namespace q {
|
|||
return out;
|
||||
}
|
||||
|
||||
struct restore_watch : public trail<euf::solver> {
|
||||
struct restore_watch : public trail {
|
||||
vector<unsigned_vector>& v;
|
||||
unsigned idx, offset;
|
||||
restore_watch(vector<unsigned_vector>& v, unsigned idx):
|
||||
v(v), idx(idx), offset(v[idx].size()) {}
|
||||
void undo(euf::solver& ctx) override {
|
||||
void undo() override {
|
||||
v[idx].shrink(offset);
|
||||
}
|
||||
};
|
||||
|
@ -191,20 +191,20 @@ namespace q {
|
|||
}
|
||||
}
|
||||
|
||||
struct ematch::remove_binding : public trail<euf::solver> {
|
||||
struct ematch::remove_binding : public trail {
|
||||
clause& c;
|
||||
binding* b;
|
||||
remove_binding(clause& c, binding* b): c(c), b(b) {}
|
||||
void undo(euf::solver& ctx) override {
|
||||
void undo() override {
|
||||
binding::remove_from(c.m_bindings, b);
|
||||
}
|
||||
};
|
||||
|
||||
struct ematch::insert_binding : public trail<euf::solver> {
|
||||
struct ematch::insert_binding : public trail {
|
||||
clause& c;
|
||||
binding* b;
|
||||
insert_binding(clause& c, binding* b): c(c), b(b) {}
|
||||
void undo(euf::solver& ctx) override {
|
||||
void undo() override {
|
||||
binding::push_to_front(c.m_bindings, b);
|
||||
}
|
||||
};
|
||||
|
@ -306,7 +306,7 @@ namespace q {
|
|||
return nullptr;
|
||||
fingerprint* f = new (ctx.get_region()) fingerprint(c, b, max_generation);
|
||||
m_fingerprints.insert(f);
|
||||
ctx.push(insert_map<euf::solver, fingerprints, fingerprint*>(m_fingerprints, f));
|
||||
ctx.push(insert_map<fingerprints, fingerprint*>(m_fingerprints, f));
|
||||
return f;
|
||||
}
|
||||
|
||||
|
@ -328,11 +328,11 @@ namespace q {
|
|||
return l.sign ? ~ctx.mk_literal(fml) : ctx.mk_literal(fml);
|
||||
}
|
||||
|
||||
struct ematch::reset_in_queue : public trail<euf::solver> {
|
||||
struct ematch::reset_in_queue : public trail {
|
||||
ematch& e;
|
||||
reset_in_queue(ematch& e) :e(e) {}
|
||||
|
||||
void undo(euf::solver& ctx) override {
|
||||
void undo() override {
|
||||
e.m_node_in_queue.reset();
|
||||
e.m_clause_in_queue.reset();
|
||||
e.m_in_queue_set = false;
|
||||
|
@ -362,7 +362,7 @@ namespace q {
|
|||
if (!m_clause_in_queue.contains(idx)) {
|
||||
m_clause_in_queue.insert(idx);
|
||||
m_clause_queue.push_back(idx);
|
||||
ctx.push(push_back_vector<euf::solver, unsigned_vector>(m_clause_queue));
|
||||
ctx.push(push_back_vector<unsigned_vector>(m_clause_queue));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -418,10 +418,10 @@ namespace q {
|
|||
}
|
||||
}
|
||||
|
||||
struct ematch::pop_clause : public trail<euf::solver> {
|
||||
struct ematch::pop_clause : public trail {
|
||||
ematch& em;
|
||||
pop_clause(ematch& em): em(em) {}
|
||||
void undo(euf::solver& ctx) override {
|
||||
void undo() override {
|
||||
em.m_q2clauses.remove(em.m_clauses.back()->q());
|
||||
dealloc(em.m_clauses.back());
|
||||
em.m_clauses.pop_back();
|
||||
|
@ -472,7 +472,7 @@ namespace q {
|
|||
bool propagated = false;
|
||||
if (m_qhead >= m_clause_queue.size())
|
||||
return m_inst_queue.propagate();
|
||||
ctx.push(value_trail<euf::solver, unsigned>(m_qhead));
|
||||
ctx.push(value_trail<unsigned>(m_qhead));
|
||||
ptr_buffer<binding> to_remove;
|
||||
for (; m_qhead < m_clause_queue.size(); ++m_qhead) {
|
||||
unsigned idx = m_clause_queue[m_qhead];
|
||||
|
|
|
@ -75,9 +75,9 @@ namespace q {
|
|||
|
||||
|
||||
template<typename T>
|
||||
class mam_value_trail : public value_trail<euf::solver, T> {
|
||||
class mam_value_trail : public value_trail<T> {
|
||||
public:
|
||||
mam_value_trail(T & value):value_trail<euf::solver, T>(value) {}
|
||||
mam_value_trail(T & value):value_trail<T>(value) {}
|
||||
};
|
||||
|
||||
unsigned get_max_generation(unsigned n, enode* const* nodes) {
|
||||
|
@ -2812,12 +2812,12 @@ namespace q {
|
|||
egraph * m_egraph;
|
||||
#endif
|
||||
|
||||
class mk_tree_trail : public trail<euf::solver> {
|
||||
class mk_tree_trail : public trail {
|
||||
ptr_vector<code_tree> & m_trees;
|
||||
unsigned m_lbl_id;
|
||||
public:
|
||||
mk_tree_trail(ptr_vector<code_tree> & t, unsigned id):m_trees(t), m_lbl_id(id) {}
|
||||
void undo(euf::solver & m) override {
|
||||
void undo() override {
|
||||
dealloc(m_trees[m_lbl_id]);
|
||||
m_trees[m_lbl_id] = nullptr;
|
||||
}
|
||||
|
@ -2871,7 +2871,7 @@ namespace q {
|
|||
}
|
||||
}
|
||||
DEBUG_CODE(m_trees[lbl_id]->get_patterns().push_back(mp);
|
||||
ctx.push(push_back_trail<euf::solver, app*, false>(m_trees[lbl_id]->get_patterns())););
|
||||
ctx.push(push_back_trail<app*, false>(m_trees[lbl_id]->get_patterns())););
|
||||
TRACE("trigger_bug", tout << "after add_pattern, first_idx: " << first_idx << "\n"; m_trees[lbl_id]->display(tout););
|
||||
}
|
||||
|
||||
|
@ -3067,11 +3067,11 @@ namespace q {
|
|||
enode * m_other { nullptr }; // temp field
|
||||
bool m_check_missing_instances { false };
|
||||
|
||||
class reset_to_match : public trail<euf::solver> {
|
||||
class reset_to_match : public trail {
|
||||
mam_impl& i;
|
||||
public:
|
||||
reset_to_match(mam_impl& i):i(i) {}
|
||||
void undo(euf::solver& ctx) override {
|
||||
void undo() override {
|
||||
if (i.m_to_match.empty())
|
||||
return;
|
||||
for (code_tree* t : i.m_to_match)
|
||||
|
@ -3080,11 +3080,11 @@ namespace q {
|
|||
}
|
||||
};
|
||||
|
||||
class reset_new_patterns : public trail<euf::solver> {
|
||||
class reset_new_patterns : public trail {
|
||||
mam_impl& i;
|
||||
public:
|
||||
reset_new_patterns(mam_impl& i):i(i) {}
|
||||
void undo(euf::solver& ctx) override {
|
||||
void undo() override {
|
||||
i.m_new_patterns.reset();
|
||||
}
|
||||
};
|
||||
|
@ -3139,7 +3139,7 @@ namespace q {
|
|||
TRACE("mam_bug", tout << "update_clbls: " << lbl->get_name() << " is already clbl: " << m_is_clbl[lbl_id] << "\n";);
|
||||
if (m_is_clbl[lbl_id])
|
||||
return;
|
||||
ctx.push(set_bitvector_trail<euf::solver>(m_is_clbl, lbl_id));
|
||||
ctx.push(set_bitvector_trail(m_is_clbl, lbl_id));
|
||||
SASSERT(m_is_clbl[lbl_id]);
|
||||
unsigned h = m_lbl_hasher(lbl);
|
||||
for (enode* app : m_egraph.enodes_of(lbl)) {
|
||||
|
@ -3180,7 +3180,7 @@ namespace q {
|
|||
TRACE("mam_bug", tout << "update_plbls: " << lbl->get_name() << " is already plbl: " << m_is_plbl[lbl_id] << "\n";);
|
||||
if (m_is_plbl[lbl_id])
|
||||
return;
|
||||
ctx.push(set_bitvector_trail<euf::solver>(m_is_plbl, lbl_id));
|
||||
ctx.push(set_bitvector_trail(m_is_plbl, lbl_id));
|
||||
SASSERT(m_is_plbl[lbl_id]);
|
||||
SASSERT(is_plbl(lbl));
|
||||
unsigned h = m_lbl_hasher(lbl);
|
||||
|
@ -3227,7 +3227,7 @@ namespace q {
|
|||
p = p->m_child;
|
||||
}
|
||||
curr->m_code = mk_code(qa, mp, pat_idx);
|
||||
ctx.push(new_obj_trail<euf::solver, code_tree>(curr->m_code));
|
||||
ctx.push(new_obj_trail<code_tree>(curr->m_code));
|
||||
return head;
|
||||
}
|
||||
|
||||
|
@ -3250,7 +3250,7 @@ namespace q {
|
|||
insert_code(t, qa, mp, p->m_pattern_idx);
|
||||
}
|
||||
else {
|
||||
ctx.push(set_ptr_trail<euf::solver, path_tree>(t->m_first_child));
|
||||
ctx.push(set_ptr_trail<path_tree>(t->m_first_child));
|
||||
t->m_first_child = mk_path_tree(p->m_child, qa, mp);
|
||||
}
|
||||
}
|
||||
|
@ -3260,9 +3260,9 @@ namespace q {
|
|||
insert_code(t, qa, mp, p->m_pattern_idx);
|
||||
}
|
||||
else {
|
||||
ctx.push(set_ptr_trail<euf::solver, code_tree>(t->m_code));
|
||||
ctx.push(set_ptr_trail<code_tree>(t->m_code));
|
||||
t->m_code = mk_code(qa, mp, p->m_pattern_idx);
|
||||
ctx.push(new_obj_trail<euf::solver, code_tree>(t->m_code));
|
||||
ctx.push(new_obj_trail<code_tree>(t->m_code));
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -3275,10 +3275,10 @@ namespace q {
|
|||
prev_sibling = t;
|
||||
t = t->m_sibling;
|
||||
}
|
||||
ctx.push(set_ptr_trail<euf::solver, path_tree>(prev_sibling->m_sibling));
|
||||
ctx.push(set_ptr_trail<path_tree>(prev_sibling->m_sibling));
|
||||
prev_sibling->m_sibling = mk_path_tree(p, qa, mp);
|
||||
if (!found_label) {
|
||||
ctx.push(value_trail<euf::solver, approx_set>(head->m_filter));
|
||||
ctx.push(value_trail<approx_set>(head->m_filter));
|
||||
head->m_filter.insert(m_lbl_hasher(p->m_label));
|
||||
}
|
||||
}
|
||||
|
@ -3288,7 +3288,7 @@ namespace q {
|
|||
insert(m_pc[h1][h2], p, qa, mp);
|
||||
}
|
||||
else {
|
||||
ctx.push(set_ptr_trail<euf::solver, path_tree>(m_pc[h1][h2]));
|
||||
ctx.push(set_ptr_trail<path_tree>(m_pc[h1][h2]));
|
||||
m_pc[h1][h2] = mk_path_tree(p, qa, mp);
|
||||
}
|
||||
TRACE("mam_path_tree_updt",
|
||||
|
@ -3305,7 +3305,7 @@ namespace q {
|
|||
insert(m_pp[h1][h2].first, p2, qa, mp);
|
||||
}
|
||||
else {
|
||||
ctx.push(set_ptr_trail<euf::solver, path_tree>(m_pp[h1][h2].first));
|
||||
ctx.push(set_ptr_trail<path_tree>(m_pp[h1][h2].first));
|
||||
m_pp[h1][h2].first = mk_path_tree(p1, qa, mp);
|
||||
insert(m_pp[h1][h2].first, p2, qa, mp);
|
||||
}
|
||||
|
@ -3323,8 +3323,8 @@ namespace q {
|
|||
}
|
||||
else {
|
||||
SASSERT(m_pp[h1][h2].second == nullptr);
|
||||
ctx.push(set_ptr_trail<euf::solver, path_tree>(m_pp[h1][h2].first));
|
||||
ctx.push(set_ptr_trail<euf::solver, path_tree>(m_pp[h1][h2].second));
|
||||
ctx.push(set_ptr_trail<path_tree>(m_pp[h1][h2].first));
|
||||
ctx.push(set_ptr_trail<path_tree>(m_pp[h1][h2].second));
|
||||
m_pp[h1][h2].first = mk_path_tree(p1, qa, mp);
|
||||
m_pp[h1][h2].second = mk_path_tree(p2, qa, mp);
|
||||
}
|
||||
|
|
|
@ -247,8 +247,8 @@ namespace q {
|
|||
var_subst subst(m);
|
||||
result = alloc(q_body, m);
|
||||
m_q2body.insert(q, result);
|
||||
ctx.push(new_obj_trail<euf::solver, q_body>(result));
|
||||
ctx.push(insert_obj_map<euf::solver, quantifier, q_body*>(m_q2body, q));
|
||||
ctx.push(new_obj_trail<q_body>(result));
|
||||
ctx.push(insert_obj_map<quantifier, q_body*>(m_q2body, q));
|
||||
app_ref_vector& vars = result->vars;
|
||||
vars.resize(sz, nullptr);
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
|
|
|
@ -98,8 +98,8 @@ namespace q {
|
|||
if (!m_q2info.find(q, info)) {
|
||||
info = alloc(quantifier_macro_info, m, m_qs.flatten(q));
|
||||
m_q2info.insert(q, info);
|
||||
ctx.push(new_obj_trail<euf::solver, quantifier_macro_info>(info));
|
||||
ctx.push(insert_obj_map<euf::solver, quantifier, quantifier_macro_info*>(m_q2info, q));
|
||||
ctx.push(new_obj_trail<quantifier_macro_info>(info));
|
||||
ctx.push(insert_obj_map<quantifier, quantifier_macro_info*>(m_q2info, q));
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
@ -200,8 +200,8 @@ namespace q {
|
|||
if (!proj)
|
||||
return nullptr;
|
||||
m_projections.insert(srt, proj);
|
||||
ctx.push(new_obj_trail<euf::solver, projection_function>(proj));
|
||||
ctx.push(insert_obj_map<euf::solver, sort, projection_function*>(m_projections, srt));
|
||||
ctx.push(new_obj_trail<projection_function>(proj));
|
||||
ctx.push(insert_obj_map<sort, projection_function*>(m_projections, srt));
|
||||
return proj;
|
||||
}
|
||||
|
||||
|
|
|
@ -121,10 +121,10 @@ namespace q {
|
|||
return std::max(f.m_max_generation + 1, static_cast<unsigned>(r));
|
||||
}
|
||||
|
||||
struct queue::reset_new_entries : public trail<euf::solver> {
|
||||
struct queue::reset_new_entries : public trail {
|
||||
svector<entry>& m_entries;
|
||||
reset_new_entries(svector<entry>& e): m_entries(e) {}
|
||||
void undo(euf::solver& ctx) override {
|
||||
void undo() override {
|
||||
m_entries.reset();
|
||||
}
|
||||
};
|
||||
|
@ -189,18 +189,18 @@ namespace q {
|
|||
else {
|
||||
TRACE("q", tout << "delaying quantifier instantiation... " << f << "\n" << mk_pp(f.q(), m) << "\ncost: " << curr.m_cost << "\n";);
|
||||
m_delayed_entries.push_back(curr);
|
||||
ctx.push(push_back_vector<euf::solver,svector<entry>>(m_delayed_entries));
|
||||
ctx.push(push_back_vector<svector<entry>>(m_delayed_entries));
|
||||
}
|
||||
}
|
||||
m_new_entries.reset();
|
||||
return true;
|
||||
}
|
||||
|
||||
struct queue::reset_instantiated : public trail<euf::solver> {
|
||||
struct queue::reset_instantiated : public trail {
|
||||
queue& q;
|
||||
unsigned idx;
|
||||
reset_instantiated(queue& q, unsigned idx): q(q), idx(idx) {}
|
||||
void undo(euf::solver& ctx) override {
|
||||
void undo() override {
|
||||
q.m_delayed_entries[idx].m_instantiated = false;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -173,7 +173,7 @@ namespace q {
|
|||
m.inc_ref(q_flat);
|
||||
m.inc_ref(q);
|
||||
m_flat.insert(q, q_flat);
|
||||
ctx.push(insert_ref2_map<euf::solver, ast_manager, quantifier, quantifier>(m, m_flat, q, q_flat));
|
||||
ctx.push(insert_ref2_map<ast_manager, quantifier, quantifier>(m, m_flat, q, q_flat));
|
||||
return q_flat;
|
||||
}
|
||||
|
||||
|
@ -188,7 +188,7 @@ namespace q {
|
|||
if (m_unit_table.contains(s))
|
||||
continue;
|
||||
m_unit_table.insert(s, e);
|
||||
ctx.push(insert_map<euf::solver, obj_map<sort, expr*>, sort*>(m_unit_table, s));
|
||||
ctx.push(insert_map<obj_map<sort, expr*>, sort*>(m_unit_table, s));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -203,7 +203,7 @@ namespace q {
|
|||
expr* val = mdl.get_some_value(s);
|
||||
m.inc_ref(val);
|
||||
m.inc_ref(s);
|
||||
ctx.push(insert_ref2_map<euf::solver, ast_manager, sort, expr>(m, m_unit_table, s, val));
|
||||
ctx.push(insert_ref2_map<ast_manager, sort, expr>(m, m_unit_table, s, val));
|
||||
return val;
|
||||
}
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ namespace user {
|
|||
if (m_qhead == m_prop.size())
|
||||
return false;
|
||||
force_push();
|
||||
ctx.push(value_trail<euf::solver, unsigned>(m_qhead));
|
||||
ctx.push(value_trail<unsigned>(m_qhead));
|
||||
unsigned np = m_stats.m_num_propagations;
|
||||
for (; m_qhead < m_prop.size() && !s().inconsistent(); ++m_qhead) {
|
||||
auto const& prop = m_prop[m_qhead];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue