3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-21 21:33:39 +00:00

remove template Context dependency in every trail object

This commit is contained in:
Nikolaj Bjorner 2021-02-08 15:41:57 -08:00
parent df0a449f70
commit a152bb1e80
65 changed files with 413 additions and 413 deletions

View file

@ -110,9 +110,9 @@ namespace smt {
unsigned m_final_check_idx; // circular counter used for implementing fairness
bool m_is_auxiliary; // used to prevent unwanted information from being logged.
class parallel* m_par;
unsigned m_par_index;
bool m_is_auxiliary { false }; // used to prevent unwanted information from being logged.
class parallel* m_par { nullptr };
unsigned m_par_index { 0 };
// -----------------------------------
//
@ -151,7 +151,7 @@ namespace smt {
svector<new_th_eq> m_propagated_th_diseqs;
svector<enode_pair> m_diseq_vector;
#endif
enode * m_is_diseq_tmp; // auxiliary enode used to find congruent equality atoms.
enode * m_is_diseq_tmp { nullptr }; // auxiliary enode used to find congruent equality atoms.
tmp_enode m_tmp_enode;
ptr_vector<almost_cg_table> m_almost_cg_tables; // temporary field for is_ext_diseq
@ -180,15 +180,15 @@ namespace smt {
literal_vector m_assigned_literals;
typedef std::pair<clause*, literal_vector> tmp_clause;
vector<tmp_clause> m_tmp_clauses;
unsigned m_qhead;
unsigned m_simp_qhead;
int m_simp_counter; //!< can become negative
unsigned m_qhead { 0 };
unsigned m_simp_qhead { 0 };
int m_simp_counter { 0 }; //!< can become negative
scoped_ptr<case_split_queue> m_case_split_queue;
scoped_ptr<induction> m_induction;
double m_bvar_inc;
bool m_phase_cache_on;
unsigned m_phase_counter; //!< auxiliary variable used to decide when to turn on/off phase caching
bool m_phase_default; //!< default phase when using phase caching
double m_bvar_inc { 1.0 };
bool m_phase_cache_on { true };
unsigned m_phase_counter { 0 }; //!< auxiliary variable used to decide when to turn on/off phase caching
bool m_phase_default { false }; //!< default phase when using phase caching
// A conflict is usually a single justification. That is, a justification
// for false. If m_not_l is not null_literal, then m_conflict is a
@ -600,10 +600,10 @@ namespace smt {
//
// -----------------------------------
protected:
typedef ptr_vector<trail<context> > trail_stack;
typedef ptr_vector<trail > trail_stack;
trail_stack m_trail_stack;
#ifdef Z3DEBUG
bool m_trail_enabled;
bool m_trail_enabled { true };
#endif
public:
@ -613,15 +613,15 @@ namespace smt {
m_trail_stack.push_back(new (m_region) TrailObject(obj));
}
void push_trail_ptr(trail<context> * ptr) {
void push_trail_ptr(trail * ptr) {
m_trail_stack.push_back(ptr);
}
protected:
unsigned m_scope_lvl;
unsigned m_base_lvl;
unsigned m_search_lvl; // It is greater than m_base_lvl when assumptions are used. Otherwise, it is equals to m_base_lvl
unsigned m_scope_lvl { 0 };
unsigned m_base_lvl { 0 };
unsigned m_search_lvl { 0 }; // It is greater than m_base_lvl when assumptions are used. Otherwise, it is equals to m_base_lvl
struct scope {
unsigned m_assigned_literals_lim;
unsigned m_trail_stack_lim;
@ -724,7 +724,7 @@ namespace smt {
}
protected:
unsigned m_generation; //!< temporary variable used during internalization
unsigned m_generation { 0 }; //!< temporary variable used during internalization
public:
bool binary_clause_opt_enabled() const {
@ -793,25 +793,31 @@ namespace smt {
void internalize_uninterpreted(app * n);
friend class mk_bool_var_trail;
class mk_bool_var_trail : public trail<context> {
class mk_bool_var_trail : public trail {
context& ctx;
public:
void undo(context & ctx) override { ctx.undo_mk_bool_var(); }
mk_bool_var_trail(context& ctx) :ctx(ctx) {}
void undo() override { ctx.undo_mk_bool_var(); }
};
mk_bool_var_trail m_mk_bool_var_trail;
void undo_mk_bool_var();
friend class mk_enode_trail;
class mk_enode_trail : public trail<context> {
class mk_enode_trail : public trail {
context& ctx;
public:
void undo(context & ctx) override { ctx.undo_mk_enode(); }
mk_enode_trail(context& ctx) :ctx(ctx) {}
void undo() override { ctx.undo_mk_enode(); }
};
mk_enode_trail m_mk_enode_trail;
void undo_mk_enode();
friend class mk_lambda_trail;
class mk_lambda_trail : public trail<context> {
class mk_lambda_trail : public trail {
context& ctx;
public:
void undo(context & ctx) override { ctx.undo_mk_lambda(); }
mk_lambda_trail(context& ctx) :ctx(ctx) {}
void undo() override { ctx.undo_mk_lambda(); }
};
mk_lambda_trail m_mk_lambda_trail;
void undo_mk_lambda();
@ -970,10 +976,10 @@ namespace smt {
//
// -----------------------------------
protected:
lbool m_last_search_result;
failure m_last_search_failure;
lbool m_last_search_result { l_undef };
failure m_last_search_failure { UNKNOWN };
ptr_vector<theory> m_incomplete_theories; //!< theories that failed to produce a model
bool m_searching;
bool m_searching { false };
unsigned m_num_conflicts;
unsigned m_num_conflicts_since_restart;
unsigned m_num_conflicts_since_lemma_gc;