mirror of
https://github.com/Z3Prover/z3
synced 2025-12-10 05:43:22 +00:00
merge with master
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
commit
c513f3ca09
883 changed files with 13979 additions and 16480 deletions
|
|
@ -441,7 +441,7 @@ struct subs_rewriter_cfg : public default_rewriter_cfg {
|
|||
|
||||
bool reduce_var(var * t, expr_ref & result, proof_ref & result_pr) {
|
||||
result = m_c;
|
||||
result_pr = 0;
|
||||
result_pr = nullptr;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ void pred_transformer::init_sig()
|
|||
std::stringstream name_stm;
|
||||
name_stm << m_head->get_name() << '_' << i;
|
||||
func_decl_ref stm(m);
|
||||
stm = m.mk_func_decl(symbol(name_stm.str().c_str()), 0, (sort*const*)0, arg_sort);
|
||||
stm = m.mk_func_decl(symbol(name_stm.str().c_str()), 0, (sort*const*)nullptr, arg_sort);
|
||||
m_sig.push_back(pm.get_o_pred(stm, 0));
|
||||
}
|
||||
}
|
||||
|
|
@ -153,7 +153,7 @@ bool pred_transformer::is_must_reachable(expr* state, model_ref* model)
|
|||
m_reach_ctx->push ();
|
||||
m_reach_ctx->assert_expr (state);
|
||||
m_reach_ctx->assert_expr (m.mk_not (m_reach_case_vars.back ()));
|
||||
lbool res = m_reach_ctx->check_sat (0, NULL);
|
||||
lbool res = m_reach_ctx->check_sat (0, nullptr);
|
||||
if (model) { m_reach_ctx->get_model(*model); }
|
||||
m_reach_ctx->pop (1);
|
||||
return (res == l_true);
|
||||
|
|
@ -176,14 +176,14 @@ reach_fact* pred_transformer::get_used_reach_fact (model_evaluator_util& mev,
|
|||
}
|
||||
|
||||
UNREACHABLE ();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
reach_fact *pred_transformer::get_used_origin_reach_fact (model_evaluator_util& mev,
|
||||
unsigned oidx)
|
||||
{
|
||||
expr_ref b(m), v(m);
|
||||
reach_fact *res = NULL;
|
||||
reach_fact *res = nullptr;
|
||||
|
||||
for (unsigned i = 0, sz = m_reach_case_vars.size (); i < sz; i++) {
|
||||
pm.formula_n2o (m_reach_case_vars.get (i), v, oidx);
|
||||
|
|
@ -219,7 +219,7 @@ datalog::rule const* pred_transformer::find_rule(model &model,
|
|||
// prefer a rule where the model intersects with reach facts of all predecessors;
|
||||
// also find how many predecessors' reach facts are true in the model
|
||||
expr_ref vl(m);
|
||||
datalog::rule const* r = ((datalog::rule*)0);
|
||||
datalog::rule const* r = ((datalog::rule*)nullptr);
|
||||
tag2rule::iterator it = m_tag2rule.begin(), end = m_tag2rule.end();
|
||||
for (; it != end; ++it) {
|
||||
expr* tag = it->m_key;
|
||||
|
|
@ -392,7 +392,7 @@ expr* pred_transformer::mk_fresh_reach_case_var ()
|
|||
|
||||
name << head ()->get_name () << "#reach_case_" << m_reach_case_vars.size ();
|
||||
decl = m.mk_func_decl (symbol (name.str ().c_str ()), 0,
|
||||
(sort*const*)0, m.mk_bool_sort ());
|
||||
(sort*const*)nullptr, m.mk_bool_sort ());
|
||||
m_reach_case_vars.push_back (m.mk_const (pm.get_n_pred (decl)));
|
||||
return m_reach_case_vars.back ();
|
||||
}
|
||||
|
|
@ -495,7 +495,7 @@ expr_ref pred_transformer::get_reachable()
|
|||
|
||||
expr* pred_transformer::get_last_reach_case_var () const
|
||||
{
|
||||
return m_reach_case_vars.empty () ? NULL : m_reach_case_vars.back ();
|
||||
return m_reach_case_vars.empty () ? nullptr : m_reach_case_vars.back ();
|
||||
}
|
||||
|
||||
expr_ref pred_transformer::get_cover_delta(func_decl* p_orig, int level)
|
||||
|
|
@ -557,7 +557,7 @@ expr_ref pred_transformer::get_origin_summary (model_evaluator_util &mev,
|
|||
if (!must) { // use may summary
|
||||
summary.push_back (get_formulas (level, false));
|
||||
// -- no auxiliary variables in lemmas
|
||||
*aux = NULL;
|
||||
*aux = nullptr;
|
||||
} else { // find must summary to use
|
||||
reach_fact *f = get_used_origin_reach_fact (mev, oidx);
|
||||
summary.push_back (f->get ());
|
||||
|
|
@ -613,12 +613,12 @@ bool pred_transformer::is_blocked (pob &n, unsigned &uses_level)
|
|||
{
|
||||
ensure_level (n.level ());
|
||||
prop_solver::scoped_level _sl (m_solver, n.level ());
|
||||
m_solver.set_core (NULL);
|
||||
m_solver.set_model (NULL);
|
||||
m_solver.set_core (nullptr);
|
||||
m_solver.set_model (nullptr);
|
||||
|
||||
expr_ref_vector post(m), aux(m);
|
||||
post.push_back (n.post ());
|
||||
lbool res = m_solver.check_assumptions (post, aux, 0, NULL, 0);
|
||||
lbool res = m_solver.check_assumptions (post, aux, 0, nullptr, 0);
|
||||
if (res == l_false) { uses_level = m_solver.uses_level(); }
|
||||
return res == l_false;
|
||||
}
|
||||
|
|
@ -775,7 +775,7 @@ bool pred_transformer::is_invariant(unsigned level, expr* lemma,
|
|||
prop_solver::scoped_level _sl(m_solver, level);
|
||||
prop_solver::scoped_subset_core _sc (m_solver, true);
|
||||
m_solver.set_core(core);
|
||||
m_solver.set_model(0);
|
||||
m_solver.set_model(nullptr);
|
||||
expr * bg = m_extend_lit.get ();
|
||||
lbool r = m_solver.check_assumptions (conj, aux, 1, &bg, 1);
|
||||
if (r == l_false) {
|
||||
|
|
@ -799,7 +799,7 @@ bool pred_transformer::check_inductive(unsigned level, expr_ref_vector& state,
|
|||
prop_solver::scoped_level _sl(m_solver, level);
|
||||
prop_solver::scoped_subset_core _sc (m_solver, true);
|
||||
m_solver.set_core(&core);
|
||||
m_solver.set_model (0);
|
||||
m_solver.set_model (nullptr);
|
||||
expr_ref_vector aux (m);
|
||||
conj.push_back (m_extend_lit);
|
||||
lbool res = m_solver.check_assumptions (state, aux, conj.size (), conj.c_ptr (), 1);
|
||||
|
|
@ -1023,7 +1023,7 @@ void pred_transformer::ground_free_vars(expr* e, app_ref_vector& vars,
|
|||
fv(e);
|
||||
|
||||
while (vars.size() < fv.size()) {
|
||||
vars.push_back(0);
|
||||
vars.push_back(nullptr);
|
||||
}
|
||||
for (unsigned i = 0; i < fv.size(); ++i) {
|
||||
if (fv[i] && !vars[i].get()) {
|
||||
|
|
@ -1110,7 +1110,7 @@ lemma::lemma (ast_manager &manager, expr * body, unsigned lvl) :
|
|||
m_ref_count(0), m(manager),
|
||||
m_body(body, m), m_cube(m),
|
||||
m_bindings(m), m_lvl(lvl),
|
||||
m_pob(0), m_new_pob(false) {
|
||||
m_pob(nullptr), m_new_pob(false) {
|
||||
SASSERT(m_body);
|
||||
normalize(m_body, m_body);
|
||||
}
|
||||
|
|
@ -1576,7 +1576,7 @@ void derivation::add_premise (pred_transformer &pt,
|
|||
|
||||
pob *derivation::create_first_child (model_evaluator_util &mev)
|
||||
{
|
||||
if (m_premises.empty()) { return NULL; }
|
||||
if (m_premises.empty()) { return nullptr; }
|
||||
m_active = 0;
|
||||
return create_next_child(mev);
|
||||
}
|
||||
|
|
@ -1599,7 +1599,7 @@ pob *derivation::create_next_child (model_evaluator_util &mev)
|
|||
vars.append (m_premises[m_active].get_ovars ());
|
||||
++m_active;
|
||||
}
|
||||
if (m_active >= m_premises.size()) { return NULL; }
|
||||
if (m_active >= m_premises.size()) { return nullptr; }
|
||||
|
||||
// -- update m_trans with the pre-image of m_trans over the must summaries
|
||||
summaries.push_back (m_trans);
|
||||
|
|
@ -1618,7 +1618,7 @@ pob *derivation::create_next_child (model_evaluator_util &mev)
|
|||
|
||||
if (!mev.is_true (m_premises[m_active].get_summary())) {
|
||||
IF_VERBOSE(1, verbose_stream() << "Summary unexpectendly not true\n";);
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1667,7 +1667,7 @@ pob *derivation::create_next_child (model_evaluator_util &mev)
|
|||
|
||||
pob *derivation::create_next_child ()
|
||||
{
|
||||
if (m_active + 1 >= m_premises.size()) { return NULL; }
|
||||
if (m_active + 1 >= m_premises.size()) { return nullptr; }
|
||||
|
||||
bool use_native_mbp = get_context ().use_native_mbp ();
|
||||
bool ground = get_context ().use_ground_cti ();
|
||||
|
|
@ -1694,7 +1694,7 @@ pob *derivation::create_next_child ()
|
|||
|
||||
// if not true, bail out, the must summary of m_active is not strong enough
|
||||
// this is possible if m_post was weakened for some reason
|
||||
if (!pt.is_must_reachable(pm.mk_and(summaries), &model)) { return NULL; }
|
||||
if (!pt.is_must_reachable(pm.mk_and(summaries), &model)) { return nullptr; }
|
||||
|
||||
model_evaluator_util mev (m);
|
||||
mev.set_model (*model);
|
||||
|
|
@ -1845,12 +1845,12 @@ void pob::get_skolems(app_ref_vector &v) {
|
|||
pob* pob_queue::top ()
|
||||
{
|
||||
/// nothing in the queue
|
||||
if (m_obligations.empty()) { return NULL; }
|
||||
if (m_obligations.empty()) { return nullptr; }
|
||||
/// top queue element is above max level
|
||||
if (m_obligations.top()->level() > m_max_level) { return NULL; }
|
||||
if (m_obligations.top()->level() > m_max_level) { return nullptr; }
|
||||
/// top queue element is at the max level, but at a higher than base depth
|
||||
if (m_obligations.top ()->level () == m_max_level &&
|
||||
m_obligations.top()->depth() > m_min_depth) { return NULL; }
|
||||
m_obligations.top()->depth() > m_min_depth) { return nullptr; }
|
||||
|
||||
/// there is something good in the queue
|
||||
return m_obligations.top ().get ();
|
||||
|
|
@ -1879,10 +1879,10 @@ context::context(fixedpoint_params const& params,
|
|||
ast_manager& m) :
|
||||
m_params(params),
|
||||
m(m),
|
||||
m_context(0),
|
||||
m_context(nullptr),
|
||||
m_pm(params.pdr_max_num_contexts(), m),
|
||||
m_query_pred(m),
|
||||
m_query(0),
|
||||
m_query(nullptr),
|
||||
m_pob_queue(),
|
||||
m_last_result(l_undef),
|
||||
m_inductive_lvl(0),
|
||||
|
|
@ -1911,7 +1911,7 @@ void context::reset()
|
|||
dealloc(it->m_value);
|
||||
}
|
||||
m_rels.reset();
|
||||
m_query = 0;
|
||||
m_query = nullptr;
|
||||
m_last_result = l_undef;
|
||||
m_inductive_lvl = 0;
|
||||
}
|
||||
|
|
@ -1982,7 +1982,7 @@ void context::update_rules(datalog::rule_set& rules)
|
|||
init_rules(rules, rels);
|
||||
decl2rel::iterator it = rels.begin(), end = rels.end();
|
||||
for (; it != end; ++it) {
|
||||
pred_transformer* pt = 0;
|
||||
pred_transformer* pt = nullptr;
|
||||
if (m_rels.find(it->m_key, pt)) {
|
||||
it->m_value->inherit_properties(*pt);
|
||||
}
|
||||
|
|
@ -1996,7 +1996,7 @@ void context::update_rules(datalog::rule_set& rules)
|
|||
|
||||
unsigned context::get_num_levels(func_decl* p)
|
||||
{
|
||||
pred_transformer* pt = 0;
|
||||
pred_transformer* pt = nullptr;
|
||||
if (m_rels.find(p, pt)) {
|
||||
return pt->get_num_levels();
|
||||
} else {
|
||||
|
|
@ -2007,7 +2007,7 @@ unsigned context::get_num_levels(func_decl* p)
|
|||
|
||||
expr_ref context::get_cover_delta(int level, func_decl* p_orig, func_decl* p)
|
||||
{
|
||||
pred_transformer* pt = 0;
|
||||
pred_transformer* pt = nullptr;
|
||||
if (m_rels.find(p, pt)) {
|
||||
return pt->get_cover_delta(p_orig, level);
|
||||
} else {
|
||||
|
|
@ -2018,7 +2018,7 @@ expr_ref context::get_cover_delta(int level, func_decl* p_orig, func_decl* p)
|
|||
|
||||
void context::add_cover(int level, func_decl* p, expr* property)
|
||||
{
|
||||
pred_transformer* pt = 0;
|
||||
pred_transformer* pt = nullptr;
|
||||
if (!m_rels.find(p, pt)) {
|
||||
pt = alloc(pred_transformer, *this, get_manager(), p);
|
||||
m_rels.insert(p, pt);
|
||||
|
|
@ -2033,7 +2033,7 @@ void context::add_invariant (func_decl *p, expr *property)
|
|||
|
||||
expr_ref context::get_reachable(func_decl *p)
|
||||
{
|
||||
pred_transformer* pt = 0;
|
||||
pred_transformer* pt = nullptr;
|
||||
if (!m_rels.find(p, pt))
|
||||
{ return expr_ref(m.mk_false(), m); }
|
||||
return pt->get_reachable();
|
||||
|
|
@ -2297,7 +2297,7 @@ unsigned context::get_cex_depth()
|
|||
// get current pt and fact
|
||||
pt = pts.get (curr);
|
||||
// check for depth marker
|
||||
if (pt == NULL) {
|
||||
if (pt == nullptr) {
|
||||
++cex_depth;
|
||||
// insert new marker if there are pts at higher depth
|
||||
if (curr + 1 < pts.size()) { pts.push_back(NULL); }
|
||||
|
|
@ -2632,7 +2632,7 @@ bool context::check_reachability ()
|
|||
while (last_reachable) {
|
||||
checkpoint ();
|
||||
node = last_reachable;
|
||||
last_reachable = NULL;
|
||||
last_reachable = nullptr;
|
||||
if (m_pob_queue.is_root(*node)) { return true; }
|
||||
if (is_reachable (*node->parent())) {
|
||||
last_reachable = node->parent ();
|
||||
|
|
@ -2748,14 +2748,14 @@ bool context::is_reachable(pob &n)
|
|||
|
||||
// used in case n is reachable
|
||||
bool is_concrete;
|
||||
const datalog::rule * r = NULL;
|
||||
const datalog::rule * r = nullptr;
|
||||
// denotes which predecessor's (along r) reach facts are used
|
||||
vector<bool> reach_pred_used;
|
||||
unsigned num_reuse_reach = 0;
|
||||
|
||||
unsigned saved = n.level ();
|
||||
n.m_level = infty_level ();
|
||||
lbool res = n.pt().is_reachable(n, NULL, &model,
|
||||
lbool res = n.pt().is_reachable(n, nullptr, &model,
|
||||
uses_level, is_concrete, r,
|
||||
reach_pred_used, num_reuse_reach);
|
||||
n.m_level = saved;
|
||||
|
|
@ -2779,7 +2779,7 @@ bool context::is_reachable(pob &n)
|
|||
|
||||
// if n has a derivation, create a new child and report l_undef
|
||||
// otherwise if n has no derivation or no new children, report l_true
|
||||
pob *next = NULL;
|
||||
pob *next = nullptr;
|
||||
scoped_ptr<derivation> deriv;
|
||||
if (n.has_derivation()) {deriv = n.detach_derivation();}
|
||||
|
||||
|
|
@ -2851,7 +2851,7 @@ lbool context::expand_node(pob& n)
|
|||
|
||||
// used in case n is reachable
|
||||
bool is_concrete;
|
||||
const datalog::rule * r = NULL;
|
||||
const datalog::rule * r = nullptr;
|
||||
// denotes which predecessor's (along r) reach facts are used
|
||||
vector<bool> reach_pred_used;
|
||||
unsigned num_reuse_reach = 0;
|
||||
|
|
@ -2896,7 +2896,7 @@ lbool context::expand_node(pob& n)
|
|||
|
||||
// if n has a derivation, create a new child and report l_undef
|
||||
// otherwise if n has no derivation or no new children, report l_true
|
||||
pob *next = NULL;
|
||||
pob *next = nullptr;
|
||||
scoped_ptr<derivation> deriv;
|
||||
if (n.has_derivation()) {deriv = n.detach_derivation();}
|
||||
|
||||
|
|
@ -3261,7 +3261,7 @@ bool context::create_children(pob& n, datalog::rule const& r,
|
|||
|
||||
pred_transformer &pt = get_pred_transformer (preds [j]);
|
||||
|
||||
const ptr_vector<app> *aux = NULL;
|
||||
const ptr_vector<app> *aux = nullptr;
|
||||
expr_ref sum(m);
|
||||
// XXX This is a bit confusing. The summary is returned over
|
||||
// XXX o-variables. But it is simpler if it is returned over n-variables instead.
|
||||
|
|
@ -3415,7 +3415,7 @@ expr_ref context::get_constraints (unsigned level)
|
|||
return m_pm.mk_and (constraints);
|
||||
}
|
||||
|
||||
void context::add_constraints (unsigned level, expr_ref c)
|
||||
void context::add_constraints (unsigned level, const expr_ref& c)
|
||||
{
|
||||
if (!c.get()) { return; }
|
||||
if (m.is_true(c)) { return; }
|
||||
|
|
@ -3429,7 +3429,7 @@ void context::add_constraints (unsigned level, expr_ref c)
|
|||
expr *e1, *e2;
|
||||
if (m.is_implies(c, e1, e2)) {
|
||||
SASSERT (is_app (e1));
|
||||
pred_transformer *r = 0;
|
||||
pred_transformer *r = nullptr;
|
||||
if (m_rels.find (to_app (e1)->get_decl (), r))
|
||||
{ r->add_lemma(e2, level); }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -323,7 +323,7 @@ public:
|
|||
{
|
||||
for (unsigned i = 0, sz = m_reach_facts.size (); i < sz; ++i)
|
||||
if(v == m_reach_facts [i]->get()) { return m_reach_facts[i]; }
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void add_rule(datalog::rule* r) { m_rules.push_back(r); }
|
||||
|
|
@ -348,7 +348,7 @@ public:
|
|||
void collect_statistics(statistics& st) const;
|
||||
void reset_statistics();
|
||||
|
||||
bool is_must_reachable (expr* state, model_ref* model = 0);
|
||||
bool is_must_reachable (expr* state, model_ref* model = nullptr);
|
||||
/// \brief Returns reachability fact active in the given model
|
||||
/// all determines whether initial reachability facts are included as well
|
||||
reach_fact *get_used_reach_fact (model_evaluator_util& mev, bool all = true);
|
||||
|
|
@ -397,7 +397,7 @@ public:
|
|||
vector<bool>& reach_pred_used,
|
||||
unsigned& num_reuse_reach);
|
||||
bool is_invariant(unsigned level, expr* lemma,
|
||||
unsigned& solver_level, expr_ref_vector* core = 0);
|
||||
unsigned& solver_level, expr_ref_vector* core = nullptr);
|
||||
bool check_inductive(unsigned level, expr_ref_vector& state,
|
||||
unsigned& assumes_level);
|
||||
|
||||
|
|
@ -475,7 +475,7 @@ public:
|
|||
void set_derivation (derivation *d) {m_derivation = d;}
|
||||
bool has_derivation () const {return (bool)m_derivation;}
|
||||
derivation &get_derivation() const {return *m_derivation.get ();}
|
||||
void reset_derivation () {set_derivation (NULL);}
|
||||
void reset_derivation () {set_derivation (nullptr);}
|
||||
/// detaches derivation from the node without deallocating
|
||||
derivation* detach_derivation () {return m_derivation.detach ();}
|
||||
|
||||
|
|
@ -503,7 +503,7 @@ public:
|
|||
/// clean a dirty node
|
||||
void clean();
|
||||
|
||||
void reset () {clean (); m_derivation = NULL; m_open = true;}
|
||||
void reset () {clean (); m_derivation = nullptr; m_open = true;}
|
||||
|
||||
bool is_closed () const { return !m_open; }
|
||||
void close();
|
||||
|
|
@ -563,7 +563,7 @@ class derivation {
|
|||
|
||||
public:
|
||||
premise (pred_transformer &pt, unsigned oidx, expr *summary, bool must,
|
||||
const ptr_vector<app> *aux_vars = NULL);
|
||||
const ptr_vector<app> *aux_vars = nullptr);
|
||||
premise (const premise &p);
|
||||
|
||||
bool is_must () {return m_must;}
|
||||
|
|
@ -575,7 +575,7 @@ class derivation {
|
|||
/// \brief Updated the summary.
|
||||
/// The new summary is over n-variables.
|
||||
void set_summary (expr * summary, bool must,
|
||||
const ptr_vector<app> *aux_vars = NULL);
|
||||
const ptr_vector<app> *aux_vars = nullptr);
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -600,7 +600,7 @@ public:
|
|||
derivation (pob& parent, datalog::rule const& rule,
|
||||
expr *trans, app_ref_vector const &evars);
|
||||
void add_premise (pred_transformer &pt, unsigned oidx,
|
||||
expr * summary, bool must, const ptr_vector<app> *aux_vars = NULL);
|
||||
expr * summary, bool must, const ptr_vector<app> *aux_vars = nullptr);
|
||||
|
||||
/// creates the first child. Must be called after all the premises
|
||||
/// are added. The model must be valid for the premises
|
||||
|
|
@ -628,7 +628,7 @@ class pob_queue {
|
|||
pob_ref_gt> m_obligations;
|
||||
|
||||
public:
|
||||
pob_queue(): m_root(NULL), m_max_level(0), m_min_depth(0) {}
|
||||
pob_queue(): m_root(nullptr), m_max_level(0), m_min_depth(0) {}
|
||||
~pob_queue();
|
||||
|
||||
void reset();
|
||||
|
|
@ -833,7 +833,7 @@ public:
|
|||
pob& get_root() const { return m_pob_queue.get_root(); }
|
||||
|
||||
expr_ref get_constraints (unsigned lvl);
|
||||
void add_constraints (unsigned lvl, expr_ref c);
|
||||
void add_constraints (unsigned lvl, const expr_ref& c);
|
||||
};
|
||||
|
||||
inline bool pred_transformer::use_native_mbp () {return ctx.use_native_mbp ();}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ dl_interface::dl_interface(datalog::context& ctx) :
|
|||
m_ctx(ctx),
|
||||
m_spacer_rules(ctx),
|
||||
m_old_rules(ctx),
|
||||
m_context(0),
|
||||
m_context(nullptr),
|
||||
m_refs(ctx.get_manager())
|
||||
{
|
||||
m_context = alloc(spacer::context, ctx.get_params(), ctx.get_manager());
|
||||
|
|
|
|||
|
|
@ -45,39 +45,39 @@ class dl_interface : public datalog::engine_base {
|
|||
|
||||
public:
|
||||
dl_interface(datalog::context& ctx);
|
||||
~dl_interface();
|
||||
~dl_interface() override;
|
||||
|
||||
lbool query(expr* query);
|
||||
lbool query(expr* query) override;
|
||||
|
||||
lbool query_from_lvl(expr* query, unsigned lvl);
|
||||
lbool query_from_lvl(expr* query, unsigned lvl) override;
|
||||
|
||||
void display_certificate(std::ostream& out) const;
|
||||
void display_certificate(std::ostream& out) const override;
|
||||
|
||||
void collect_statistics(statistics& st) const;
|
||||
void collect_statistics(statistics& st) const override;
|
||||
|
||||
void reset_statistics();
|
||||
void reset_statistics() override;
|
||||
|
||||
expr_ref get_answer();
|
||||
expr_ref get_answer() override;
|
||||
|
||||
expr_ref get_ground_sat_answer();
|
||||
expr_ref get_ground_sat_answer() override;
|
||||
|
||||
void get_rules_along_trace(datalog::rule_ref_vector& rules);
|
||||
void get_rules_along_trace(datalog::rule_ref_vector& rules) override;
|
||||
|
||||
unsigned get_num_levels(func_decl* pred);
|
||||
unsigned get_num_levels(func_decl* pred) override;
|
||||
|
||||
expr_ref get_cover_delta(int level, func_decl* pred);
|
||||
expr_ref get_cover_delta(int level, func_decl* pred) override;
|
||||
|
||||
void add_cover(int level, func_decl* pred, expr* property);
|
||||
void add_cover(int level, func_decl* pred, expr* property) override;
|
||||
|
||||
void add_invariant(func_decl* pred, expr* property);
|
||||
void add_invariant(func_decl* pred, expr* property) override;
|
||||
|
||||
expr_ref get_reachable(func_decl *pred);
|
||||
expr_ref get_reachable(func_decl *pred) override;
|
||||
|
||||
void updt_params();
|
||||
void updt_params() override;
|
||||
|
||||
model_ref get_model();
|
||||
model_ref get_model() override;
|
||||
|
||||
proof_ref get_proof();
|
||||
proof_ref get_proof() override;
|
||||
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ class collect_array_proc {
|
|||
sort *m_sort;
|
||||
public:
|
||||
collect_array_proc(ast_manager &m, func_decl_set& s) :
|
||||
m_au(m), m_symbs(s), m_sort(NULL) {}
|
||||
m_au(m), m_symbs(s), m_sort(nullptr) {}
|
||||
|
||||
void operator()(app* a)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@ namespace spacer {
|
|||
class lemma_sanity_checker : public lemma_generalizer {
|
||||
public:
|
||||
lemma_sanity_checker(context& ctx) : lemma_generalizer(ctx) {}
|
||||
virtual ~lemma_sanity_checker() {}
|
||||
virtual void operator()(lemma_ref &lemma);
|
||||
~lemma_sanity_checker() override {}
|
||||
void operator()(lemma_ref &lemma) override;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -53,11 +53,11 @@ class lemma_bool_inductive_generalizer : public lemma_generalizer {
|
|||
public:
|
||||
lemma_bool_inductive_generalizer(context& ctx, unsigned failure_limit) :
|
||||
lemma_generalizer(ctx), m_failure_limit(failure_limit) {}
|
||||
virtual ~lemma_bool_inductive_generalizer() {}
|
||||
virtual void operator()(lemma_ref &lemma);
|
||||
~lemma_bool_inductive_generalizer() override {}
|
||||
void operator()(lemma_ref &lemma) override;
|
||||
|
||||
virtual void collect_statistics(statistics& st) const;
|
||||
virtual void reset_statistics() {m_st.reset();}
|
||||
void collect_statistics(statistics& st) const override;
|
||||
void reset_statistics() override {m_st.reset();}
|
||||
};
|
||||
|
||||
class unsat_core_generalizer : public lemma_generalizer {
|
||||
|
|
@ -72,26 +72,26 @@ class unsat_core_generalizer : public lemma_generalizer {
|
|||
stats m_st;
|
||||
public:
|
||||
unsat_core_generalizer(context &ctx) : lemma_generalizer(ctx) {}
|
||||
virtual ~unsat_core_generalizer() {}
|
||||
virtual void operator()(lemma_ref &lemma);
|
||||
~unsat_core_generalizer() override {}
|
||||
void operator()(lemma_ref &lemma) override;
|
||||
|
||||
virtual void collect_statistics(statistics &st) const;
|
||||
virtual void reset_statistics() {m_st.reset();}
|
||||
void collect_statistics(statistics &st) const override;
|
||||
void reset_statistics() override {m_st.reset();}
|
||||
};
|
||||
|
||||
class lemma_array_eq_generalizer : public lemma_generalizer {
|
||||
public:
|
||||
lemma_array_eq_generalizer(context &ctx) : lemma_generalizer(ctx) {}
|
||||
virtual ~lemma_array_eq_generalizer() {}
|
||||
virtual void operator()(lemma_ref &lemma);
|
||||
~lemma_array_eq_generalizer() override {}
|
||||
void operator()(lemma_ref &lemma) override;
|
||||
|
||||
};
|
||||
|
||||
class lemma_eq_generalizer : public lemma_generalizer {
|
||||
public:
|
||||
lemma_eq_generalizer(context &ctx) : lemma_generalizer(ctx) {}
|
||||
virtual ~lemma_eq_generalizer() {}
|
||||
virtual void operator()(lemma_ref &lemma);
|
||||
~lemma_eq_generalizer() override {}
|
||||
void operator()(lemma_ref &lemma) override;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ app* itp_solver::def_manager::mk_proxy (expr *v)
|
|||
|
||||
bool itp_solver::def_manager::is_proxy (app *k, app_ref &def)
|
||||
{
|
||||
app *r = NULL;
|
||||
app *r = nullptr;
|
||||
bool found = m_proxy2def.find (k, r);
|
||||
def = r;
|
||||
return found;
|
||||
|
|
|
|||
|
|
@ -86,10 +86,10 @@ public:
|
|||
m_farkas_a_const(farkas_a_const)
|
||||
{}
|
||||
|
||||
virtual ~itp_solver() {}
|
||||
~itp_solver() override {}
|
||||
|
||||
/* itp solver specific */
|
||||
virtual void get_unsat_core(expr_ref_vector &core);
|
||||
void get_unsat_core(expr_ref_vector &core) override;
|
||||
virtual void get_itp_core(expr_ref_vector &core);
|
||||
void set_split_literals(bool v) {m_split_literals = v;}
|
||||
bool mk_proxies(expr_ref_vector &v, unsigned from = 0);
|
||||
|
|
@ -104,57 +104,50 @@ public:
|
|||
|
||||
/* solver interface */
|
||||
|
||||
virtual solver* translate(ast_manager &m, params_ref const &p)
|
||||
{return m_solver.translate(m, p);}
|
||||
virtual void updt_params(params_ref const &p)
|
||||
{m_solver.updt_params(p);}
|
||||
virtual void collect_param_descrs(param_descrs &r)
|
||||
{m_solver.collect_param_descrs(r);}
|
||||
virtual void set_produce_models(bool f)
|
||||
{m_solver.set_produce_models(f);}
|
||||
virtual void assert_expr_core(expr *t)
|
||||
{m_solver.assert_expr(t);}
|
||||
|
||||
virtual void assert_expr_core2(expr *t, expr *a)
|
||||
{NOT_IMPLEMENTED_YET();}
|
||||
solver* translate(ast_manager &m, params_ref const &p) override { return m_solver.translate(m, p);}
|
||||
void updt_params(params_ref const &p) override { m_solver.updt_params(p);}
|
||||
void collect_param_descrs(param_descrs &r) override { m_solver.collect_param_descrs(r);}
|
||||
void set_produce_models(bool f) override { m_solver.set_produce_models(f);}
|
||||
void assert_expr_core(expr *t) override { m_solver.assert_expr(t);}
|
||||
void assert_expr_core2(expr *t, expr *a) override { NOT_IMPLEMENTED_YET();}
|
||||
virtual void assert_lemma(expr* e) { NOT_IMPLEMENTED_YET(); }
|
||||
virtual expr_ref lookahead(const expr_ref_vector &,const expr_ref_vector &) { return expr_ref(m.mk_true(), m); }
|
||||
virtual expr_ref_vector cube(expr_ref_vector&, unsigned) { return expr_ref_vector(m); }
|
||||
|
||||
|
||||
virtual void push();
|
||||
virtual void pop(unsigned n);
|
||||
virtual unsigned get_scope_level() const
|
||||
void push() override;
|
||||
void pop(unsigned n) override;
|
||||
unsigned get_scope_level() const override
|
||||
{return m_solver.get_scope_level();}
|
||||
|
||||
virtual lbool check_sat(unsigned num_assumptions, expr * const *assumptions);
|
||||
virtual void set_progress_callback(progress_callback *callback)
|
||||
lbool check_sat(unsigned num_assumptions, expr * const *assumptions) override;
|
||||
void set_progress_callback(progress_callback *callback) override
|
||||
{m_solver.set_progress_callback(callback);}
|
||||
virtual unsigned get_num_assertions() const
|
||||
unsigned get_num_assertions() const override
|
||||
{return m_solver.get_num_assertions();}
|
||||
virtual expr * get_assertion(unsigned idx) const
|
||||
expr * get_assertion(unsigned idx) const override
|
||||
{return m_solver.get_assertion(idx);}
|
||||
virtual unsigned get_num_assumptions() const
|
||||
unsigned get_num_assumptions() const override
|
||||
{return m_solver.get_num_assumptions();}
|
||||
virtual expr * get_assumption(unsigned idx) const
|
||||
expr * get_assumption(unsigned idx) const override
|
||||
{return m_solver.get_assumption(idx);}
|
||||
virtual std::ostream &display(std::ostream &out, unsigned n, expr* const* es) const
|
||||
std::ostream &display(std::ostream &out, unsigned n, expr* const* es) const override
|
||||
{ return m_solver.display(out, n, es); }
|
||||
|
||||
/* check_sat_result interface */
|
||||
|
||||
virtual void collect_statistics(statistics &st) const ;
|
||||
void collect_statistics(statistics &st) const override ;
|
||||
virtual void reset_statistics();
|
||||
virtual void get_unsat_core(ptr_vector<expr> &r);
|
||||
virtual void get_model_core(model_ref &m) {m_solver.get_model(m);}
|
||||
virtual proof *get_proof() {return m_solver.get_proof();}
|
||||
virtual std::string reason_unknown() const
|
||||
|
||||
void get_unsat_core(ptr_vector<expr> &r) override;
|
||||
void get_model_core(model_ref &m) override {m_solver.get_model(m);}
|
||||
proof *get_proof() override {return m_solver.get_proof();}
|
||||
std::string reason_unknown() const override
|
||||
{return m_solver.reason_unknown();}
|
||||
virtual void set_reason_unknown(char const* msg)
|
||||
void set_reason_unknown(char const* msg) override
|
||||
{m_solver.set_reason_unknown(msg);}
|
||||
virtual void get_labels(svector<symbol> &r)
|
||||
void get_labels(svector<symbol> &r) override
|
||||
{m_solver.get_labels(r);}
|
||||
virtual ast_manager &get_manager() const {return m;}
|
||||
ast_manager &get_manager() const override {return m;}
|
||||
|
||||
virtual void refresh();
|
||||
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ void model_evaluator::reset()
|
|||
m_visited.reset();
|
||||
m_numbers.reset();
|
||||
m_refs.reset();
|
||||
m_model = 0;
|
||||
m_model = nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ namespace spacer
|
|||
return m_num_cols;
|
||||
}
|
||||
|
||||
rational spacer_matrix::get(unsigned int i, unsigned int j)
|
||||
const rational& spacer_matrix::get(unsigned int i, unsigned int j)
|
||||
{
|
||||
SASSERT(i < m_num_rows);
|
||||
SASSERT(j < m_num_cols);
|
||||
|
|
@ -50,7 +50,7 @@ namespace spacer
|
|||
return m_matrix[i][j];
|
||||
}
|
||||
|
||||
void spacer_matrix::set(unsigned int i, unsigned int j, rational v)
|
||||
void spacer_matrix::set(unsigned int i, unsigned int j, const rational& v)
|
||||
{
|
||||
SASSERT(i < m_num_rows);
|
||||
SASSERT(j < m_num_cols);
|
||||
|
|
|
|||
|
|
@ -25,13 +25,13 @@ namespace spacer {
|
|||
|
||||
class spacer_matrix {
|
||||
public:
|
||||
spacer_matrix(unsigned m, unsigned n); // m rows, n colums
|
||||
spacer_matrix(unsigned m, unsigned n); // m rows, n columns
|
||||
|
||||
unsigned num_rows();
|
||||
unsigned num_cols();
|
||||
|
||||
rational get(unsigned i, unsigned j);
|
||||
void set(unsigned i, unsigned j, rational v);
|
||||
const rational& get(unsigned i, unsigned j);
|
||||
void set(unsigned i, unsigned j, const rational& v);
|
||||
|
||||
unsigned perform_gaussian_elimination();
|
||||
|
||||
|
|
|
|||
|
|
@ -43,10 +43,10 @@ prop_solver::prop_solver(manager& pm, fixedpoint_params const& p, symbol const&
|
|||
m(pm.get_manager()),
|
||||
m_pm(pm),
|
||||
m_name(name),
|
||||
m_ctx(NULL),
|
||||
m_ctx(nullptr),
|
||||
m_pos_level_atoms(m),
|
||||
m_neg_level_atoms(m),
|
||||
m_core(0),
|
||||
m_core(nullptr),
|
||||
m_subset_based_core(false),
|
||||
m_uses_level(infty_level()),
|
||||
m_delta_level(false),
|
||||
|
|
@ -72,7 +72,7 @@ void prop_solver::add_level()
|
|||
unsigned idx = level_cnt();
|
||||
std::stringstream name;
|
||||
name << m_name << "#level_" << idx;
|
||||
func_decl * lev_pred = m.mk_fresh_func_decl(name.str().c_str(), 0, 0, m.mk_bool_sort());
|
||||
func_decl * lev_pred = m.mk_fresh_func_decl(name.str().c_str(), 0, nullptr, m.mk_bool_sort());
|
||||
m_level_preds.push_back(lev_pred);
|
||||
|
||||
app_ref pos_la(m.mk_const(lev_pred), m);
|
||||
|
|
@ -196,7 +196,7 @@ lbool prop_solver::internal_check_assumptions(
|
|||
// XXX Turn model generation if m_model != 0
|
||||
SASSERT(m_ctx);
|
||||
SASSERT(m_ctx_fparams);
|
||||
flet<bool> _model(m_ctx_fparams->m_model, m_model != 0);
|
||||
flet<bool> _model(m_ctx_fparams->m_model, m_model != nullptr);
|
||||
|
||||
if (m_in_level) { assert_level_atoms(m_current_level); }
|
||||
lbool result = maxsmt(hard_atoms, soft_atoms);
|
||||
|
|
@ -280,8 +280,8 @@ lbool prop_solver::check_assumptions(const expr_ref_vector & _hard,
|
|||
SASSERT(soft_sz >= soft.size());
|
||||
|
||||
// -- reset all parameters
|
||||
m_core = 0;
|
||||
m_model = 0;
|
||||
m_core = nullptr;
|
||||
m_model = nullptr;
|
||||
m_subset_based_core = false;
|
||||
return res;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ public:
|
|||
lbool check_assumptions(const expr_ref_vector & hard,
|
||||
expr_ref_vector & soft,
|
||||
unsigned num_bg = 0,
|
||||
expr * const *bg = NULL,
|
||||
expr * const *bg = nullptr,
|
||||
unsigned solver_id = 0);
|
||||
|
||||
void collect_statistics(statistics& st) const;
|
||||
|
|
|
|||
|
|
@ -190,14 +190,14 @@ namespace qe {
|
|||
|
||||
class is_relevant_default : public i_expr_pred {
|
||||
public:
|
||||
bool operator()(expr* e) {
|
||||
bool operator()(expr* e) override {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class mk_atom_default : public i_nnf_atom {
|
||||
public:
|
||||
virtual void operator()(expr* e, bool pol, expr_ref& result) {
|
||||
void operator()(expr* e, bool pol, expr_ref& result) override {
|
||||
if (pol) result = e;
|
||||
else result = result.get_manager().mk_not(e);
|
||||
}
|
||||
|
|
@ -595,7 +595,7 @@ namespace qe {
|
|||
// c*x + t = 0 <=> x = -t/c
|
||||
expr_ref eq_term (mk_mul (-(rational::one ()/m_coeffs[eq_idx]), m_terms.get (eq_idx)), m);
|
||||
m_rw (eq_term);
|
||||
map.insert (m_var->x (), eq_term, 0);
|
||||
map.insert (m_var->x (), eq_term, nullptr);
|
||||
TRACE ("qe",
|
||||
tout << "Using equality term: " << mk_pp (eq_term, m) << "\n";
|
||||
);
|
||||
|
|
@ -680,7 +680,7 @@ namespace qe {
|
|||
} else {
|
||||
new_lit = m.mk_true ();
|
||||
}
|
||||
map.insert (m_lits.get (i), new_lit, 0);
|
||||
map.insert (m_lits.get (i), new_lit, nullptr);
|
||||
TRACE ("qe",
|
||||
tout << "Old literal: " << mk_pp (m_lits.get (i), m) << "\n";
|
||||
tout << "New literal: " << mk_pp (new_lit, m) << "\n";
|
||||
|
|
@ -722,7 +722,7 @@ namespace qe {
|
|||
} else {
|
||||
new_lit = m.mk_true ();
|
||||
}
|
||||
map.insert (m_lits.get (i), new_lit, 0);
|
||||
map.insert (m_lits.get (i), new_lit, nullptr);
|
||||
TRACE ("qe",
|
||||
tout << "Old literal: " << mk_pp (m_lits.get (i), m) << "\n";
|
||||
tout << "New literal: " << mk_pp (new_lit, m) << "\n";
|
||||
|
|
@ -932,7 +932,7 @@ namespace qe {
|
|||
if (!all_done) continue;
|
||||
// all args so far have been processed
|
||||
// get the correct arg to use
|
||||
proof* pr = 0; expr* new_arg = 0;
|
||||
proof* pr = nullptr; expr* new_arg = nullptr;
|
||||
factored_terms.get (old_arg, new_arg, pr);
|
||||
if (new_arg) {
|
||||
// changed
|
||||
|
|
@ -965,7 +965,7 @@ namespace qe {
|
|||
mdl.register_decl (new_var->get_decl (), val);
|
||||
}
|
||||
if (changed) {
|
||||
factored_terms.insert (e, new_term, 0);
|
||||
factored_terms.insert (e, new_term, nullptr);
|
||||
}
|
||||
done.mark (e, true);
|
||||
todo.pop_back ();
|
||||
|
|
@ -973,7 +973,7 @@ namespace qe {
|
|||
}
|
||||
|
||||
// mk new fml
|
||||
proof* pr = 0; expr* new_fml = 0;
|
||||
proof* pr = nullptr; expr* new_fml = nullptr;
|
||||
factored_terms.get (fml, new_fml, pr);
|
||||
if (new_fml) {
|
||||
fml = new_fml;
|
||||
|
|
@ -994,9 +994,9 @@ namespace qe {
|
|||
* the divisibility atom is a special mod term ((t1-t2) % num == 0)
|
||||
*/
|
||||
void mod2div (expr_ref& fml, expr_map& map) {
|
||||
expr* new_fml = 0;
|
||||
expr* new_fml = nullptr;
|
||||
|
||||
proof *pr = 0;
|
||||
proof *pr = nullptr;
|
||||
map.get (fml, new_fml, pr);
|
||||
if (new_fml) {
|
||||
fml = new_fml;
|
||||
|
|
@ -1065,7 +1065,7 @@ namespace qe {
|
|||
new_fml = m.mk_app (a->get_decl (), children.size (), children.c_ptr ());
|
||||
}
|
||||
|
||||
map.insert (fml, new_fml, 0);
|
||||
map.insert (fml, new_fml, nullptr);
|
||||
fml = new_fml;
|
||||
}
|
||||
|
||||
|
|
@ -1133,7 +1133,7 @@ namespace qe {
|
|||
z);
|
||||
}
|
||||
}
|
||||
map.insert (m_lits.get (i), new_lit, 0);
|
||||
map.insert (m_lits.get (i), new_lit, nullptr);
|
||||
TRACE ("qe",
|
||||
tout << "Old literal: " << mk_pp (m_lits.get (i), m) << "\n";
|
||||
tout << "New literal: " << mk_pp (new_lit, m) << "\n";
|
||||
|
|
@ -1145,7 +1145,7 @@ namespace qe {
|
|||
expr_substitution sub (m);
|
||||
// literals
|
||||
for (unsigned i = 0; i < lits.size (); i++) {
|
||||
expr* new_lit = 0; proof* pr = 0;
|
||||
expr* new_lit = nullptr; proof* pr = nullptr;
|
||||
app* old_lit = lits.get (i);
|
||||
map.get (old_lit, new_lit, pr);
|
||||
if (new_lit) {
|
||||
|
|
@ -1157,7 +1157,7 @@ namespace qe {
|
|||
}
|
||||
}
|
||||
// substitute for x, if any
|
||||
expr* x_term = 0; proof* pr = 0;
|
||||
expr* x_term = nullptr; proof* pr = nullptr;
|
||||
map.get (m_var->x (), x_term, pr);
|
||||
if (x_term) {
|
||||
sub.insert (m_var->x (), x_term);
|
||||
|
|
@ -1292,9 +1292,9 @@ namespace qe {
|
|||
model_evaluator_array_util m_mev;
|
||||
|
||||
void reset_v () {
|
||||
m_v = 0;
|
||||
m_v = nullptr;
|
||||
m_has_stores_v.reset ();
|
||||
m_subst_term_v = 0;
|
||||
m_subst_term_v = nullptr;
|
||||
m_true_sub_v.reset ();
|
||||
m_false_sub_v.reset ();
|
||||
m_aux_lits_v.reset ();
|
||||
|
|
@ -1302,7 +1302,7 @@ namespace qe {
|
|||
}
|
||||
|
||||
void reset () {
|
||||
M = 0;
|
||||
M = nullptr;
|
||||
reset_v ();
|
||||
m_aux_vars.reset ();
|
||||
}
|
||||
|
|
@ -1393,7 +1393,7 @@ namespace qe {
|
|||
todo.push_back (to_app (arg));
|
||||
}
|
||||
else if (all_done) { // all done so far..
|
||||
expr* arg_new = 0; proof* pr;
|
||||
expr* arg_new = nullptr; proof* pr;
|
||||
sel_cache.get (arg, arg_new, pr);
|
||||
if (!arg_new) {
|
||||
arg_new = arg;
|
||||
|
|
@ -1423,12 +1423,12 @@ namespace qe {
|
|||
}
|
||||
|
||||
if (a != a_new) {
|
||||
sel_cache.insert (a, a_new, 0);
|
||||
sel_cache.insert (a, a_new, nullptr);
|
||||
pinned.push_back (a_new);
|
||||
}
|
||||
done.mark (a, true);
|
||||
}
|
||||
expr* res = 0; proof* pr;
|
||||
expr* res = nullptr; proof* pr;
|
||||
sel_cache.get (fml, res, pr);
|
||||
if (res) {
|
||||
fml = to_app (res);
|
||||
|
|
@ -1478,7 +1478,7 @@ namespace qe {
|
|||
|
||||
void find_subst_term (app* eq) {
|
||||
app_ref p_exp (m);
|
||||
mk_peq (eq->get_arg (0), eq->get_arg (1), 0, 0, p_exp);
|
||||
mk_peq (eq->get_arg (0), eq->get_arg (1), 0, nullptr, p_exp);
|
||||
bool subst_eq_found = false;
|
||||
while (true) {
|
||||
TRACE ("qe",
|
||||
|
|
@ -1672,7 +1672,7 @@ namespace qe {
|
|||
expr* rhs = eq->get_arg (1);
|
||||
bool lhs_has_v = (lhs == m_v || m_has_stores_v.is_marked (lhs));
|
||||
bool rhs_has_v = (rhs == m_v || m_has_stores_v.is_marked (rhs));
|
||||
app* store = 0;
|
||||
app* store = nullptr;
|
||||
|
||||
SASSERT (lhs_has_v || rhs_has_v);
|
||||
|
||||
|
|
@ -1829,7 +1829,7 @@ namespace qe {
|
|||
m_cache.reset ();
|
||||
m_pinned.reset ();
|
||||
m_idx_lits.reset ();
|
||||
M = 0;
|
||||
M = nullptr;
|
||||
m_arr_test.reset ();
|
||||
m_has_stores.reset ();
|
||||
m_reduce_all_selects = false;
|
||||
|
|
@ -1864,7 +1864,7 @@ namespace qe {
|
|||
bool reduce (expr_ref& e) {
|
||||
if (!is_app (e)) return true;
|
||||
|
||||
expr *r = 0;
|
||||
expr *r = nullptr;
|
||||
if (m_cache.find (e, r)) {
|
||||
e = r;
|
||||
return true;
|
||||
|
|
@ -1882,7 +1882,7 @@ namespace qe {
|
|||
|
||||
for (unsigned i = 0; i < a->get_num_args (); ++i) {
|
||||
expr *arg = a->get_arg (i);
|
||||
expr *narg = 0;
|
||||
expr *narg = nullptr;
|
||||
|
||||
if (!is_app (arg)) args.push_back (arg);
|
||||
else if (m_cache.find (arg, narg)) {
|
||||
|
|
@ -2025,7 +2025,7 @@ namespace qe {
|
|||
m_idx_vals.reset ();
|
||||
m_sel_consts.reset ();
|
||||
m_idx_lits.reset ();
|
||||
M = 0;
|
||||
M = nullptr;
|
||||
m_sub.reset ();
|
||||
m_arr_test.reset ();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ smt_context_manager::~smt_context_manager()
|
|||
virtual_solver* smt_context_manager::mk_fresh()
|
||||
{
|
||||
++m_num_contexts;
|
||||
virtual_solver_factory *solver_factory = 0;
|
||||
virtual_solver_factory *solver_factory = nullptr;
|
||||
|
||||
if (m_max_num_contexts == 0 || m_solvers.size() < m_max_num_contexts) {
|
||||
m_solvers.push_back(alloc(spacer::virtual_solver_factory, m, m_fparams));
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ public:
|
|||
{
|
||||
func_decl * res;
|
||||
if(!m_prefix2prim.find(prefix, res)) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
@ -138,7 +138,7 @@ public:
|
|||
{
|
||||
func_decl * prim = try_get_primary_by_prefix(prefix);
|
||||
if(!prim) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return conv(prim, 0, idx);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ void unsat_core_learner::compute_unsat_core(proof *root, expr_set& asserted_b, e
|
|||
verbose_stream() << "Reduced proof:\n" << mk_ismt2_pp(pr, m) << "\n";
|
||||
);
|
||||
|
||||
// compute symbols occuring in B
|
||||
// compute symbols occurring in B
|
||||
collect_symbols_b(asserted_b);
|
||||
|
||||
// traverse proof
|
||||
|
|
@ -301,7 +301,7 @@ public:
|
|||
void operator()(quantifier*) {}
|
||||
};
|
||||
|
||||
void unsat_core_learner::collect_symbols_b(expr_set axioms_b)
|
||||
void unsat_core_learner::collect_symbols_b(const expr_set& axioms_b)
|
||||
{
|
||||
expr_mark visited;
|
||||
collect_pure_proc proc(m_symbols_b);
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ namespace spacer {
|
|||
private:
|
||||
ptr_vector<unsat_core_plugin> m_plugins;
|
||||
func_decl_set m_symbols_b; // symbols, which occur in any b-asserted formula
|
||||
void collect_symbols_b(expr_set axioms_b);
|
||||
void collect_symbols_b(const expr_set& axioms_b);
|
||||
|
||||
ast_mark m_a_mark;
|
||||
ast_mark m_b_mark;
|
||||
|
|
|
|||
|
|
@ -506,7 +506,7 @@ void unsat_core_plugin_farkas_lemma::compute_linear_combination(const vector<rat
|
|||
std::string name = "w_" + std::to_string(i) + std::to_string(n);
|
||||
|
||||
func_decl_ref decl(m);
|
||||
decl = m.mk_func_decl(symbol(name.c_str()), 0, (sort*const*)0, util.mk_int());
|
||||
decl = m.mk_func_decl(symbol(name.c_str()), 0, (sort*const*)nullptr, util.mk_int());
|
||||
coeffs[i].push_back(m.mk_const(decl));
|
||||
}
|
||||
|
||||
|
|
@ -516,7 +516,7 @@ void unsat_core_plugin_farkas_lemma::compute_linear_combination(const vector<rat
|
|||
std::string name = "s_" + std::to_string(j) + std::to_string(n);
|
||||
|
||||
func_decl_ref decl(m);
|
||||
decl = m.mk_func_decl(symbol(name.c_str()), 0, (sort*const*)0, util.mk_int());
|
||||
decl = m.mk_func_decl(symbol(name.c_str()), 0, (sort*const*)nullptr, util.mk_int());
|
||||
|
||||
expr_ref s_jn(m);
|
||||
s_jn = m.mk_const(decl);
|
||||
|
|
@ -556,7 +556,7 @@ void unsat_core_plugin_farkas_lemma::compute_linear_combination(const vector<rat
|
|||
}
|
||||
|
||||
// check result
|
||||
lbool res = s->check_sat(0,0);
|
||||
lbool res = s->check_sat(0,nullptr);
|
||||
|
||||
// if sat extract model and add corresponding linear combinations to core
|
||||
if (res == lbool::l_true) {
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class unsat_core_plugin_lemma : public unsat_core_plugin {
|
|||
public:
|
||||
unsat_core_plugin_lemma(unsat_core_learner& learner) : unsat_core_plugin(learner){};
|
||||
|
||||
virtual void compute_partial_core(proof* step) override;
|
||||
void compute_partial_core(proof* step) override;
|
||||
|
||||
private:
|
||||
void add_lowest_split_to_core(proof* step) const;
|
||||
|
|
@ -55,7 +55,7 @@ class unsat_core_plugin_farkas_lemma : public unsat_core_plugin {
|
|||
public:
|
||||
unsat_core_plugin_farkas_lemma(unsat_core_learner& learner, bool split_literals, bool use_constant_from_a=true) : unsat_core_plugin(learner), m_split_literals(split_literals), m_use_constant_from_a(use_constant_from_a) {};
|
||||
|
||||
virtual void compute_partial_core(proof* step) override;
|
||||
void compute_partial_core(proof* step) override;
|
||||
|
||||
private:
|
||||
bool m_split_literals;
|
||||
|
|
@ -71,8 +71,8 @@ private:
|
|||
public:
|
||||
unsat_core_plugin_farkas_lemma_optimized(unsat_core_learner& learner, ast_manager& m) : unsat_core_plugin(learner), m(m) {};
|
||||
|
||||
virtual void compute_partial_core(proof* step) override;
|
||||
virtual void finalize() override;
|
||||
void compute_partial_core(proof* step) override;
|
||||
void finalize() override;
|
||||
|
||||
protected:
|
||||
vector<vector<std::pair<app*, rational> > > m_linear_combinations;
|
||||
|
|
@ -88,7 +88,7 @@ private:
|
|||
public:
|
||||
unsat_core_plugin_farkas_lemma_bounded(unsat_core_learner& learner, ast_manager& m) : unsat_core_plugin_farkas_lemma_optimized(learner, m) {};
|
||||
|
||||
virtual void finalize() override;
|
||||
void finalize() override;
|
||||
};
|
||||
|
||||
class unsat_core_plugin_min_cut : public unsat_core_plugin {
|
||||
|
|
@ -96,8 +96,8 @@ private:
|
|||
public:
|
||||
unsat_core_plugin_min_cut(unsat_core_learner& learner, ast_manager& m);
|
||||
|
||||
virtual void compute_partial_core(proof* step) override;
|
||||
virtual void finalize() override;
|
||||
void compute_partial_core(proof* step) override;
|
||||
void finalize() override;
|
||||
private:
|
||||
ast_manager& m;
|
||||
|
||||
|
|
|
|||
|
|
@ -72,17 +72,17 @@ namespace spacer {
|
|||
//
|
||||
|
||||
model_evaluator_util::model_evaluator_util(ast_manager& m) :
|
||||
m(m), m_mev(nullptr) {
|
||||
reset (nullptr);
|
||||
m(m), m_mev(nullptr) {
|
||||
reset (nullptr);
|
||||
}
|
||||
|
||||
model_evaluator_util::~model_evaluator_util() {reset (NULL);}
|
||||
model_evaluator_util::~model_evaluator_util() {reset (nullptr);}
|
||||
|
||||
|
||||
void model_evaluator_util::reset(model* model) {
|
||||
if (m_mev) {
|
||||
dealloc(m_mev);
|
||||
m_mev = NULL;
|
||||
m_mev = nullptr;
|
||||
}
|
||||
m_model = model;
|
||||
if (!m_model) { return; }
|
||||
|
|
@ -694,7 +694,7 @@ void expand_literals(ast_manager &m, expr_ref_vector& conjs)
|
|||
} else if ((m.is_eq(e, c, val) && is_app(val) && dt.is_constructor(to_app(val))) ||
|
||||
(m.is_eq(e, val, c) && is_app(val) && dt.is_constructor(to_app(val)))){
|
||||
func_decl* f = to_app(val)->get_decl();
|
||||
func_decl* r = dt.get_constructor_recognizer(f);
|
||||
func_decl* r = dt.get_constructor_is(f);
|
||||
conjs[i] = m.mk_app(r, c);
|
||||
ptr_vector<func_decl> const& acc = *dt.get_constructor_accessors(f);
|
||||
for (unsigned j = 0; j < acc.size(); ++j) {
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ void find_decls (expr* fml, app_ref_vector& decls, std::string& prefix);
|
|||
struct mk_epp : public mk_pp {
|
||||
params_ref m_epp_params;
|
||||
expr_ref m_epp_expr;
|
||||
mk_epp(ast *t, ast_manager &m, unsigned indent = 0, unsigned num_vars = 0, char const * var_prefix = 0);
|
||||
mk_epp(ast *t, ast_manager &m, unsigned indent = 0, unsigned num_vars = 0, char const * var_prefix = nullptr);
|
||||
void rw(expr *e, expr_ref &out);
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -257,25 +257,19 @@ void virtual_solver::get_labels(svector<symbol> &r)
|
|||
{
|
||||
r.reset();
|
||||
buffer<symbol> tmp;
|
||||
m_context.get_relevant_labels(0, tmp);
|
||||
m_context.get_relevant_labels(nullptr, tmp);
|
||||
r.append(tmp.size(), tmp.c_ptr());
|
||||
}
|
||||
|
||||
solver* virtual_solver::translate(ast_manager& m, params_ref const& p)
|
||||
{
|
||||
UNREACHABLE();
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
void virtual_solver::updt_params(params_ref const &p)
|
||||
{ m_factory.updt_params(p); }
|
||||
void virtual_solver::collect_param_descrs(param_descrs &r)
|
||||
{ m_factory.collect_param_descrs(r); }
|
||||
void virtual_solver::set_produce_models(bool f)
|
||||
{ m_factory.set_produce_models(f); }
|
||||
bool virtual_solver::get_produce_models()
|
||||
{return m_factory.get_produce_models(); }
|
||||
smt_params &virtual_solver::fparams()
|
||||
{return m_factory.fparams();}
|
||||
void virtual_solver::updt_params(params_ref const &p) { m_factory.updt_params(p); }
|
||||
void virtual_solver::collect_param_descrs(param_descrs &r) { m_factory.collect_param_descrs(r); }
|
||||
void virtual_solver::set_produce_models(bool f) { m_factory.set_produce_models(f); }
|
||||
smt_params &virtual_solver::fparams() {return m_factory.fparams();}
|
||||
|
||||
void virtual_solver::to_smt2_benchmark(std::ostream &out,
|
||||
smt::kernel &context,
|
||||
|
|
|
|||
|
|
@ -65,47 +65,46 @@ private:
|
|||
void refresh();
|
||||
|
||||
public:
|
||||
virtual ~virtual_solver();
|
||||
virtual unsigned get_num_assumptions() const
|
||||
~virtual_solver() override;
|
||||
unsigned get_num_assumptions() const override
|
||||
{
|
||||
unsigned sz = solver_na2as::get_num_assumptions();
|
||||
return m_virtual ? sz - 1 : sz;
|
||||
}
|
||||
virtual expr* get_assumption(unsigned idx) const
|
||||
expr* get_assumption(unsigned idx) const override
|
||||
{
|
||||
if(m_virtual) { idx++; }
|
||||
return solver_na2as::get_assumption(idx);
|
||||
}
|
||||
|
||||
virtual void get_unsat_core(ptr_vector<expr> &r);
|
||||
virtual void assert_expr_core(expr *e);
|
||||
virtual void collect_statistics(statistics &st) const {}
|
||||
virtual void get_model_core(model_ref &m) {m_context.get_model(m);}
|
||||
virtual proof* get_proof();
|
||||
virtual std::string reason_unknown() const
|
||||
|
||||
void get_unsat_core(ptr_vector<expr> &r) override;
|
||||
void assert_expr_core(expr *e) override;
|
||||
void collect_statistics(statistics &st) const override {}
|
||||
void get_model_core(model_ref &m) override {m_context.get_model(m);}
|
||||
proof* get_proof() override;
|
||||
std::string reason_unknown() const override
|
||||
{return m_context.last_failure_as_string();}
|
||||
virtual void set_reason_unknown(char const *msg)
|
||||
void set_reason_unknown(char const *msg) override
|
||||
{m_context.set_reason_unknown(msg);}
|
||||
virtual ast_manager& get_manager() const {return m;}
|
||||
virtual void get_labels(svector<symbol> &r);
|
||||
virtual void set_produce_models(bool f);
|
||||
virtual bool get_produce_models();
|
||||
virtual smt_params &fparams();
|
||||
virtual void reset();
|
||||
ast_manager& get_manager() const override {return m;}
|
||||
void get_labels(svector<symbol> &r) override;
|
||||
void set_produce_models(bool f) override;
|
||||
smt_params &fparams();
|
||||
void reset();
|
||||
expr_ref_vector cube(expr_ref_vector&, unsigned) override { return expr_ref_vector(m); }
|
||||
void set_progress_callback(progress_callback *callback) override {UNREACHABLE();}
|
||||
|
||||
virtual void set_progress_callback(progress_callback *callback) {UNREACHABLE();}
|
||||
virtual expr_ref_vector cube(expr_ref_vector&, unsigned) { return expr_ref_vector(m); }
|
||||
solver *translate(ast_manager &m, params_ref const &p) override;
|
||||
|
||||
virtual solver *translate(ast_manager &m, params_ref const &p);
|
||||
|
||||
virtual void updt_params(params_ref const &p);
|
||||
virtual void collect_param_descrs(param_descrs &r);
|
||||
void updt_params(params_ref const &p) override;
|
||||
void collect_param_descrs(param_descrs &r) override;
|
||||
|
||||
|
||||
protected:
|
||||
virtual lbool check_sat_core(unsigned num_assumptions, expr *const * assumptions);
|
||||
virtual void push_core();
|
||||
virtual void pop_core(unsigned n);
|
||||
lbool check_sat_core(unsigned num_assumptions, expr *const * assumptions) override;
|
||||
void push_core() override;
|
||||
void pop_core(unsigned n) override;
|
||||
};
|
||||
|
||||
/// multi-solver abstraction on top of a single smt::kernel
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue