mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 01:25:31 +00:00
Merge branch 'issue1379' of github.com:/mtrberzi/z3 into issue1379
This commit is contained in:
commit
fd6d9a9489
872 changed files with 12207 additions and 15948 deletions
|
@ -42,7 +42,7 @@ namespace smt {
|
|||
m_n2(n2) {
|
||||
}
|
||||
|
||||
virtual void undo(context & ctx) {
|
||||
void undo(context & ctx) override {
|
||||
m_already_processed.erase(m_n1, m_n2);
|
||||
TRACE("arith_eq_adapter_profile", tout << "del #" << m_n1->get_owner_id() << " #" << m_n2->get_owner_id() << "\n";);
|
||||
}
|
||||
|
@ -67,9 +67,9 @@ namespace smt {
|
|||
m_ge(ge) {
|
||||
}
|
||||
|
||||
virtual ~arith_eq_relevancy_eh() {}
|
||||
~arith_eq_relevancy_eh() override {}
|
||||
|
||||
virtual void operator()(relevancy_propagator & rp) {
|
||||
void operator()(relevancy_propagator & rp) override {
|
||||
if (!rp.is_relevant(m_n1))
|
||||
return;
|
||||
if (!rp.is_relevant(m_n2))
|
||||
|
@ -154,8 +154,8 @@ namespace smt {
|
|||
// Requires that the theory arithmetic internalizer accept non simplified terms of the form t1 - t2
|
||||
// if t1 and t2 already have slacks (theory variables) associated with them.
|
||||
// It also accepts terms with repeated variables (Issue #429).
|
||||
app * le = 0;
|
||||
app * ge = 0;
|
||||
app * le = nullptr;
|
||||
app * ge = nullptr;
|
||||
if (m_util.is_numeral(t1))
|
||||
std::swap(t1, t2);
|
||||
if (m_util.is_numeral(t2)) {
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace smt {
|
|||
expr * m_t1_eq_t2;
|
||||
expr * m_le;
|
||||
expr * m_ge;
|
||||
data():m_t1_eq_t2(0), m_le(0), m_ge(0) {}
|
||||
data():m_t1_eq_t2(nullptr), m_le(nullptr), m_ge(nullptr) {}
|
||||
data(expr * t1_eq_t2, expr * le, expr * ge):m_t1_eq_t2(t1_eq_t2), m_le(le), m_ge(ge) {}
|
||||
};
|
||||
|
||||
|
|
|
@ -27,8 +27,9 @@ Revision History:
|
|||
#include "ast/macros/quasi_macros.h"
|
||||
#include "smt/asserted_formulas.h"
|
||||
|
||||
asserted_formulas::asserted_formulas(ast_manager & m, smt_params & p):
|
||||
asserted_formulas::asserted_formulas(ast_manager & m, smt_params & sp, params_ref const& p):
|
||||
m(m),
|
||||
m_smt_params(sp),
|
||||
m_params(p),
|
||||
m_rewriter(m),
|
||||
m_substitution(m),
|
||||
|
@ -46,7 +47,6 @@ asserted_formulas::asserted_formulas(ast_manager & m, smt_params & p):
|
|||
m_refine_inj_axiom(*this),
|
||||
m_max_bv_sharing_fn(*this),
|
||||
m_elim_term_ite(*this),
|
||||
m_pull_cheap_ite_trees(*this),
|
||||
m_pull_nested_quantifiers(*this),
|
||||
m_elim_bvs_from_quantifiers(*this),
|
||||
m_cheap_quant_fourier_motzkin(*this),
|
||||
|
@ -66,20 +66,20 @@ asserted_formulas::asserted_formulas(ast_manager & m, smt_params & p):
|
|||
}
|
||||
|
||||
void asserted_formulas::setup() {
|
||||
switch (m_params.m_lift_ite) {
|
||||
switch (m_smt_params.m_lift_ite) {
|
||||
case LI_FULL:
|
||||
m_params.m_ng_lift_ite = LI_NONE;
|
||||
m_smt_params.m_ng_lift_ite = LI_NONE;
|
||||
break;
|
||||
case LI_CONSERVATIVE:
|
||||
if (m_params.m_ng_lift_ite == LI_CONSERVATIVE)
|
||||
m_params.m_ng_lift_ite = LI_NONE;
|
||||
if (m_smt_params.m_ng_lift_ite == LI_CONSERVATIVE)
|
||||
m_smt_params.m_ng_lift_ite = LI_NONE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (m_params.m_relevancy_lvl == 0)
|
||||
m_params.m_relevancy_lemma = false;
|
||||
if (m_smt_params.m_relevancy_lvl == 0)
|
||||
m_smt_params.m_relevancy_lemma = false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -90,7 +90,7 @@ void asserted_formulas::push_assertion(expr * e, proof * pr, vector<justified_ex
|
|||
if (inconsistent()) {
|
||||
return;
|
||||
}
|
||||
expr* e1 = 0;
|
||||
expr* e1 = nullptr;
|
||||
if (m.is_false(e)) {
|
||||
result.push_back(justified_expr(m, e, pr));
|
||||
m_inconsistent = true;
|
||||
|
@ -101,14 +101,14 @@ void asserted_formulas::push_assertion(expr * e, proof * pr, vector<justified_ex
|
|||
else if (m.is_and(e)) {
|
||||
for (unsigned i = 0; i < to_app(e)->get_num_args(); ++i) {
|
||||
expr* arg = to_app(e)->get_arg(i);
|
||||
proof_ref _pr(m.proofs_enabled() ? m.mk_and_elim(pr, i) : 0, m);
|
||||
proof_ref _pr(m.proofs_enabled() ? m.mk_and_elim(pr, i) : nullptr, m);
|
||||
push_assertion(arg, _pr, result);
|
||||
}
|
||||
}
|
||||
else if (m.is_not(e, e1) && m.is_or(e1)) {
|
||||
for (unsigned i = 0; i < to_app(e1)->get_num_args(); ++i) {
|
||||
expr* arg = to_app(e1)->get_arg(i);
|
||||
proof_ref _pr(m.proofs_enabled() ? m.mk_not_or_elim(pr, i) : 0, m);
|
||||
proof_ref _pr(m.proofs_enabled() ? m.mk_not_or_elim(pr, i) : nullptr, m);
|
||||
expr_ref narg(mk_not(m, arg), m);
|
||||
push_assertion(narg, _pr, result);
|
||||
}
|
||||
|
@ -118,20 +118,24 @@ void asserted_formulas::push_assertion(expr * e, proof * pr, vector<justified_ex
|
|||
}
|
||||
}
|
||||
|
||||
void asserted_formulas::updt_params(params_ref const& p) {
|
||||
m_params.append(p);
|
||||
}
|
||||
|
||||
void asserted_formulas::set_eliminate_and(bool flag) {
|
||||
if (flag == m_elim_and) return;
|
||||
m_elim_and = flag;
|
||||
params_ref p;
|
||||
p.set_bool("pull_cheap_ite", false);
|
||||
p.set_bool("elim_and", flag);
|
||||
p.set_bool("arith_ineq_lhs", true);
|
||||
p.set_bool("sort_sums", true);
|
||||
p.set_bool("rewrite_patterns", true);
|
||||
p.set_bool("eq2ineq", m_params.m_arith_eq2ineq);
|
||||
p.set_bool("gcd_rounding", true);
|
||||
p.set_bool("expand_select_store", true);
|
||||
p.set_bool("bv_sort_ac", true);
|
||||
m_rewriter.updt_params(p);
|
||||
if (m_smt_params.m_pull_cheap_ite) m_params.set_bool("pull_cheap_ite", true);
|
||||
m_params.set_bool("elim_and", flag);
|
||||
m_params.set_bool("arith_ineq_lhs", true);
|
||||
m_params.set_bool("sort_sums", true);
|
||||
m_params.set_bool("rewrite_patterns", true);
|
||||
m_params.set_bool("eq2ineq", m_smt_params.m_arith_eq2ineq);
|
||||
m_params.set_bool("gcd_rounding", true);
|
||||
m_params.set_bool("expand_select_store", true);
|
||||
m_params.set_bool("bv_sort_ac", true);
|
||||
m_params.set_bool("som", true);
|
||||
m_rewriter.updt_params(m_params);
|
||||
flush_cache();
|
||||
}
|
||||
|
||||
|
@ -143,7 +147,7 @@ void asserted_formulas::assert_expr(expr * e, proof * _in_pr) {
|
|||
if (inconsistent())
|
||||
return;
|
||||
|
||||
if (m_params.m_preprocess) {
|
||||
if (m_smt_params.m_preprocess) {
|
||||
TRACE("assert_expr_bug", tout << r << "\n";);
|
||||
set_eliminate_and(false); // do not eliminate and before nnf.
|
||||
m_rewriter(e, r, pr);
|
||||
|
@ -226,7 +230,7 @@ void asserted_formulas::reduce() {
|
|||
return;
|
||||
if (m_qhead == m_formulas.size())
|
||||
return;
|
||||
if (!m_params.m_preprocess)
|
||||
if (!m_smt_params.m_preprocess)
|
||||
return;
|
||||
if (m_macro_manager.has_macros())
|
||||
invoke(m_find_macros);
|
||||
|
@ -240,7 +244,6 @@ void asserted_formulas::reduce() {
|
|||
if (!invoke(m_nnf_cnf)) return;
|
||||
set_eliminate_and(true);
|
||||
if (!invoke(m_reduce_asserted_formulas)) return;
|
||||
if (!invoke(m_pull_cheap_ite_trees)) return;
|
||||
if (!invoke(m_pull_nested_quantifiers)) return;
|
||||
if (!invoke(m_lift_ite)) return;
|
||||
if (!invoke(m_ng_lift_ite)) return;
|
||||
|
@ -375,7 +378,7 @@ void asserted_formulas::nnf_cnf() {
|
|||
unsigned sz2 = push_todo.size();
|
||||
for (unsigned k = 0; k < sz2; k++) {
|
||||
expr * n = push_todo.get(k);
|
||||
pr = 0;
|
||||
pr = nullptr;
|
||||
m_rewriter(n, r1, pr1);
|
||||
CASSERT("well_sorted",is_well_sorted(m, r1));
|
||||
if (canceled()) {
|
||||
|
@ -597,15 +600,15 @@ void asserted_formulas::compute_depth(expr* e) {
|
|||
|
||||
proof * asserted_formulas::get_inconsistency_proof() const {
|
||||
if (!inconsistent())
|
||||
return 0;
|
||||
return nullptr;
|
||||
if (!m.proofs_enabled())
|
||||
return 0;
|
||||
return nullptr;
|
||||
for (justified_expr const& j : m_formulas) {
|
||||
if (m.is_false(j.get_fml()))
|
||||
return j.get_proof();
|
||||
}
|
||||
UNREACHABLE();
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void asserted_formulas::refine_inj_axiom_fn::simplify(justified_expr const& j, expr_ref& n, proof_ref& p) {
|
||||
|
|
|
@ -26,7 +26,6 @@ Revision History:
|
|||
#include "ast/rewriter/bit2int.h"
|
||||
#include "ast/rewriter/maximize_ac_sharing.h"
|
||||
#include "ast/rewriter/distribute_forall.h"
|
||||
#include "ast/rewriter/pull_ite_tree.h"
|
||||
#include "ast/rewriter/push_app_ite.h"
|
||||
#include "ast/rewriter/inj_axiom.h"
|
||||
#include "ast/rewriter/bv_elim.h"
|
||||
|
@ -44,7 +43,8 @@ Revision History:
|
|||
class asserted_formulas {
|
||||
|
||||
ast_manager & m;
|
||||
smt_params & m_params;
|
||||
smt_params & m_smt_params;
|
||||
params_ref m_params;
|
||||
th_rewriter m_rewriter;
|
||||
expr_substitution m_substitution;
|
||||
scoped_expr_substitution m_scoped_substitution;
|
||||
|
@ -82,80 +82,80 @@ class asserted_formulas {
|
|||
class reduce_asserted_formulas_fn : public simplify_fmls {
|
||||
public:
|
||||
reduce_asserted_formulas_fn(asserted_formulas& af): simplify_fmls(af, "reduce-asserted") {}
|
||||
virtual void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) { af.m_rewriter(j.get_fml(), n, p); }
|
||||
void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { af.m_rewriter(j.get_fml(), n, p); }
|
||||
};
|
||||
|
||||
class find_macros_fn : public simplify_fmls {
|
||||
public:
|
||||
find_macros_fn(asserted_formulas& af): simplify_fmls(af, "find-macros") {}
|
||||
virtual void operator()() { af.find_macros_core(); }
|
||||
virtual bool should_apply() const { return af.m_params.m_macro_finder && af.has_quantifiers(); }
|
||||
virtual void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) { UNREACHABLE(); }
|
||||
void operator()() override { af.find_macros_core(); }
|
||||
bool should_apply() const override { return af.m_smt_params.m_macro_finder && af.has_quantifiers(); }
|
||||
void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { UNREACHABLE(); }
|
||||
};
|
||||
|
||||
class apply_quasi_macros_fn : public simplify_fmls {
|
||||
public:
|
||||
apply_quasi_macros_fn(asserted_formulas& af): simplify_fmls(af, "find-quasi-macros") {}
|
||||
virtual void operator()() { af.apply_quasi_macros(); }
|
||||
virtual bool should_apply() const { return af.m_params.m_quasi_macros && af.has_quantifiers(); }
|
||||
virtual void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) { UNREACHABLE(); }
|
||||
void operator()() override { af.apply_quasi_macros(); }
|
||||
bool should_apply() const override { return af.m_smt_params.m_quasi_macros && af.has_quantifiers(); }
|
||||
void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { UNREACHABLE(); }
|
||||
};
|
||||
|
||||
class nnf_cnf_fn : public simplify_fmls {
|
||||
public:
|
||||
nnf_cnf_fn(asserted_formulas& af): simplify_fmls(af, "nnf-cnf") {}
|
||||
virtual void operator()() { af.nnf_cnf(); }
|
||||
virtual bool should_apply() const { return af.m_params.m_nnf_cnf || (af.m_params.m_mbqi && af.has_quantifiers()); }
|
||||
virtual void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) { UNREACHABLE(); }
|
||||
void operator()() override { af.nnf_cnf(); }
|
||||
bool should_apply() const override { return af.m_smt_params.m_nnf_cnf || (af.m_smt_params.m_mbqi && af.has_quantifiers()); }
|
||||
void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { UNREACHABLE(); }
|
||||
};
|
||||
|
||||
class propagate_values_fn : public simplify_fmls {
|
||||
public:
|
||||
propagate_values_fn(asserted_formulas& af): simplify_fmls(af, "propagate-values") {}
|
||||
virtual void operator()() { af.propagate_values(); }
|
||||
virtual bool should_apply() const { return af.m_params.m_propagate_values; }
|
||||
virtual void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) { UNREACHABLE(); }
|
||||
void operator()() override { af.propagate_values(); }
|
||||
bool should_apply() const override { return af.m_smt_params.m_propagate_values; }
|
||||
void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { UNREACHABLE(); }
|
||||
};
|
||||
|
||||
class distribute_forall_fn : public simplify_fmls {
|
||||
distribute_forall m_functor;
|
||||
public:
|
||||
distribute_forall_fn(asserted_formulas& af): simplify_fmls(af, "distribute-forall"), m_functor(af.m) {}
|
||||
virtual void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) { m_functor(j.get_fml(), n); }
|
||||
virtual bool should_apply() const { return af.m_params.m_distribute_forall && af.has_quantifiers(); }
|
||||
virtual void post_op() { af.reduce_and_solve(); TRACE("asserted_formulas", af.display(tout);); }
|
||||
void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { m_functor(j.get_fml(), n); }
|
||||
bool should_apply() const override { return af.m_smt_params.m_distribute_forall && af.has_quantifiers(); }
|
||||
void post_op() override { af.reduce_and_solve(); TRACE("asserted_formulas", af.display(tout);); }
|
||||
};
|
||||
|
||||
class pattern_inference_fn : public simplify_fmls {
|
||||
pattern_inference_rw m_infer;
|
||||
public:
|
||||
pattern_inference_fn(asserted_formulas& af): simplify_fmls(af, "pattern-inference"), m_infer(af.m, af.m_params) {}
|
||||
virtual void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) { m_infer(j.get_fml(), n, p); }
|
||||
virtual bool should_apply() const { return af.m_params.m_ematching && af.has_quantifiers(); }
|
||||
pattern_inference_fn(asserted_formulas& af): simplify_fmls(af, "pattern-inference"), m_infer(af.m, af.m_smt_params) {}
|
||||
void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { m_infer(j.get_fml(), n, p); }
|
||||
bool should_apply() const override { return af.m_smt_params.m_ematching && af.has_quantifiers(); }
|
||||
};
|
||||
|
||||
class refine_inj_axiom_fn : public simplify_fmls {
|
||||
public:
|
||||
refine_inj_axiom_fn(asserted_formulas& af): simplify_fmls(af, "refine-injectivity") {}
|
||||
virtual void simplify(justified_expr const& j, expr_ref& n, proof_ref& p);
|
||||
virtual bool should_apply() const { return af.m_params.m_refine_inj_axiom && af.has_quantifiers(); }
|
||||
void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override;
|
||||
bool should_apply() const override { return af.m_smt_params.m_refine_inj_axiom && af.has_quantifiers(); }
|
||||
};
|
||||
|
||||
class max_bv_sharing_fn : public simplify_fmls {
|
||||
public:
|
||||
max_bv_sharing_fn(asserted_formulas& af): simplify_fmls(af, "maximizing-bv-sharing") {}
|
||||
virtual void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) { af.m_bv_sharing(j.get_fml(), n, p); }
|
||||
virtual bool should_apply() const { return af.m_params.m_max_bv_sharing; }
|
||||
virtual void post_op() { af.m_reduce_asserted_formulas(); }
|
||||
void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { af.m_bv_sharing(j.get_fml(), n, p); }
|
||||
bool should_apply() const override { return af.m_smt_params.m_max_bv_sharing; }
|
||||
void post_op() override { af.m_reduce_asserted_formulas(); }
|
||||
};
|
||||
|
||||
class elim_term_ite_fn : public simplify_fmls {
|
||||
elim_term_ite_rw m_elim;
|
||||
public:
|
||||
elim_term_ite_fn(asserted_formulas& af): simplify_fmls(af, "elim-term-ite"), m_elim(af.m, af.m_defined_names) {}
|
||||
virtual void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) { m_elim(j.get_fml(), n, p); }
|
||||
virtual bool should_apply() const { return af.m_params.m_eliminate_term_ite && af.m_params.m_lift_ite != LI_FULL; }
|
||||
virtual void post_op() { af.m_formulas.append(m_elim.new_defs()); af.reduce_and_solve(); m_elim.reset(); }
|
||||
void simplify(justified_expr const& j, expr_ref& n, proof_ref& p) override { m_elim(j.get_fml(), n, p); }
|
||||
bool should_apply() const override { return af.m_smt_params.m_eliminate_term_ite && af.m_smt_params.m_lift_ite != LI_FULL; }
|
||||
void post_op() override { af.m_formulas.append(m_elim.new_defs()); af.reduce_and_solve(); m_elim.reset(); }
|
||||
};
|
||||
|
||||
#define MK_SIMPLIFIERA(NAME, FUNCTOR, MSG, APP, ARG, REDUCE) \
|
||||
|
@ -172,13 +172,12 @@ class asserted_formulas {
|
|||
|
||||
#define MK_SIMPLIFIERF(NAME, FUNCTOR, MSG, APP, REDUCE) MK_SIMPLIFIERA(NAME, FUNCTOR, MSG, APP, (af.m), REDUCE)
|
||||
|
||||
MK_SIMPLIFIERF(pull_cheap_ite_trees, pull_cheap_ite_tree_rw, "pull-cheap-ite-trees", af.m_params.m_pull_cheap_ite_trees, false);
|
||||
MK_SIMPLIFIERF(pull_nested_quantifiers, pull_nested_quant, "pull-nested-quantifiers", af.m_params.m_pull_nested_quantifiers && af.has_quantifiers(), false);
|
||||
MK_SIMPLIFIERF(cheap_quant_fourier_motzkin, elim_bounds_rw, "cheap-fourier-motzkin", af.m_params.m_eliminate_bounds && af.has_quantifiers(), true);
|
||||
MK_SIMPLIFIERF(elim_bvs_from_quantifiers, bv_elim_rw, "eliminate-bit-vectors-from-quantifiers", af.m_params.m_bb_quantifiers, true);
|
||||
MK_SIMPLIFIERF(apply_bit2int, bit2int, "propagate-bit-vector-over-integers", af.m_params.m_simplify_bit2int, true);
|
||||
MK_SIMPLIFIERA(lift_ite, push_app_ite_rw, "lift-ite", af.m_params.m_lift_ite != LI_NONE, (af.m, af.m_params.m_lift_ite == LI_CONSERVATIVE), true);
|
||||
MK_SIMPLIFIERA(ng_lift_ite, ng_push_app_ite_rw, "lift-ite", af.m_params.m_ng_lift_ite != LI_NONE, (af.m, af.m_params.m_ng_lift_ite == LI_CONSERVATIVE), true);
|
||||
MK_SIMPLIFIERF(pull_nested_quantifiers, pull_nested_quant, "pull-nested-quantifiers", af.m_smt_params.m_pull_nested_quantifiers && af.has_quantifiers(), false);
|
||||
MK_SIMPLIFIERF(cheap_quant_fourier_motzkin, elim_bounds_rw, "cheap-fourier-motzkin", af.m_smt_params.m_eliminate_bounds && af.has_quantifiers(), true);
|
||||
MK_SIMPLIFIERF(elim_bvs_from_quantifiers, bv_elim_rw, "eliminate-bit-vectors-from-quantifiers", af.m_smt_params.m_bb_quantifiers, true);
|
||||
MK_SIMPLIFIERF(apply_bit2int, bit2int, "propagate-bit-vector-over-integers", af.m_smt_params.m_simplify_bit2int, true);
|
||||
MK_SIMPLIFIERA(lift_ite, push_app_ite_rw, "lift-ite", af.m_smt_params.m_lift_ite != LI_NONE, (af.m, af.m_smt_params.m_lift_ite == LI_CONSERVATIVE), true);
|
||||
MK_SIMPLIFIERA(ng_lift_ite, ng_push_app_ite_rw, "lift-ite", af.m_smt_params.m_ng_lift_ite != LI_NONE, (af.m, af.m_smt_params.m_ng_lift_ite == LI_CONSERVATIVE), true);
|
||||
|
||||
|
||||
reduce_asserted_formulas_fn m_reduce_asserted_formulas;
|
||||
|
@ -187,7 +186,6 @@ class asserted_formulas {
|
|||
refine_inj_axiom_fn m_refine_inj_axiom;
|
||||
max_bv_sharing_fn m_max_bv_sharing_fn;
|
||||
elim_term_ite_fn m_elim_term_ite;
|
||||
pull_cheap_ite_trees m_pull_cheap_ite_trees;
|
||||
pull_nested_quantifiers m_pull_nested_quantifiers;
|
||||
elim_bvs_from_quantifiers m_elim_bvs_from_quantifiers;
|
||||
cheap_quant_fourier_motzkin m_cheap_quant_fourier_motzkin;
|
||||
|
@ -219,14 +217,14 @@ class asserted_formulas {
|
|||
bool is_gt(expr* lhs, expr* rhs);
|
||||
void compute_depth(expr* e);
|
||||
unsigned depth(expr* e) { return m_expr2depth[e]; }
|
||||
bool pull_cheap_ite_trees();
|
||||
|
||||
void init(unsigned num_formulas, expr * const * formulas, proof * const * prs);
|
||||
|
||||
public:
|
||||
asserted_formulas(ast_manager & m, smt_params & p);
|
||||
asserted_formulas(ast_manager & m, smt_params & smtp, params_ref const& p);
|
||||
~asserted_formulas();
|
||||
|
||||
void updt_params(params_ref const& p);
|
||||
bool has_quantifiers() const { return m_has_quantifiers; }
|
||||
void setup();
|
||||
void assert_expr(expr * e, proof * in_pr);
|
||||
|
|
|
@ -44,7 +44,7 @@ void cached_var_subst::reset() {
|
|||
void cached_var_subst::operator()(quantifier * qa, unsigned num_bindings, smt::enode * const * bindings, expr_ref & result) {
|
||||
m_new_keys.reserve(num_bindings+1, 0);
|
||||
key * new_key = m_new_keys[num_bindings];
|
||||
if (new_key == 0)
|
||||
if (new_key == nullptr)
|
||||
new_key = static_cast<key*>(m_region.allocate(sizeof(key) + sizeof(expr*)*num_bindings));
|
||||
|
||||
new_key->m_qa = qa;
|
||||
|
@ -52,7 +52,7 @@ void cached_var_subst::operator()(quantifier * qa, unsigned num_bindings, smt::e
|
|||
for (unsigned i = 0; i < num_bindings; i++)
|
||||
new_key->m_bindings[i] = bindings[i]->get_owner();
|
||||
|
||||
instances::entry * entry = m_instances.insert_if_not_there2(new_key, 0);
|
||||
instances::entry * entry = m_instances.insert_if_not_there2(new_key, nullptr);
|
||||
if (entry->get_data().m_key != new_key) {
|
||||
SASSERT(entry->get_data().m_value != 0);
|
||||
// entry was already there
|
||||
|
|
|
@ -39,12 +39,12 @@ namespace smt {
|
|||
SASSERT(m_app1->get_id() < m_app2->get_id());
|
||||
}
|
||||
|
||||
virtual char const * get_name() const { return "dyn-ack"; }
|
||||
char const * get_name() const override { return "dyn-ack"; }
|
||||
|
||||
virtual void get_antecedents(conflict_resolution & cr) {
|
||||
void get_antecedents(conflict_resolution & cr) override {
|
||||
}
|
||||
|
||||
virtual void display_debug_info(conflict_resolution & cr, std::ostream & out) {
|
||||
void display_debug_info(conflict_resolution & cr, std::ostream & out) override {
|
||||
ast_manager & m = cr.get_manager();
|
||||
out << "m_app1:\n" << mk_pp(m_app1, m) << "\n";
|
||||
out << "m_app2:\n" << mk_pp(m_app2, m) << "\n";
|
||||
|
@ -70,7 +70,7 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
|
||||
virtual proof * mk_proof(conflict_resolution & cr) {
|
||||
proof * mk_proof(conflict_resolution & cr) override {
|
||||
ast_manager & m = cr.get_manager();
|
||||
context & ctx = cr.get_context();
|
||||
unsigned num_args = m_app1->get_num_args();
|
||||
|
@ -288,8 +288,8 @@ namespace smt {
|
|||
dyn_ack_clause_del_eh(dyn_ack_manager & m):
|
||||
m_manager(m) {
|
||||
}
|
||||
virtual ~dyn_ack_clause_del_eh() {}
|
||||
virtual void operator()(ast_manager & m, clause * cls) {
|
||||
~dyn_ack_clause_del_eh() override {}
|
||||
void operator()(ast_manager & m, clause * cls) override {
|
||||
m_manager.del_clause_eh(cls);
|
||||
dealloc(this);
|
||||
}
|
||||
|
@ -299,7 +299,7 @@ namespace smt {
|
|||
TRACE("dyn_ack", tout << "del_clause_eh: "; m_context.display_clause(tout, cls); tout << "\n";);
|
||||
m_context.m_stats.m_num_del_dyn_ack++;
|
||||
|
||||
app_pair p((app*)0,(app*)0);
|
||||
app_pair p((app*)nullptr,(app*)nullptr);
|
||||
if (m_clause2app_pair.find(cls, p)) {
|
||||
SASSERT(p.first && p.second);
|
||||
m_instantiated.erase(p);
|
||||
|
@ -371,7 +371,7 @@ namespace smt {
|
|||
lits.push_back(mk_eq(n1, n2));
|
||||
clause_del_eh * del_eh = alloc(dyn_ack_clause_del_eh, *this);
|
||||
|
||||
justification * js = 0;
|
||||
justification * js = nullptr;
|
||||
if (m_manager.proofs_enabled())
|
||||
js = alloc(dyn_ack_justification, n1, n2);
|
||||
clause * cls = m_context.mk_clause(lits.size(), lits.c_ptr(), js, CLS_AUX_LEMMA, del_eh);
|
||||
|
@ -423,7 +423,7 @@ namespace smt {
|
|||
lits.push_back(mk_eq(n1, n2));
|
||||
clause_del_eh * del_eh = alloc(dyn_ack_clause_del_eh, *this);
|
||||
|
||||
justification * js = 0;
|
||||
justification * js = nullptr;
|
||||
if (m_manager.proofs_enabled())
|
||||
js = alloc(dyn_ack_justification, n1, n2);
|
||||
clause * cls = m_context.mk_clause(lits.size(), lits.c_ptr(), js, CLS_AUX_LEMMA, del_eh);
|
||||
|
|
|
@ -311,7 +311,7 @@ bool expr_context_simplifier::is_false(expr* e) const {
|
|||
//
|
||||
|
||||
expr_strong_context_simplifier::expr_strong_context_simplifier(smt_params& p, ast_manager& m):
|
||||
m_manager(m), m_arith(m), m_fn(0,m), m_solver(m, p) {
|
||||
m_manager(m), m_arith(m), m_fn(nullptr,m), m_solver(m, p) {
|
||||
sort* i_sort = m_arith.mk_int();
|
||||
m_fn = m.mk_func_decl(symbol(0xbeef101), i_sort, m.mk_bool_sort());
|
||||
}
|
||||
|
@ -358,7 +358,7 @@ void expr_strong_context_simplifier::simplify_basic(expr* fml, expr_ref& result)
|
|||
m_solver.push();
|
||||
while (!todo.empty()) {
|
||||
|
||||
r = 0;
|
||||
r = nullptr;
|
||||
ptr_buffer<expr> args;
|
||||
expr* e = todo.back();
|
||||
unsigned pos = parent_ids.back();
|
||||
|
@ -405,7 +405,7 @@ void expr_strong_context_simplifier::simplify_basic(expr* fml, expr_ref& result)
|
|||
self_pos = self_ids.back();
|
||||
sz = a->get_num_args();
|
||||
|
||||
n2 = 0;
|
||||
n2 = nullptr;
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
expr* arg = a->get_arg(i);
|
||||
|
||||
|
@ -620,7 +620,7 @@ void expr_strong_context_simplifier::simplify_model_based(expr* fml, expr_ref& r
|
|||
m_solver.push();
|
||||
while (!todo.empty()) {
|
||||
|
||||
r = 0;
|
||||
r = nullptr;
|
||||
ptr_buffer<expr> args;
|
||||
expr* e = todo.back();
|
||||
unsigned pos = parent_ids.back();
|
||||
|
@ -681,7 +681,7 @@ void expr_strong_context_simplifier::simplify_model_based(expr* fml, expr_ref& r
|
|||
self_pos = self_ids.back();
|
||||
sz = a->get_num_args();
|
||||
|
||||
n2 = 0;
|
||||
n2 = nullptr;
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
expr* arg = a->get_arg(i);
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace smt {
|
|||
m_data(d),
|
||||
m_data_hash(d_h),
|
||||
m_num_args(n),
|
||||
m_args(0) {
|
||||
m_args(nullptr) {
|
||||
m_args = new (r) enode*[n];
|
||||
memcpy(m_args, args, sizeof(enode*) * n);
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ namespace smt {
|
|||
fingerprint * fingerprint_set::insert(void * data, unsigned data_hash, unsigned num_args, enode * const * args) {
|
||||
fingerprint * d = mk_dummy(data, data_hash, num_args, args);
|
||||
if (m_set.contains(d))
|
||||
return 0;
|
||||
return nullptr;
|
||||
TRACE("fingerprint_bug", tout << "1) inserting: " << data_hash << " num_args: " << num_args;
|
||||
for (unsigned i = 0; i < num_args; i++) tout << " " << args[i]->get_owner_id();
|
||||
tout << "\n";);
|
||||
|
@ -64,7 +64,7 @@ namespace smt {
|
|||
TRACE("fingerprint_bug", tout << "failed: " << data_hash << " num_args: " << num_args;
|
||||
for (unsigned i = 0; i < num_args; i++) tout << " " << d->m_args[i]->get_owner_id();
|
||||
tout << "\n";);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
TRACE("fingerprint_bug", tout << "2) inserting: " << data_hash << " num_args: " << num_args;
|
||||
for (unsigned i = 0; i < num_args; i++) tout << " " << args[i]->get_owner_id();
|
||||
|
|
156
src/smt/mam.cpp
156
src/smt/mam.cpp
|
@ -188,7 +188,7 @@ namespace smt {
|
|||
1) Variables: (f ... X ...)
|
||||
2) Ground terms: (f ... t ...)
|
||||
3) depth 2 joint: (f ... (g ... X ...) ...)
|
||||
Joint2 stores the declartion g, and the position of variable X, and its idx.
|
||||
Joint2 stores the declaration g, and the position of variable X, and its idx.
|
||||
|
||||
\remark Z3 has no support for depth 3 joints (f ... (g ... (h ... X ...) ...) ....)
|
||||
*/
|
||||
|
@ -211,7 +211,7 @@ namespace smt {
|
|||
approx_set m_lbl_set; // singleton set containing m_label
|
||||
/*
|
||||
The following field is an array of tagged pointers.
|
||||
Each positon contains:
|
||||
Each position contains:
|
||||
1- null (no joint), NULL_TAG
|
||||
2- a boxed integer (i.e., register that contains the variable bind) VAR_TAG
|
||||
3- an enode pointer (ground term) GROUND_TERM_TAG
|
||||
|
@ -423,20 +423,20 @@ namespace smt {
|
|||
instruction * curr = head;
|
||||
out << *curr;
|
||||
curr = curr->m_next;
|
||||
while (curr != 0 && curr->m_opcode != CHOOSE && curr->m_opcode != NOOP) {
|
||||
while (curr != nullptr && curr->m_opcode != CHOOSE && curr->m_opcode != NOOP) {
|
||||
out << "\n";
|
||||
out << *curr;
|
||||
curr = curr->m_next;
|
||||
}
|
||||
out << "\n";
|
||||
if (curr != 0) {
|
||||
if (curr != nullptr) {
|
||||
display_children(out, static_cast<choose*>(curr), indent + 1);
|
||||
}
|
||||
}
|
||||
|
||||
void display_children(std::ostream & out, choose * first_child, unsigned indent) const {
|
||||
choose * curr = first_child;
|
||||
while (curr != 0) {
|
||||
while (curr != nullptr) {
|
||||
display_seq(out, curr, indent);
|
||||
curr = curr->m_alt;
|
||||
}
|
||||
|
@ -485,7 +485,7 @@ namespace smt {
|
|||
m_filter_candidates(filter_candidates),
|
||||
m_num_regs(num_args + 1),
|
||||
m_num_choices(0),
|
||||
m_root(0) {
|
||||
m_root(nullptr) {
|
||||
DEBUG_CODE(m_context = 0;);
|
||||
#ifdef _PROFILE_MAM
|
||||
m_counter = 0;
|
||||
|
@ -607,7 +607,7 @@ namespace smt {
|
|||
void * mem = m_region.allocate(size);
|
||||
OP * r = new (mem) OP;
|
||||
r->m_opcode = op;
|
||||
r->m_next = 0;
|
||||
r->m_next = nullptr;
|
||||
#ifdef _PROFILE_MAM
|
||||
r->m_counter = 0;
|
||||
#endif
|
||||
|
@ -696,7 +696,7 @@ namespace smt {
|
|||
|
||||
choose * mk_noop() {
|
||||
choose * r = mk_instr<choose>(NOOP, sizeof(choose));
|
||||
r->m_alt = 0;
|
||||
r->m_alt = nullptr;
|
||||
return r;
|
||||
}
|
||||
|
||||
|
@ -923,7 +923,7 @@ namespace smt {
|
|||
*/
|
||||
void linearise_core() {
|
||||
m_aux.reset();
|
||||
app * first_app = 0;
|
||||
app * first_app = nullptr;
|
||||
unsigned first_app_reg;
|
||||
unsigned first_app_sz;
|
||||
unsigned first_app_num_unbound_vars;
|
||||
|
@ -1111,7 +1111,7 @@ namespace smt {
|
|||
// multi_pattern support
|
||||
for (unsigned i = 1; i < num_args; i++) {
|
||||
// select the pattern with the biggest number of bound variables
|
||||
app * best = 0;
|
||||
app * best = nullptr;
|
||||
unsigned best_num_bvars = 0;
|
||||
unsigned best_j = 0;
|
||||
bool found_bounded_mp = false;
|
||||
|
@ -1127,7 +1127,7 @@ namespace smt {
|
|||
found_bounded_mp = true;
|
||||
break;
|
||||
}
|
||||
if (best == 0 || (num_bvars > best_num_bvars)) {
|
||||
if (best == nullptr || (num_bvars > best_num_bvars)) {
|
||||
best = p;
|
||||
best_num_bvars = num_bvars;
|
||||
best_j = j;
|
||||
|
@ -1286,16 +1286,16 @@ namespace smt {
|
|||
|
||||
choose * find_best_child(choose * first_child) {
|
||||
unsigned num_too_simple = 0;
|
||||
choose * best_child = 0;
|
||||
choose * best_child = nullptr;
|
||||
unsigned max_compatibility = 0;
|
||||
choose * curr_child = first_child;
|
||||
while (curr_child != 0) {
|
||||
while (curr_child != nullptr) {
|
||||
bool simple = false;
|
||||
unsigned curr_compatibility = get_compatibility_measure(curr_child, simple);
|
||||
if (simple) {
|
||||
num_too_simple++;
|
||||
if (num_too_simple > FIND_BEST_CHILD_THRESHOLD)
|
||||
return 0; // it is unlikely we will find a compatible node
|
||||
return nullptr; // it is unlikely we will find a compatible node
|
||||
}
|
||||
if (curr_compatibility > max_compatibility) {
|
||||
best_child = curr_child;
|
||||
|
@ -1310,7 +1310,7 @@ namespace smt {
|
|||
unsigned ireg = instr->m_ireg;
|
||||
expr * n = m_registers[ireg];
|
||||
return
|
||||
n != 0 &&
|
||||
n != nullptr &&
|
||||
is_app(n) &&
|
||||
// It is wasteful to use a bind of a ground term.
|
||||
// Actually, in the rest of the code I assume that.
|
||||
|
@ -1450,7 +1450,7 @@ namespace smt {
|
|||
unsigned weight = 0;
|
||||
unsigned num_instr = 0;
|
||||
instruction * curr = child->m_next;
|
||||
while (curr != 0 && curr->m_opcode != CHOOSE && curr->m_opcode != NOOP) {
|
||||
while (curr != nullptr && curr->m_opcode != CHOOSE && curr->m_opcode != NOOP) {
|
||||
num_instr++;
|
||||
switch (curr->m_opcode) {
|
||||
case BIND1: case BIND2: case BIND3: case BIND4: case BIND5: case BIND6: case BINDN:
|
||||
|
@ -1493,7 +1493,7 @@ namespace smt {
|
|||
}
|
||||
curr = curr->m_next;
|
||||
}
|
||||
if (num_instr > SIMPLE_SEQ_THRESHOLD || (curr != 0 && curr->m_opcode == CHOOSE))
|
||||
if (num_instr > SIMPLE_SEQ_THRESHOLD || (curr != nullptr && curr->m_opcode == CHOOSE))
|
||||
simple = false;
|
||||
unsigned_vector::iterator it = m_to_reset.begin();
|
||||
unsigned_vector::iterator end = m_to_reset.end();
|
||||
|
@ -1509,7 +1509,7 @@ namespace smt {
|
|||
TRACE("mam_compiler_detail", tout << "processing head: " << *head << "\n";);
|
||||
instruction * curr = head->m_next;
|
||||
instruction * last = head;
|
||||
while (curr != 0 && curr->m_opcode != CHOOSE && curr->m_opcode != NOOP) {
|
||||
while (curr != nullptr && curr->m_opcode != CHOOSE && curr->m_opcode != NOOP) {
|
||||
TRACE("mam_compiler_detail", tout << "processing instr: " << *curr << "\n";);
|
||||
switch (curr->m_opcode) {
|
||||
case BIND1: case BIND2: case BIND3: case BIND4: case BIND5: case BIND6: case BINDN:
|
||||
|
@ -1680,7 +1680,7 @@ namespace smt {
|
|||
SASSERT(curr->m_opcode == CHOOSE);
|
||||
choose * first_child = static_cast<choose *>(curr);
|
||||
choose * best_child = find_best_child(first_child);
|
||||
if (best_child == 0) {
|
||||
if (best_child == nullptr) {
|
||||
// There is no compatible child
|
||||
// Suppose the sequence is:
|
||||
// head -> c1 -> ... -> (cn == last) -> first_child;
|
||||
|
@ -1902,7 +1902,7 @@ namespace smt {
|
|||
curr = curr->get_next();
|
||||
}
|
||||
while (curr != first);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
enode * get_next_f_app(func_decl * lbl, unsigned num_expected_args, enode * first, enode * curr) {
|
||||
|
@ -1914,7 +1914,7 @@ namespace smt {
|
|||
}
|
||||
curr = curr->get_next();
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2094,7 +2094,7 @@ namespace smt {
|
|||
enode_vector * interpreter::mk_depth2_vector(joint2 * j2, func_decl * f, unsigned i) {
|
||||
enode * n = m_registers[j2->m_reg]->get_root();
|
||||
if (n->get_num_parents() == 0)
|
||||
return 0;
|
||||
return nullptr;
|
||||
unsigned num_args = n->get_num_args();
|
||||
enode_vector * v = mk_enode_vector();
|
||||
enode_vector::const_iterator it1 = n->begin_parents();
|
||||
|
@ -2132,7 +2132,7 @@ namespace smt {
|
|||
// quick filter... check if any of the joint points have zero parents...
|
||||
for (unsigned i = 0; i < num_args; i++) {
|
||||
void * bare = c->m_joints[i];
|
||||
enode * n = 0;
|
||||
enode * n = nullptr;
|
||||
switch (GET_TAG(bare)) {
|
||||
case NULL_TAG:
|
||||
goto non_depth1;
|
||||
|
@ -2147,20 +2147,20 @@ namespace smt {
|
|||
}
|
||||
r = n->get_root();
|
||||
if (m_use_filters && r->get_plbls().empty_intersection(c->m_lbl_set))
|
||||
return 0;
|
||||
return nullptr;
|
||||
if (r->get_num_parents() == 0)
|
||||
return 0;
|
||||
return nullptr;
|
||||
non_depth1:
|
||||
;
|
||||
}
|
||||
// traverse each joint and select the best one.
|
||||
enode_vector * best_v = 0;
|
||||
enode_vector * best_v = nullptr;
|
||||
for (unsigned i = 0; i < num_args; i++) {
|
||||
enode * bare = c->m_joints[i];
|
||||
enode_vector * curr_v = 0;
|
||||
enode_vector * curr_v = nullptr;
|
||||
switch (GET_TAG(bare)) {
|
||||
case NULL_TAG:
|
||||
curr_v = 0;
|
||||
curr_v = nullptr;
|
||||
break;
|
||||
case GROUND_TERM_TAG:
|
||||
curr_v = mk_depth1_vector(UNTAG(enode *, bare), lbl, i);
|
||||
|
@ -2172,14 +2172,14 @@ namespace smt {
|
|||
curr_v = mk_depth2_vector(UNTAG(joint2 *, bare), lbl, i);
|
||||
break;
|
||||
}
|
||||
if (curr_v != 0) {
|
||||
if (curr_v->size() < min_sz && (best_v == 0 || curr_v->size() < best_v->size())) {
|
||||
if (curr_v != nullptr) {
|
||||
if (curr_v->size() < min_sz && (best_v == nullptr || curr_v->size() < best_v->size())) {
|
||||
if (best_v)
|
||||
recycle_enode_vector(best_v);
|
||||
best_v = curr_v;
|
||||
if (best_v->empty()) {
|
||||
recycle_enode_vector(best_v);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -2191,10 +2191,10 @@ namespace smt {
|
|||
bp.m_instr = c;
|
||||
bp.m_old_max_generation = m_max_generation;
|
||||
bp.m_old_used_enodes_size = m_used_enodes.size();
|
||||
if (best_v == 0) {
|
||||
if (best_v == nullptr) {
|
||||
TRACE("mam_bug", tout << "m_top: " << m_top << ", m_backtrack_stack.size(): " << m_backtrack_stack.size() << "\n";
|
||||
tout << *c << "\n";);
|
||||
bp.m_to_recycle = 0;
|
||||
bp.m_to_recycle = nullptr;
|
||||
bp.m_it = m_context.begin_enodes_of(lbl);
|
||||
bp.m_end = m_context.end_enodes_of(lbl);
|
||||
}
|
||||
|
@ -2211,7 +2211,7 @@ namespace smt {
|
|||
break;
|
||||
}
|
||||
if (bp.m_it == bp.m_end)
|
||||
return 0;
|
||||
return nullptr;
|
||||
m_top++;
|
||||
update_max_generation(*(bp.m_it));
|
||||
return *(bp.m_it);
|
||||
|
@ -2648,7 +2648,7 @@ namespace smt {
|
|||
m_num_args = static_cast<const cont *>(m_pc)->m_num_args;
|
||||
m_oreg = static_cast<const cont *>(m_pc)->m_oreg;
|
||||
m_app = init_continue(static_cast<const cont *>(m_pc), m_num_args);
|
||||
if (m_app == 0)
|
||||
if (m_app == nullptr)
|
||||
goto backtrack;
|
||||
m_pattern_instances.push_back(m_app);
|
||||
TRACE("mam_int", tout << "continue candidate:\n" << mk_ll_pp(m_app->get_owner(), m_ast_manager););
|
||||
|
@ -2844,7 +2844,7 @@ namespace smt {
|
|||
unsigned m_lbl_id;
|
||||
public:
|
||||
mk_tree_trail(ptr_vector<code_tree> & t, unsigned id):m_trees(t), m_lbl_id(id) {}
|
||||
virtual void undo(mam_impl & m) {
|
||||
void undo(mam_impl & m) override {
|
||||
dealloc(m_trees[m_lbl_id]);
|
||||
m_trees[m_lbl_id] = 0;
|
||||
}
|
||||
|
@ -2911,7 +2911,7 @@ namespace smt {
|
|||
if (lbl_id < m_trees.size())
|
||||
return m_trees[lbl_id];
|
||||
else
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ptr_vector<code_tree>::iterator begin_code_trees() {
|
||||
|
@ -2974,11 +2974,11 @@ namespace smt {
|
|||
if (p1->m_label != p2->m_label ||
|
||||
p1->m_arg_idx != p2->m_arg_idx ||
|
||||
p1->m_pattern_idx != p2->m_pattern_idx ||
|
||||
(p1->m_child == 0) != (p2->m_child == 0)) {
|
||||
(p1->m_child == nullptr) != (p2->m_child == nullptr)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (p1->m_child == 0 && p2->m_child == 0)
|
||||
if (p1->m_child == nullptr && p2->m_child == nullptr)
|
||||
return true;
|
||||
|
||||
p1 = p1->m_child;
|
||||
|
@ -3014,11 +3014,11 @@ namespace smt {
|
|||
m_arg_idx(p->m_arg_idx),
|
||||
m_ground_arg_idx(p->m_ground_arg_idx),
|
||||
m_ground_arg(p->m_ground_arg),
|
||||
m_code(0),
|
||||
m_code(nullptr),
|
||||
m_filter(h(p->m_label)),
|
||||
m_sibling(0),
|
||||
m_first_child(0),
|
||||
m_todo(0) {
|
||||
m_sibling(nullptr),
|
||||
m_first_child(nullptr),
|
||||
m_todo(nullptr) {
|
||||
#ifdef _PROFILE_PATH_TREE
|
||||
m_counter = 0;
|
||||
m_num_eq_visited = 0;
|
||||
|
@ -3029,7 +3029,7 @@ namespace smt {
|
|||
|
||||
void display(std::ostream & out, unsigned indent) {
|
||||
path_tree * curr = this;
|
||||
while (curr != 0) {
|
||||
while (curr != nullptr) {
|
||||
for (unsigned i = 0; i < indent; i++) out << " ";
|
||||
out << curr->m_label->get_name() << ":" << curr->m_arg_idx;
|
||||
if (curr->m_ground_arg)
|
||||
|
@ -3104,7 +3104,7 @@ namespace smt {
|
|||
enode * m_enode;
|
||||
public:
|
||||
add_shared_enode_trail(enode * n):m_enode(n) {}
|
||||
virtual void undo(mam_impl & m) { m.m_shared_enodes.erase(m_enode); }
|
||||
void undo(mam_impl & m) override { m.m_shared_enodes.erase(m_enode); }
|
||||
};
|
||||
|
||||
#ifdef Z3DEBUG
|
||||
|
@ -3122,7 +3122,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
void add_candidate(code_tree * t, enode * app) {
|
||||
if (t != 0) {
|
||||
if (t != nullptr) {
|
||||
TRACE("mam_candidate", tout << "adding candidate:\n" << mk_ll_pp(app->get_owner(), m_ast_manager););
|
||||
if (!t->has_candidates())
|
||||
m_to_match.push_back(t);
|
||||
|
@ -3221,7 +3221,7 @@ namespace smt {
|
|||
for (unsigned j = 0; j < APPROX_SET_CAPACITY; j++) {
|
||||
m_pp[i][j].first = 0;
|
||||
m_pp[i][j].second = 0;
|
||||
m_pc[i][j] = 0;
|
||||
m_pc[i][j] = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3240,10 +3240,10 @@ namespace smt {
|
|||
SASSERT(m_ast_manager.is_pattern(mp));
|
||||
SASSERT(p != 0);
|
||||
unsigned pat_idx = p->m_pattern_idx;
|
||||
path_tree * head = 0;
|
||||
path_tree * curr = 0;
|
||||
path_tree * prev = 0;
|
||||
while (p != 0) {
|
||||
path_tree * head = nullptr;
|
||||
path_tree * curr = nullptr;
|
||||
path_tree * prev = nullptr;
|
||||
while (p != nullptr) {
|
||||
curr = new (m_region) path_tree(p, m_lbl_hasher);
|
||||
if (prev)
|
||||
prev->m_first_child = curr;
|
||||
|
@ -3260,9 +3260,9 @@ namespace smt {
|
|||
void insert(path_tree * t, path * p, quantifier * qa, app * mp) {
|
||||
SASSERT(m_ast_manager.is_pattern(mp));
|
||||
path_tree * head = t;
|
||||
path_tree * prev_sibling = 0;
|
||||
path_tree * prev_sibling = nullptr;
|
||||
bool found_label = false;
|
||||
while (t != 0) {
|
||||
while (t != nullptr) {
|
||||
if (t->m_label == p->m_label) {
|
||||
found_label = true;
|
||||
if (t->m_arg_idx == p->m_arg_idx &&
|
||||
|
@ -3270,8 +3270,8 @@ namespace smt {
|
|||
t->m_ground_arg_idx == p->m_ground_arg_idx
|
||||
) {
|
||||
// found compatible node
|
||||
if (t->m_first_child == 0) {
|
||||
if (p->m_child == 0) {
|
||||
if (t->m_first_child == nullptr) {
|
||||
if (p->m_child == nullptr) {
|
||||
SASSERT(t->m_code != 0);
|
||||
insert_code(t, qa, mp, p->m_pattern_idx);
|
||||
}
|
||||
|
@ -3281,7 +3281,7 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
else {
|
||||
if (p->m_child == 0) {
|
||||
if (p->m_child == nullptr) {
|
||||
if (t->m_code) {
|
||||
insert_code(t, qa, mp, p->m_pattern_idx);
|
||||
}
|
||||
|
@ -3393,7 +3393,7 @@ namespace smt {
|
|||
return mk_enode(m_context, qa, to_app(arg));
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3460,7 +3460,7 @@ namespace smt {
|
|||
unsigned num_patterns = mp->get_num_args();
|
||||
for (unsigned i = 0; i < num_patterns; i++) {
|
||||
app * pat = to_app(mp->get_arg(i));
|
||||
update_filters(pat, 0, qa, mp, i);
|
||||
update_filters(pat, nullptr, qa, mp, i);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3496,7 +3496,7 @@ namespace smt {
|
|||
\brief Collect new E-matching candidates using the inverted path index t.
|
||||
*/
|
||||
void collect_parents(enode * r, path_tree * t) {
|
||||
if (t == 0)
|
||||
if (t == nullptr)
|
||||
return;
|
||||
#ifdef _PROFILE_PATH_TREE
|
||||
t->m_watch.start();
|
||||
|
@ -3604,7 +3604,7 @@ namespace smt {
|
|||
// Filter 2.
|
||||
(
|
||||
// curr_tree has no support for the filter based on a ground argument.
|
||||
curr_tree->m_ground_arg == 0 ||
|
||||
curr_tree->m_ground_arg == nullptr ||
|
||||
// checks whether the child of the parent is equal to the expected ground argument.
|
||||
is_eq(curr_tree->m_ground_arg, curr_parent->get_arg(curr_tree->m_ground_arg_idx))
|
||||
)) {
|
||||
|
@ -3614,7 +3614,7 @@ namespace smt {
|
|||
}
|
||||
if (curr_tree->m_first_child) {
|
||||
path_tree * child = curr_tree->m_first_child;
|
||||
if (child->m_todo == 0) {
|
||||
if (child->m_todo == nullptr) {
|
||||
child->m_todo = mk_tmp_vector();
|
||||
m_todo.push_back(child);
|
||||
}
|
||||
|
@ -3636,7 +3636,7 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
recycle(t->m_todo);
|
||||
t->m_todo = 0;
|
||||
t->m_todo = nullptr;
|
||||
// remove both marks.
|
||||
unmark_enodes(to_unmark->size(), to_unmark->c_ptr());
|
||||
unmark_enodes2(to_unmark2->size(), to_unmark2->c_ptr());
|
||||
|
@ -3812,18 +3812,18 @@ namespace smt {
|
|||
m_interpreter(ctx, *this, use_filters),
|
||||
m_trees(m_ast_manager, m_compiler, m_trail_stack),
|
||||
m_region(m_trail_stack.get_region()),
|
||||
m_r1(0),
|
||||
m_r2(0) {
|
||||
m_r1(nullptr),
|
||||
m_r2(nullptr) {
|
||||
DEBUG_CODE(m_trees.set_context(&ctx););
|
||||
DEBUG_CODE(m_check_missing_instances = false;);
|
||||
reset_pp_pc();
|
||||
}
|
||||
|
||||
virtual ~mam_impl() {
|
||||
~mam_impl() override {
|
||||
m_trail_stack.reset();
|
||||
}
|
||||
|
||||
virtual void add_pattern(quantifier * qa, app * mp) {
|
||||
void add_pattern(quantifier * qa, app * mp) override {
|
||||
SASSERT(m_ast_manager.is_pattern(mp));
|
||||
TRACE("trigger_bug", tout << "adding pattern\n" << mk_ismt2_pp(qa, m_ast_manager) << "\n" << mk_ismt2_pp(mp, m_ast_manager) << "\n";);
|
||||
TRACE("mam_bug", tout << "adding pattern\n" << mk_pp(qa, m_ast_manager) << "\n" << mk_pp(mp, m_ast_manager) << "\n";);
|
||||
|
@ -3846,11 +3846,11 @@ namespace smt {
|
|||
m_trees.add_pattern(qa, mp, i);
|
||||
}
|
||||
|
||||
virtual void push_scope() {
|
||||
void push_scope() override {
|
||||
m_trail_stack.push_scope();
|
||||
}
|
||||
|
||||
virtual void pop_scope(unsigned num_scopes) {
|
||||
void pop_scope(unsigned num_scopes) override {
|
||||
if (!m_to_match.empty()) {
|
||||
ptr_vector<code_tree>::iterator it = m_to_match.begin();
|
||||
ptr_vector<code_tree>::iterator end = m_to_match.end();
|
||||
|
@ -3864,7 +3864,7 @@ namespace smt {
|
|||
m_trail_stack.pop_scope(num_scopes);
|
||||
}
|
||||
|
||||
virtual void reset() {
|
||||
void reset() override {
|
||||
m_trail_stack.reset();
|
||||
m_trees.reset();
|
||||
m_to_match.reset();
|
||||
|
@ -3875,7 +3875,7 @@ namespace smt {
|
|||
m_tmp_region.reset();
|
||||
}
|
||||
|
||||
virtual void display(std::ostream& out) {
|
||||
void display(std::ostream& out) override {
|
||||
out << "mam:\n";
|
||||
m_lbl_hasher.display(out);
|
||||
ptr_vector<code_tree>::iterator it = m_trees.begin_code_trees();
|
||||
|
@ -3886,7 +3886,7 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
|
||||
virtual void match() {
|
||||
void match() override {
|
||||
TRACE("trigger_bug", tout << "match\n"; display(tout););
|
||||
ptr_vector<code_tree>::iterator it = m_to_match.begin();
|
||||
ptr_vector<code_tree>::iterator end = m_to_match.end();
|
||||
|
@ -3903,7 +3903,7 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
|
||||
virtual void rematch(bool use_irrelevant) {
|
||||
void rematch(bool use_irrelevant) override {
|
||||
ptr_vector<code_tree>::iterator it = m_trees.begin_code_trees();
|
||||
ptr_vector<code_tree>::iterator end = m_trees.end_code_trees();
|
||||
unsigned lbl = 0;
|
||||
|
@ -3924,7 +3924,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
#ifdef Z3DEBUG
|
||||
virtual bool check_missing_instances() {
|
||||
bool check_missing_instances() override {
|
||||
TRACE("missing_instance", tout << "checking for missing instances...\n";);
|
||||
flet<bool> l(m_check_missing_instances, true);
|
||||
rematch(false);
|
||||
|
@ -3932,7 +3932,7 @@ namespace smt {
|
|||
}
|
||||
#endif
|
||||
|
||||
virtual void on_match(quantifier * qa, app * pat, unsigned num_bindings, enode * const * bindings, unsigned max_generation, ptr_vector<enode> & used_enodes) {
|
||||
void on_match(quantifier * qa, app * pat, unsigned num_bindings, enode * const * bindings, unsigned max_generation, ptr_vector<enode> & used_enodes) override {
|
||||
TRACE("trigger_bug", tout << "found match " << mk_pp(qa, m_ast_manager) << "\n";);
|
||||
#ifdef Z3DEBUG
|
||||
if (m_check_missing_instances) {
|
||||
|
@ -3955,13 +3955,13 @@ namespace smt {
|
|||
m_context.add_instance(qa, pat, num_bindings, bindings, max_generation, min_gen, max_gen, used_enodes);
|
||||
}
|
||||
|
||||
virtual bool is_shared(enode * n) const {
|
||||
bool is_shared(enode * n) const override {
|
||||
return !m_shared_enodes.empty() && m_shared_enodes.contains(n);
|
||||
}
|
||||
|
||||
// This method is invoked when n becomes relevant.
|
||||
// If lazy == true, then n is not added to the list of candidate enodes for matching. That is, the method just updates the lbls.
|
||||
virtual void relevant_eh(enode * n, bool lazy) {
|
||||
void relevant_eh(enode * n, bool lazy) override {
|
||||
TRACE("trigger_bug", tout << "relevant_eh:\n" << mk_ismt2_pp(n->get_owner(), m_ast_manager) << "\n";
|
||||
tout << "mam: " << this << "\n";);
|
||||
TRACE("mam", tout << "relevant_eh: #" << n->get_owner_id() << "\n";);
|
||||
|
@ -3984,11 +3984,11 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
|
||||
virtual bool has_work() const {
|
||||
bool has_work() const override {
|
||||
return !m_to_match.empty() || !m_new_patterns.empty();
|
||||
}
|
||||
|
||||
virtual void add_eq_eh(enode * r1, enode * r2) {
|
||||
void add_eq_eh(enode * r1, enode * r2) override {
|
||||
flet<enode *> l1(m_r1, r1);
|
||||
flet<enode *> l2(m_r2, r2);
|
||||
|
||||
|
|
|
@ -157,8 +157,8 @@ interval::interval(v_dependency_manager & m):
|
|||
m_upper(true),
|
||||
m_lower_open(true),
|
||||
m_upper_open(true),
|
||||
m_lower_dep(0),
|
||||
m_upper_dep(0) {
|
||||
m_lower_dep(nullptr),
|
||||
m_upper_dep(nullptr) {
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -215,12 +215,12 @@ interval::interval(v_dependency_manager & m, rational const & val, bool open, bo
|
|||
m_lower_dep = d;
|
||||
m_upper = ext_numeral(true);
|
||||
m_upper_open = true;
|
||||
m_upper_dep = 0;
|
||||
m_upper_dep = nullptr;
|
||||
}
|
||||
else {
|
||||
m_lower = ext_numeral(false);
|
||||
m_lower_open = true;
|
||||
m_lower_dep = 0;
|
||||
m_lower_dep = nullptr;
|
||||
m_upper = ext_numeral(val);
|
||||
m_upper_open = open;
|
||||
m_upper_dep = d;
|
||||
|
@ -252,8 +252,8 @@ interval & interval::operator+=(interval const & other) {
|
|||
m_upper += other.m_upper;
|
||||
m_lower_open |= other.m_lower_open;
|
||||
m_upper_open |= other.m_upper_open;
|
||||
m_lower_dep = m_lower.is_infinite() ? 0 : m_manager.mk_join(m_lower_dep, other.m_lower_dep);
|
||||
m_upper_dep = m_upper.is_infinite() ? 0 : m_manager.mk_join(m_upper_dep, other.m_upper_dep);
|
||||
m_lower_dep = m_lower.is_infinite() ? nullptr : m_manager.mk_join(m_lower_dep, other.m_lower_dep);
|
||||
m_upper_dep = m_upper.is_infinite() ? nullptr : m_manager.mk_join(m_upper_dep, other.m_upper_dep);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -283,7 +283,7 @@ v_dependency * interval::join_opt(v_dependency * d1, v_dependency * d2, v_depend
|
|||
return join(d1, d2);
|
||||
if (opt2 == d1 || opt2 == d2)
|
||||
return join(d1, d2);
|
||||
if (opt1 == 0 || opt2 == 0)
|
||||
if (opt1 == nullptr || opt2 == nullptr)
|
||||
return join(d1, d2);
|
||||
// TODO: more opts...
|
||||
return join(d1, d2, opt1);
|
||||
|
@ -331,8 +331,8 @@ interval & interval::operator*=(interval const & other) {
|
|||
m_upper_open = a_o || c_o; SASSERT(a.is_neg() && c.is_neg());
|
||||
m_lower = new_lower;
|
||||
m_upper = new_upper;
|
||||
m_lower_dep = m_lower.is_infinite() ? 0 : join(b_d, d_d);
|
||||
m_upper_dep = m_upper.is_infinite() ? 0 : join_opt(a_d, c_d, b_d, d_d);
|
||||
m_lower_dep = m_lower.is_infinite() ? nullptr : join(b_d, d_d);
|
||||
m_upper_dep = m_upper.is_infinite() ? nullptr : join_opt(a_d, c_d, b_d, d_d);
|
||||
}
|
||||
else if (other.is_M()) {
|
||||
// a <= x <= b <= 0, y <= d, d > 0 --> a*d <= x*y (uses the fact that b is not positive)
|
||||
|
@ -344,8 +344,8 @@ interval & interval::operator*=(interval const & other) {
|
|||
m_upper_open = a_o || c_o;
|
||||
m_lower = new_lower;
|
||||
m_upper = new_upper;
|
||||
m_lower_dep = m_lower.is_infinite() ? 0 : join(a_d, d_d, b_d);
|
||||
m_upper_dep = m_upper.is_infinite() ? 0 : join(a_d, c_d, b_d);
|
||||
m_lower_dep = m_lower.is_infinite() ? nullptr : join(a_d, d_d, b_d);
|
||||
m_upper_dep = m_upper.is_infinite() ? nullptr : join(a_d, c_d, b_d);
|
||||
}
|
||||
else {
|
||||
// a <= x <= b <= 0, 0 <= c <= y <= d --> a*d <= x*y (uses the fact that x is neg (b is not positive) or y is pos (c is not negative))
|
||||
|
@ -359,8 +359,8 @@ interval & interval::operator*=(interval const & other) {
|
|||
m_upper_open = (is_N0_old || other.is_P0()) ? false : (b_o || c_o);
|
||||
m_lower = new_lower;
|
||||
m_upper = new_upper;
|
||||
m_lower_dep = m_lower.is_infinite() ? 0 : join_opt(a_d, d_d, b_d, c_d);
|
||||
m_upper_dep = m_upper.is_infinite() ? 0 : join(b_d, c_d);
|
||||
m_lower_dep = m_lower.is_infinite() ? nullptr : join_opt(a_d, d_d, b_d, c_d);
|
||||
m_upper_dep = m_upper.is_infinite() ? nullptr : join(b_d, c_d);
|
||||
}
|
||||
}
|
||||
else if (is_M()) {
|
||||
|
@ -374,8 +374,8 @@ interval & interval::operator*=(interval const & other) {
|
|||
m_upper_open = a_o || c_o; SASSERT(a.is_neg() && c.is_neg());
|
||||
m_lower = new_lower;
|
||||
m_upper = new_upper;
|
||||
m_lower_dep = m_lower.is_infinite() ? 0 : join(b_d, c_d, d_d);
|
||||
m_upper_dep = m_upper.is_infinite() ? 0 : join(a_d, c_d, d_d);
|
||||
m_lower_dep = m_lower.is_infinite() ? nullptr : join(b_d, c_d, d_d);
|
||||
m_upper_dep = m_upper.is_infinite() ? nullptr : join(a_d, c_d, d_d);
|
||||
}
|
||||
else if (other.is_M()) {
|
||||
TRACE("interval_bug", tout << "(M, M)\n";);
|
||||
|
@ -404,8 +404,8 @@ interval & interval::operator*=(interval const & other) {
|
|||
m_upper = bd;
|
||||
m_upper_open = bd_o;
|
||||
}
|
||||
m_lower_dep = m_lower.is_infinite() ? 0 : join(a_d, b_d, c_d, d_d);
|
||||
m_upper_dep = m_upper.is_infinite() ? 0 : join(a_d, b_d, c_d, d_d);
|
||||
m_lower_dep = m_lower.is_infinite() ? nullptr : join(a_d, b_d, c_d, d_d);
|
||||
m_upper_dep = m_upper.is_infinite() ? nullptr : join(a_d, b_d, c_d, d_d);
|
||||
}
|
||||
else {
|
||||
// a < 0, a <= x, 0 <= c <= y <= d --> a*d <= x*y (uses the fact that c is not negative)
|
||||
|
@ -418,8 +418,8 @@ interval & interval::operator*=(interval const & other) {
|
|||
m_upper_open = b_o || d_o; SASSERT(b.is_pos() && d.is_pos());
|
||||
m_lower = new_lower;
|
||||
m_upper = new_upper;
|
||||
m_lower_dep = m_lower.is_infinite() ? 0 : join(a_d, d_d, c_d);
|
||||
m_upper_dep = m_upper.is_infinite() ? 0 : join(b_d, d_d, c_d);
|
||||
m_lower_dep = m_lower.is_infinite() ? nullptr : join(a_d, d_d, c_d);
|
||||
m_upper_dep = m_upper.is_infinite() ? nullptr : join(b_d, d_d, c_d);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -435,8 +435,8 @@ interval & interval::operator*=(interval const & other) {
|
|||
m_upper_open = (is_P0_old || other.is_N0()) ? false : a_o || d_o;
|
||||
m_lower = new_lower;
|
||||
m_upper = new_upper;
|
||||
m_lower_dep = m_lower.is_infinite() ? 0 : join_opt(b_d, c_d, a_d, d_d);
|
||||
m_upper_dep = m_upper.is_infinite() ? 0 : join(a_d, d_d);
|
||||
m_lower_dep = m_lower.is_infinite() ? nullptr : join_opt(b_d, c_d, a_d, d_d);
|
||||
m_upper_dep = m_upper.is_infinite() ? nullptr : join(a_d, d_d);
|
||||
}
|
||||
else if (other.is_M()) {
|
||||
// 0 <= a <= x <= b, c <= y --> b*c <= x*y (uses the fact that a is not negative)
|
||||
|
@ -448,8 +448,8 @@ interval & interval::operator*=(interval const & other) {
|
|||
m_upper_open = b_o || d_o;
|
||||
m_lower = new_lower;
|
||||
m_upper = new_upper;
|
||||
m_lower_dep = m_lower.is_infinite() ? 0 : join(b_d, c_d, a_d);
|
||||
m_upper_dep = m_upper.is_infinite() ? 0 : join(b_d, d_d, a_d);
|
||||
m_lower_dep = m_lower.is_infinite() ? nullptr : join(b_d, c_d, a_d);
|
||||
m_upper_dep = m_upper.is_infinite() ? nullptr : join(b_d, d_d, a_d);
|
||||
}
|
||||
else {
|
||||
// 0 <= a <= x, 0 <= c <= y --> a*c <= x*y
|
||||
|
@ -462,8 +462,8 @@ interval & interval::operator*=(interval const & other) {
|
|||
m_upper_open = b_o || d_o; SASSERT(b.is_pos() && d.is_pos());
|
||||
m_lower = new_lower;
|
||||
m_upper = new_upper;
|
||||
m_lower_dep = m_lower.is_infinite() ? 0 : join(a_d, c_d);
|
||||
m_upper_dep = m_upper.is_infinite() ? 0 : join_opt(b_d, d_d, a_d, c_d);
|
||||
m_lower_dep = m_lower.is_infinite() ? nullptr : join(a_d, c_d);
|
||||
m_upper_dep = m_upper.is_infinite() ? nullptr : join_opt(b_d, d_d, a_d, c_d);
|
||||
}
|
||||
}
|
||||
TRACE("interval_bug", tout << "operator*= result: " << *this << "\n";);
|
||||
|
@ -590,7 +590,7 @@ void interval::expt(unsigned n) {
|
|||
// 0 < a <= x <= b --> x^n <= b^n (use lower and upper bound -- need the fact that x is positive)
|
||||
m_lower.expt(n);
|
||||
m_upper.expt(n);
|
||||
m_upper_dep = m_upper.is_infinite() ? 0 : m_manager.mk_join(m_lower_dep, m_upper_dep);
|
||||
m_upper_dep = m_upper.is_infinite() ? nullptr : m_manager.mk_join(m_lower_dep, m_upper_dep);
|
||||
}
|
||||
else if (m_upper.is_neg()) {
|
||||
// [l, u]^n = [u^n, l^n] if u < 0
|
||||
|
@ -601,7 +601,7 @@ void interval::expt(unsigned n) {
|
|||
std::swap(m_lower_dep, m_upper_dep);
|
||||
m_lower.expt(n);
|
||||
m_upper.expt(n);
|
||||
m_upper_dep = m_upper.is_infinite() ? 0 : m_manager.mk_join(m_lower_dep, m_upper_dep);
|
||||
m_upper_dep = m_upper.is_infinite() ? nullptr : m_manager.mk_join(m_lower_dep, m_upper_dep);
|
||||
}
|
||||
else {
|
||||
// [l, u]^n = [0, max{l^n, u^n}] otherwise
|
||||
|
@ -614,10 +614,10 @@ void interval::expt(unsigned n) {
|
|||
m_upper = m_lower;
|
||||
m_upper_open = m_lower_open;
|
||||
}
|
||||
m_upper_dep = m_upper.is_infinite() ? 0 : m_manager.mk_join(m_lower_dep, m_upper_dep);
|
||||
m_upper_dep = m_upper.is_infinite() ? nullptr : m_manager.mk_join(m_lower_dep, m_upper_dep);
|
||||
m_lower = ext_numeral(0);
|
||||
m_lower_open = false;
|
||||
m_lower_dep = 0;
|
||||
m_lower_dep = nullptr;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -80,7 +80,7 @@ class old_interval {
|
|||
public:
|
||||
explicit old_interval(v_dependency_manager & m);
|
||||
explicit old_interval(v_dependency_manager & m, rational const & lower, bool l_open, v_dependency * l_dep, rational const & upper, bool u_open, v_dependency * u_dep);
|
||||
explicit old_interval(v_dependency_manager & m, rational const & val, v_dependency * l_dep = 0, v_dependency * u_dep = 0);
|
||||
explicit old_interval(v_dependency_manager & m, rational const & val, v_dependency * l_dep = nullptr, v_dependency * u_dep = nullptr);
|
||||
explicit old_interval(v_dependency_manager & m, rational const & val, bool open, bool lower, v_dependency * d);
|
||||
explicit old_interval(v_dependency_manager & m, ext_numeral const& lower, bool l_open, v_dependency * l_dep, ext_numeral const & upper, bool u_open, v_dependency * u_dep);
|
||||
old_interval(old_interval const & other);
|
||||
|
|
|
@ -41,7 +41,7 @@ void preprocessor_params::display(std::ostream & out) const {
|
|||
|
||||
DISPLAY_PARAM(m_lift_ite);
|
||||
DISPLAY_PARAM(m_ng_lift_ite);
|
||||
DISPLAY_PARAM(m_pull_cheap_ite_trees);
|
||||
DISPLAY_PARAM(m_pull_cheap_ite);
|
||||
DISPLAY_PARAM(m_pull_nested_quantifiers);
|
||||
DISPLAY_PARAM(m_eliminate_term_ite);
|
||||
DISPLAY_PARAM(m_macro_finder);
|
||||
|
|
|
@ -32,7 +32,7 @@ struct preprocessor_params : public pattern_inference_params,
|
|||
public bit_blaster_params {
|
||||
lift_ite_kind m_lift_ite;
|
||||
lift_ite_kind m_ng_lift_ite; // lift ite for non ground terms
|
||||
bool m_pull_cheap_ite_trees;
|
||||
bool m_pull_cheap_ite;
|
||||
bool m_pull_nested_quantifiers;
|
||||
bool m_eliminate_term_ite;
|
||||
bool m_macro_finder;
|
||||
|
@ -54,7 +54,7 @@ public:
|
|||
preprocessor_params(params_ref const & p = params_ref()):
|
||||
m_lift_ite(LI_NONE),
|
||||
m_ng_lift_ite(LI_NONE),
|
||||
m_pull_cheap_ite_trees(false),
|
||||
m_pull_cheap_ite(false),
|
||||
m_pull_nested_quantifiers(false),
|
||||
m_eliminate_term_ite(false),
|
||||
m_macro_finder(false),
|
||||
|
|
|
@ -99,7 +99,7 @@ struct qi_params {
|
|||
m_mbqi_max_iterations(1000),
|
||||
m_mbqi_trace(false),
|
||||
m_mbqi_force_template(10),
|
||||
m_mbqi_id(0)
|
||||
m_mbqi_id(nullptr)
|
||||
{
|
||||
updt_params(p);
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ def_module_params(module_name='smt',
|
|||
('str.fast_length_tester_cache', BOOL, False, 'cache length tester constants instead of regenerating them'),
|
||||
('str.fast_value_tester_cache', BOOL, True, 'cache value tester constants instead of regenerating them'),
|
||||
('str.string_constant_cache', BOOL, True, 'cache all generated string constants generated from anywhere in theory_str'),
|
||||
('str.use_binary_search', BOOL, True, 'use a binary search heuristic for finding concrete length values for free variables in theory_str (set to False to use linear search)'),
|
||||
('str.use_binary_search', BOOL, False, 'use a binary search heuristic for finding concrete length values for free variables in theory_str (set to False to use linear search)'),
|
||||
('str.binary_search_start', UINT, 64, 'initial upper bound for theory_str binary search'),
|
||||
('theory_aware_branching', BOOL, False, 'Allow the context to use extra information from theory solvers regarding literal branching prioritization.'),
|
||||
('str.finite_overlap_models', BOOL, False, 'attempt a finite model search for overlapping variables instead of completely giving up on the arrangement'),
|
||||
|
|
|
@ -62,7 +62,7 @@ void array_factory::get_some_args_for(sort * s, ptr_buffer<expr> & args) {
|
|||
|
||||
expr * array_factory::get_some_value(sort * s) {
|
||||
TRACE("array_factory", tout << mk_pp(s, m_manager) << "\n";);
|
||||
value_set * set = 0;
|
||||
value_set * set = nullptr;
|
||||
if (m_sort2value_set.find(s, set) && !set->empty())
|
||||
return *(set->begin());
|
||||
func_interp * fi;
|
||||
|
@ -99,7 +99,7 @@ bool array_factory::mk_two_diff_values_for(sort * s) {
|
|||
}
|
||||
|
||||
bool array_factory::get_some_values(sort * s, expr_ref & v1, expr_ref & v2) {
|
||||
value_set * set = 0;
|
||||
value_set * set = nullptr;
|
||||
if (!m_sort2value_set.find(s, set) || set->size() == 0) {
|
||||
if (!mk_two_diff_values_for(s))
|
||||
return false;
|
||||
|
@ -111,7 +111,7 @@ bool array_factory::get_some_values(sort * s, expr_ref & v1, expr_ref & v2) {
|
|||
if (set->size() == 1) {
|
||||
v1 = *(set->begin());
|
||||
v2 = get_fresh_value(s);
|
||||
return v2.get() != 0;
|
||||
return v2.get() != nullptr;
|
||||
}
|
||||
else {
|
||||
SASSERT(set->size() >= 2);
|
||||
|
@ -139,7 +139,7 @@ expr * array_factory::get_fresh_value(sort * s) {
|
|||
}
|
||||
sort * range = get_array_range(s);
|
||||
expr * range_val = m_model.get_fresh_value(range);
|
||||
if (range_val != 0) {
|
||||
if (range_val != nullptr) {
|
||||
// easy case
|
||||
func_interp * fi;
|
||||
expr * val = mk_array_interp(s, fi);
|
||||
|
@ -170,7 +170,7 @@ expr * array_factory::get_fresh_value(sort * s) {
|
|||
if (!found) {
|
||||
expr * arg1 = m_model.get_fresh_value(d);
|
||||
expr * arg2 = m_model.get_fresh_value(d);
|
||||
if (arg1 != 0 && arg2 != 0) {
|
||||
if (arg1 != nullptr && arg2 != nullptr) {
|
||||
found = true;
|
||||
args1.push_back(arg1);
|
||||
args2.push_back(arg2);
|
||||
|
@ -201,6 +201,6 @@ expr * array_factory::get_fresh_value(sort * s) {
|
|||
|
||||
// failed to create a fresh array value
|
||||
TRACE("array_factory_bug", tout << "failed to build fresh array value\n";);
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,13 +32,13 @@ class array_factory : public struct_factory {
|
|||
public:
|
||||
array_factory(ast_manager & m, proto_model & md);
|
||||
|
||||
virtual ~array_factory() {}
|
||||
~array_factory() override {}
|
||||
|
||||
virtual expr * get_some_value(sort * s);
|
||||
expr * get_some_value(sort * s) override;
|
||||
|
||||
virtual bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2);
|
||||
bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2) override;
|
||||
|
||||
virtual expr * get_fresh_value(sort * s);
|
||||
expr * get_fresh_value(sort * s) override;
|
||||
};
|
||||
|
||||
#endif /* ARRAY_FACTORY_H_ */
|
||||
|
|
|
@ -27,7 +27,7 @@ datatype_factory::datatype_factory(ast_manager & m, proto_model & md):
|
|||
}
|
||||
|
||||
expr * datatype_factory::get_some_value(sort * s) {
|
||||
value_set * set = 0;
|
||||
value_set * set = nullptr;
|
||||
if (m_sort2value_set.find(s, set) && !set->empty())
|
||||
return *(set->begin());
|
||||
func_decl * c = m_util.get_non_rec_constructor(s);
|
||||
|
@ -46,7 +46,7 @@ expr * datatype_factory::get_some_value(sort * s) {
|
|||
\brief Return the last fresh (or almost) fresh value of sort s.
|
||||
*/
|
||||
expr * datatype_factory::get_last_fresh_value(sort * s) {
|
||||
expr * val = 0;
|
||||
expr * val = nullptr;
|
||||
if (m_last_fresh_value.find(s, val)) {
|
||||
TRACE("datatype", tout << "cached fresh value: " << mk_pp(val, m_manager) << "\n";);
|
||||
return val;
|
||||
|
@ -98,7 +98,7 @@ expr * datatype_factory::get_almost_fresh_value(sort * s) {
|
|||
sort * s_arg = constructor->get_domain(i);
|
||||
if (!found_fresh_arg && (!m_util.is_datatype(s_arg) || !m_util.are_siblings(s, s_arg))) {
|
||||
expr * new_arg = m_model.get_fresh_value(s_arg);
|
||||
if (new_arg != 0) {
|
||||
if (new_arg != nullptr) {
|
||||
found_fresh_arg = true;
|
||||
args.push_back(new_arg);
|
||||
continue;
|
||||
|
@ -131,7 +131,7 @@ expr * datatype_factory::get_almost_fresh_value(sort * s) {
|
|||
}
|
||||
}
|
||||
SASSERT(!m_util.is_recursive(s));
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
@ -160,7 +160,7 @@ expr * datatype_factory::get_fresh_value(sort * s) {
|
|||
sort * s_arg = constructor->get_domain(i);
|
||||
if (!found_fresh_arg && (!m_util.is_recursive(s) || !m_util.is_datatype(s_arg) || !m_util.are_siblings(s, s_arg))) {
|
||||
expr * new_arg = m_model.get_fresh_value(s_arg);
|
||||
if (new_arg != 0) {
|
||||
if (new_arg != nullptr) {
|
||||
found_fresh_arg = true;
|
||||
args.push_back(new_arg);
|
||||
continue;
|
||||
|
@ -204,7 +204,7 @@ expr * datatype_factory::get_fresh_value(sort * s) {
|
|||
<< found_sibling << "\n";);
|
||||
if (!found_sibling && m_util.is_datatype(s_arg) && m_util.are_siblings(s, s_arg)) {
|
||||
found_sibling = true;
|
||||
expr * maybe_new_arg = 0;
|
||||
expr * maybe_new_arg = nullptr;
|
||||
if (num_iterations <= 1) {
|
||||
maybe_new_arg = get_almost_fresh_value(s_arg);
|
||||
}
|
||||
|
@ -245,6 +245,6 @@ expr * datatype_factory::get_fresh_value(sort * s) {
|
|||
// Search for value that was not created before.
|
||||
SASSERT(!m_util.is_recursive(s));
|
||||
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,9 +33,9 @@ class datatype_factory : public struct_factory {
|
|||
|
||||
public:
|
||||
datatype_factory(ast_manager & m, proto_model & md);
|
||||
virtual ~datatype_factory() {}
|
||||
virtual expr * get_some_value(sort * s);
|
||||
virtual expr * get_fresh_value(sort * s);
|
||||
~datatype_factory() override {}
|
||||
expr * get_some_value(sort * s) override;
|
||||
expr * get_fresh_value(sort * s) override;
|
||||
};
|
||||
|
||||
#endif /* DATATYPE_FACTORY_H_ */
|
||||
|
|
|
@ -26,17 +26,17 @@ Revision History:
|
|||
class numeral_factory : public simple_factory<rational> {
|
||||
public:
|
||||
numeral_factory(ast_manager & m, family_id fid):simple_factory<rational>(m, fid) {}
|
||||
virtual ~numeral_factory() {}
|
||||
~numeral_factory() override {}
|
||||
};
|
||||
|
||||
class arith_factory : public numeral_factory {
|
||||
arith_util m_util;
|
||||
|
||||
virtual app * mk_value_core(rational const & val, sort * s);
|
||||
app * mk_value_core(rational const & val, sort * s) override;
|
||||
|
||||
public:
|
||||
arith_factory(ast_manager & m);
|
||||
virtual ~arith_factory();
|
||||
~arith_factory() override;
|
||||
|
||||
app * mk_num_value(rational const & val, bool is_int);
|
||||
};
|
||||
|
@ -44,11 +44,11 @@ public:
|
|||
class bv_factory : public numeral_factory {
|
||||
bv_util m_util;
|
||||
|
||||
virtual app * mk_value_core(rational const & val, sort * s);
|
||||
app * mk_value_core(rational const & val, sort * s) override;
|
||||
|
||||
public:
|
||||
bv_factory(ast_manager & m);
|
||||
virtual ~bv_factory();
|
||||
~bv_factory() override;
|
||||
|
||||
app * mk_num_value(rational const & val, unsigned bv_size);
|
||||
};
|
||||
|
|
|
@ -53,11 +53,11 @@ void proto_model::register_aux_decl(func_decl * d) {
|
|||
*/
|
||||
void proto_model::reregister_decl(func_decl * f, func_interp * new_fi, func_decl * f_aux) {
|
||||
func_interp * fi = get_func_interp(f);
|
||||
if (fi == 0) {
|
||||
if (fi == nullptr) {
|
||||
register_decl(f, new_fi);
|
||||
}
|
||||
else {
|
||||
if (f_aux != 0) {
|
||||
if (f_aux != nullptr) {
|
||||
register_decl(f_aux, fi);
|
||||
m_aux_decls.insert(f_aux);
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ void proto_model::cleanup_func_interp(func_interp * fi, func_decl_set & found_au
|
|||
todo.pop_back();
|
||||
func_decl * a_decl = to_app(a)->get_decl();
|
||||
expr * ai = get_const_interp(a_decl);
|
||||
if (ai == 0) {
|
||||
if (ai == nullptr) {
|
||||
ai = get_some_value(a_decl->get_range());
|
||||
register_decl(a_decl, ai);
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ void proto_model::cleanup_func_interp(func_interp * fi, func_decl_set & found_au
|
|||
bool visited = true;
|
||||
args.reset();
|
||||
for (expr* t_arg : *t) {
|
||||
expr * arg = 0;
|
||||
expr * arg = nullptr;
|
||||
if (!cache.find(t_arg, arg)) {
|
||||
visited = false;
|
||||
todo.push_back(t_arg);
|
||||
|
@ -346,7 +346,7 @@ void proto_model::complete_partial_func(func_decl * f) {
|
|||
func_interp * fi = get_func_interp(f);
|
||||
if (fi && fi->is_partial()) {
|
||||
expr * else_value = fi->get_max_occ_result();
|
||||
if (else_value == 0)
|
||||
if (else_value == nullptr)
|
||||
else_value = get_some_value(f->get_range());
|
||||
fi->set_else(else_value);
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ class proto_model : public model_core {
|
|||
|
||||
public:
|
||||
proto_model(ast_manager & m, params_ref const & p = params_ref());
|
||||
virtual ~proto_model() {}
|
||||
~proto_model() override {}
|
||||
|
||||
void register_factory(value_factory * f) { m_factories.register_plugin(f); }
|
||||
|
||||
|
@ -69,7 +69,7 @@ public:
|
|||
|
||||
value_factory * get_factory(family_id fid);
|
||||
|
||||
virtual expr * get_some_value(sort * s);
|
||||
expr * get_some_value(sort * s) override;
|
||||
|
||||
bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2);
|
||||
|
||||
|
@ -93,9 +93,9 @@ public:
|
|||
void freeze_universe(sort * s);
|
||||
bool is_finite(sort * s) const;
|
||||
obj_hashtable<expr> const & get_known_universe(sort * s) const;
|
||||
virtual ptr_vector<expr> const & get_universe(sort * s) const;
|
||||
virtual unsigned get_num_uninterpreted_sorts() const;
|
||||
virtual sort * get_uninterpreted_sort(unsigned idx) const;
|
||||
ptr_vector<expr> const & get_universe(sort * s) const override;
|
||||
unsigned get_num_uninterpreted_sorts() const override;
|
||||
sort * get_uninterpreted_sort(unsigned idx) const override;
|
||||
|
||||
//
|
||||
// Complete partial function interps
|
||||
|
|
|
@ -20,7 +20,7 @@ Revision History:
|
|||
#include "smt/proto_model/proto_model.h"
|
||||
|
||||
struct_factory::value_set * struct_factory::get_value_set(sort * s) {
|
||||
value_set * set = 0;
|
||||
value_set * set = nullptr;
|
||||
if (!m_sort2value_set.find(s, set)) {
|
||||
set = alloc(value_set);
|
||||
m_sort2value_set.insert(s, set);
|
||||
|
|
|
@ -43,11 +43,11 @@ protected:
|
|||
public:
|
||||
struct_factory(ast_manager & m, family_id fid, proto_model & md);
|
||||
|
||||
virtual ~struct_factory();
|
||||
~struct_factory() override;
|
||||
|
||||
virtual bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2);
|
||||
bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2) override;
|
||||
|
||||
virtual void register_value(expr * array_value);
|
||||
void register_value(expr * array_value) override;
|
||||
};
|
||||
|
||||
#endif /* STRUCT_FACTORY_H_ */
|
||||
|
|
|
@ -34,7 +34,7 @@ basic_factory::basic_factory(ast_manager & m):
|
|||
expr * basic_factory::get_some_value(sort * s) {
|
||||
if (m_manager.is_bool(s))
|
||||
return m_manager.mk_false();
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool basic_factory::get_some_values(sort * s, expr_ref & v1, expr_ref & v2) {
|
||||
|
@ -47,7 +47,7 @@ bool basic_factory::get_some_values(sort * s, expr_ref & v1, expr_ref & v2) {
|
|||
}
|
||||
|
||||
expr * basic_factory::get_fresh_value(sort * s) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
user_sort_factory::user_sort_factory(ast_manager & m):
|
||||
|
@ -56,7 +56,7 @@ user_sort_factory::user_sort_factory(ast_manager & m):
|
|||
|
||||
void user_sort_factory::freeze_universe(sort * s) {
|
||||
if (!m_finite.contains(s)) {
|
||||
value_set * set = 0;
|
||||
value_set * set = nullptr;
|
||||
m_sort2value_set.find(s, set);
|
||||
if (!m_sort2value_set.find(s, set) || set->m_values.empty()) {
|
||||
// we cannot freeze an empty universe.
|
||||
|
@ -68,7 +68,7 @@ void user_sort_factory::freeze_universe(sort * s) {
|
|||
}
|
||||
|
||||
obj_hashtable<expr> const & user_sort_factory::get_known_universe(sort * s) const {
|
||||
value_set * set = 0;
|
||||
value_set * set = nullptr;
|
||||
if (m_sort2value_set.find(s, set)) {
|
||||
return set->m_values;
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ obj_hashtable<expr> const & user_sort_factory::get_known_universe(sort * s) cons
|
|||
|
||||
expr * user_sort_factory::get_some_value(sort * s) {
|
||||
if (is_finite(s)) {
|
||||
value_set * set = 0;
|
||||
value_set * set = nullptr;
|
||||
m_sort2value_set.find(s, set);
|
||||
SASSERT(set != 0);
|
||||
SASSERT(!set->m_values.empty());
|
||||
|
@ -88,7 +88,7 @@ expr * user_sort_factory::get_some_value(sort * s) {
|
|||
|
||||
bool user_sort_factory::get_some_values(sort * s, expr_ref & v1, expr_ref & v2) {
|
||||
if (is_finite(s)) {
|
||||
value_set * set = 0;
|
||||
value_set * set = nullptr;
|
||||
if (m_sort2value_set.find(s, set) && set->m_values.size() >= 2) {
|
||||
obj_hashtable<expr>::iterator it = set->m_values.begin();
|
||||
v1 = *it;
|
||||
|
@ -103,7 +103,7 @@ bool user_sort_factory::get_some_values(sort * s, expr_ref & v1, expr_ref & v2)
|
|||
|
||||
expr * user_sort_factory::get_fresh_value(sort * s) {
|
||||
if (is_finite(s))
|
||||
return 0;
|
||||
return nullptr;
|
||||
return simple_factory<unsigned>::get_fresh_value(s);
|
||||
}
|
||||
|
||||
|
|
|
@ -64,13 +64,13 @@ class basic_factory : public value_factory {
|
|||
public:
|
||||
basic_factory(ast_manager & m);
|
||||
|
||||
virtual expr * get_some_value(sort * s);
|
||||
expr * get_some_value(sort * s) override;
|
||||
|
||||
virtual bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2);
|
||||
bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2) override;
|
||||
|
||||
virtual expr * get_fresh_value(sort * s);
|
||||
expr * get_fresh_value(sort * s) override;
|
||||
|
||||
virtual void register_value(expr * n) { }
|
||||
void register_value(expr * n) override { }
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -95,7 +95,7 @@ protected:
|
|||
ptr_vector<value_set> m_sets;
|
||||
|
||||
value_set * get_value_set(sort * s) {
|
||||
value_set * set = 0;
|
||||
value_set * set = nullptr;
|
||||
if (!m_sort2value_set.find(s, set)) {
|
||||
set = alloc(value_set);
|
||||
m_sort2value_set.insert(s, set);
|
||||
|
@ -133,13 +133,13 @@ public:
|
|||
m_sorts(m) {
|
||||
}
|
||||
|
||||
virtual ~simple_factory() {
|
||||
~simple_factory() override {
|
||||
std::for_each(m_sets.begin(), m_sets.end(), delete_proc<value_set>());
|
||||
}
|
||||
|
||||
virtual expr * get_some_value(sort * s) {
|
||||
value_set * set = 0;
|
||||
expr * result = 0;
|
||||
expr * get_some_value(sort * s) override {
|
||||
value_set * set = nullptr;
|
||||
expr * result = nullptr;
|
||||
if (m_sort2value_set.find(s, set) && !set->m_values.empty())
|
||||
result = *(set->m_values.begin());
|
||||
else
|
||||
|
@ -147,8 +147,8 @@ public:
|
|||
return result;
|
||||
}
|
||||
|
||||
virtual bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2) {
|
||||
value_set * set = 0;
|
||||
bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2) override {
|
||||
value_set * set = nullptr;
|
||||
if (m_sort2value_set.find(s, set)) {
|
||||
switch (set->m_values.size()) {
|
||||
case 0:
|
||||
|
@ -176,12 +176,12 @@ public:
|
|||
return true;
|
||||
}
|
||||
|
||||
virtual expr * get_fresh_value(sort * s) {
|
||||
expr * get_fresh_value(sort * s) override {
|
||||
value_set * set = get_value_set(s);
|
||||
bool is_new = false;
|
||||
expr * result = 0;
|
||||
expr * result = nullptr;
|
||||
sort_info* s_info = s->get_info();
|
||||
sort_size const* sz = s_info?&s_info->get_num_elements():0;
|
||||
sort_size const* sz = s_info?&s_info->get_num_elements():nullptr;
|
||||
bool has_max = false;
|
||||
Number max_size(0);
|
||||
if (sz && sz->is_finite() && sz->size() < UINT_MAX) {
|
||||
|
@ -195,14 +195,14 @@ public:
|
|||
result = mk_value(next, s, is_new);
|
||||
next++;
|
||||
if (has_max && next > max_size + start) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
SASSERT(result != 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
virtual void register_value(expr * n) {
|
||||
void register_value(expr * n) override {
|
||||
sort * s = this->m_manager.get_sort(n);
|
||||
value_set * set = get_value_set(s);
|
||||
if (!set->m_values.contains(n)) {
|
||||
|
@ -228,10 +228,10 @@ public:
|
|||
class user_sort_factory : public simple_factory<unsigned> {
|
||||
obj_hashtable<sort> m_finite; //!< set of sorts that are marked as finite.
|
||||
obj_hashtable<expr> m_empty_universe;
|
||||
virtual app * mk_value_core(unsigned const & val, sort * s);
|
||||
app * mk_value_core(unsigned const & val, sort * s) override;
|
||||
public:
|
||||
user_sort_factory(ast_manager & m);
|
||||
virtual ~user_sort_factory() {}
|
||||
~user_sort_factory() override {}
|
||||
|
||||
/**
|
||||
\brief Make the universe of \c s finite, by preventing new
|
||||
|
@ -257,13 +257,13 @@ public:
|
|||
*/
|
||||
obj_hashtable<sort> const & get_finite_sorts() const { return m_finite; }
|
||||
|
||||
virtual expr * get_some_value(sort * s);
|
||||
expr * get_some_value(sort * s) override;
|
||||
|
||||
virtual bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2);
|
||||
bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2) override;
|
||||
|
||||
virtual expr * get_fresh_value(sort * s);
|
||||
expr * get_fresh_value(sort * s) override;
|
||||
|
||||
virtual void register_value(expr * n);
|
||||
void register_value(expr * n) override;
|
||||
};
|
||||
|
||||
#endif /* VALUE_FACTORY_H_ */
|
||||
|
|
|
@ -128,7 +128,7 @@ namespace smt {
|
|||
|
||||
unsigned qi_queue::get_new_gen(quantifier * q, unsigned generation, float cost) {
|
||||
// max_top_generation and min_top_generation are not available for computing inc_gen
|
||||
set_values(q, 0, generation, 0, 0, cost);
|
||||
set_values(q, nullptr, generation, 0, 0, cost);
|
||||
float r = m_evaluator(m_new_gen_function, m_vals.size(), m_vals.c_ptr());
|
||||
return static_cast<unsigned>(r);
|
||||
}
|
||||
|
|
|
@ -23,23 +23,23 @@ Notes:
|
|||
class include_cmd : public cmd {
|
||||
char const * m_filename;
|
||||
public:
|
||||
include_cmd() : cmd("include"), m_filename(0) {}
|
||||
virtual char const * get_usage() const { return "<string>"; }
|
||||
virtual char const * get_descr(cmd_context & ctx) const { return "include a file"; }
|
||||
virtual unsigned get_arity() const { return 1; }
|
||||
virtual cmd_arg_kind next_arg_kind(cmd_context & ctx) const { return CPK_STRING; }
|
||||
virtual void set_next_arg(cmd_context & ctx, char const * val) { m_filename = val; }
|
||||
virtual void failure_cleanup(cmd_context & ctx) {}
|
||||
virtual void execute(cmd_context & ctx) {
|
||||
include_cmd() : cmd("include"), m_filename(nullptr) {}
|
||||
char const * get_usage() const override { return "<string>"; }
|
||||
char const * get_descr(cmd_context & ctx) const override { return "include a file"; }
|
||||
unsigned get_arity() const override { return 1; }
|
||||
cmd_arg_kind next_arg_kind(cmd_context & ctx) const override { return CPK_STRING; }
|
||||
void set_next_arg(cmd_context & ctx, char const * val) override { m_filename = val; }
|
||||
void failure_cleanup(cmd_context & ctx) override {}
|
||||
void execute(cmd_context & ctx) override {
|
||||
std::ifstream is(m_filename);
|
||||
if (is.bad() || is.fail())
|
||||
throw cmd_exception(std::string("failed to open file '") + m_filename + "'");
|
||||
parse_smt2_commands(ctx, is, false, params_ref(), m_filename);
|
||||
is.close();
|
||||
}
|
||||
virtual void prepare(cmd_context & ctx) { reset(ctx); }
|
||||
virtual void reset(cmd_context & ctx) { m_filename = 0; }
|
||||
virtual void finalize(cmd_context & ctx) { reset(ctx); }
|
||||
void prepare(cmd_context & ctx) override { reset(ctx); }
|
||||
void reset(cmd_context & ctx) override { m_filename = nullptr; }
|
||||
void finalize(cmd_context & ctx) override { reset(ctx); }
|
||||
};
|
||||
|
||||
void install_smt2_extra_cmds(cmd_context & ctx) {
|
||||
|
|
|
@ -108,8 +108,8 @@ namespace smt {
|
|||
|
||||
void almost_cg_table::insert(enode * n) {
|
||||
table::entry * entry = m_table.find_core(n);
|
||||
if (entry == 0) {
|
||||
list<enode*> * new_lst = new (m_region) list<enode*>(n, 0);
|
||||
if (entry == nullptr) {
|
||||
list<enode*> * new_lst = new (m_region) list<enode*>(n, nullptr);
|
||||
m_table.insert(n, new_lst);
|
||||
}
|
||||
else {
|
||||
|
@ -119,7 +119,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
list<enode*> * almost_cg_table::find(enode * n) {
|
||||
list<enode*> * result = 0;
|
||||
list<enode*> * result = nullptr;
|
||||
m_table.find(n, result);
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace smt {
|
|||
table m_table;
|
||||
|
||||
public:
|
||||
almost_cg_table(enode * r1 = 0, enode * r2 = 0);
|
||||
almost_cg_table(enode * r1 = nullptr, enode * r2 = nullptr);
|
||||
void reset(enode * r1, enode * r2) { m_r1 = r1->get_root(); m_r2 = r2->get_root(); reset(); }
|
||||
void reset();
|
||||
void insert(enode *);
|
||||
|
|
|
@ -91,7 +91,7 @@ namespace smt {
|
|||
}
|
||||
};
|
||||
|
||||
const b_justification null_b_justification(static_cast<clause*>(0));
|
||||
const b_justification null_b_justification(static_cast<clause*>(nullptr));
|
||||
|
||||
inline std::ostream& operator<<(std::ostream& out, b_justification::kind k) {
|
||||
switch (k) {
|
||||
|
|
|
@ -75,42 +75,42 @@ namespace smt {
|
|||
m_queue(1024, bool_var_act_lt(ctx.get_activity_vector())) {
|
||||
}
|
||||
|
||||
virtual void activity_increased_eh(bool_var v) {
|
||||
void activity_increased_eh(bool_var v) override {
|
||||
if (m_queue.contains(v))
|
||||
m_queue.decreased(v);
|
||||
}
|
||||
|
||||
virtual void mk_var_eh(bool_var v) {
|
||||
void mk_var_eh(bool_var v) override {
|
||||
m_queue.reserve(v+1);
|
||||
SASSERT(!m_queue.contains(v));
|
||||
m_queue.insert(v);
|
||||
}
|
||||
|
||||
virtual void del_var_eh(bool_var v) {
|
||||
void del_var_eh(bool_var v) override {
|
||||
if (m_queue.contains(v))
|
||||
m_queue.erase(v);
|
||||
}
|
||||
|
||||
virtual void unassign_var_eh(bool_var v) {
|
||||
void unassign_var_eh(bool_var v) override {
|
||||
if (!m_queue.contains(v))
|
||||
m_queue.insert(v);
|
||||
}
|
||||
|
||||
virtual void relevant_eh(expr * n) {}
|
||||
void relevant_eh(expr * n) override {}
|
||||
|
||||
virtual void init_search_eh() {}
|
||||
void init_search_eh() override {}
|
||||
|
||||
virtual void end_search_eh() {}
|
||||
void end_search_eh() override {}
|
||||
|
||||
virtual void reset() {
|
||||
void reset() override {
|
||||
m_queue.reset();
|
||||
}
|
||||
|
||||
virtual void push_scope() {}
|
||||
void push_scope() override {}
|
||||
|
||||
virtual void pop_scope(unsigned num_scopes) {}
|
||||
void pop_scope(unsigned num_scopes) override {}
|
||||
|
||||
virtual void next_case_split(bool_var & next, lbool & phase) {
|
||||
void next_case_split(bool_var & next, lbool & phase) override {
|
||||
phase = l_undef;
|
||||
|
||||
if (m_context.get_random_value() < static_cast<int>(m_params.m_random_var_freq * random_gen::max_value())) {
|
||||
|
@ -129,7 +129,7 @@ namespace smt {
|
|||
next = null_bool_var;
|
||||
}
|
||||
|
||||
virtual void display(std::ostream & out) {
|
||||
void display(std::ostream & out) override {
|
||||
bool first = true;
|
||||
for (unsigned v : m_queue) {
|
||||
if (m_context.get_assignment(v) == l_undef) {
|
||||
|
@ -144,7 +144,7 @@ namespace smt {
|
|||
out << "\n";
|
||||
}
|
||||
|
||||
virtual ~act_case_split_queue() {};
|
||||
~act_case_split_queue() override {};
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -159,7 +159,7 @@ namespace smt {
|
|||
m_delayed_queue(1024, bool_var_act_lt(ctx.get_activity_vector())) {
|
||||
}
|
||||
|
||||
virtual void activity_increased_eh(bool_var v) {
|
||||
void activity_increased_eh(bool_var v) override {
|
||||
act_case_split_queue::activity_increased_eh(v);
|
||||
if (m_queue.contains(v))
|
||||
m_queue.decreased(v);
|
||||
|
@ -167,7 +167,7 @@ namespace smt {
|
|||
m_delayed_queue.decreased(v);
|
||||
}
|
||||
|
||||
virtual void mk_var_eh(bool_var v) {
|
||||
void mk_var_eh(bool_var v) override {
|
||||
m_queue.reserve(v+1);
|
||||
m_delayed_queue.reserve(v+1);
|
||||
SASSERT(!m_delayed_queue.contains(v));
|
||||
|
@ -178,28 +178,28 @@ namespace smt {
|
|||
m_queue.insert(v);
|
||||
}
|
||||
|
||||
virtual void del_var_eh(bool_var v) {
|
||||
void del_var_eh(bool_var v) override {
|
||||
act_case_split_queue::del_var_eh(v);
|
||||
if (m_delayed_queue.contains(v))
|
||||
m_delayed_queue.erase(v);
|
||||
}
|
||||
|
||||
virtual void relevant_eh(expr * n) {}
|
||||
void relevant_eh(expr * n) override {}
|
||||
|
||||
virtual void init_search_eh() {}
|
||||
void init_search_eh() override {}
|
||||
|
||||
virtual void end_search_eh() {}
|
||||
void end_search_eh() override {}
|
||||
|
||||
virtual void reset() {
|
||||
void reset() override {
|
||||
act_case_split_queue::reset();
|
||||
m_delayed_queue.reset();
|
||||
}
|
||||
|
||||
virtual void push_scope() {}
|
||||
void push_scope() override {}
|
||||
|
||||
virtual void pop_scope(unsigned num_scopes) {}
|
||||
void pop_scope(unsigned num_scopes) override {}
|
||||
|
||||
virtual void next_case_split(bool_var & next, lbool & phase) {
|
||||
void next_case_split(bool_var & next, lbool & phase) override {
|
||||
act_case_split_queue::next_case_split(next, phase);
|
||||
if (next != null_bool_var)
|
||||
return;
|
||||
|
@ -229,7 +229,7 @@ namespace smt {
|
|||
m_cache_domain(ctx.get_manager()) {
|
||||
}
|
||||
|
||||
virtual void mk_var_eh(bool_var v) {
|
||||
void mk_var_eh(bool_var v) override {
|
||||
expr * n = m_context.bool_var2expr(v);
|
||||
double act;
|
||||
if (m_cache.find(n, act))
|
||||
|
@ -237,7 +237,7 @@ namespace smt {
|
|||
act_case_split_queue::mk_var_eh(v);
|
||||
}
|
||||
|
||||
virtual void del_var_eh(bool_var v) {
|
||||
void del_var_eh(bool_var v) override {
|
||||
if (m_context.is_searching()) {
|
||||
double act = m_context.get_activity(v);
|
||||
if (act > 0.0) {
|
||||
|
@ -249,14 +249,14 @@ namespace smt {
|
|||
act_case_split_queue::del_var_eh(v);
|
||||
}
|
||||
|
||||
virtual void init_search_eh() {
|
||||
void init_search_eh() override {
|
||||
m_cache.reset();
|
||||
m_cache_domain.reset();
|
||||
}
|
||||
|
||||
virtual void end_search_eh() {}
|
||||
void end_search_eh() override {}
|
||||
|
||||
virtual void reset() {
|
||||
void reset() override {
|
||||
init_search_eh();
|
||||
}
|
||||
};
|
||||
|
@ -322,15 +322,15 @@ namespace smt {
|
|||
m_head2(0) {
|
||||
}
|
||||
|
||||
virtual void activity_increased_eh(bool_var v) {}
|
||||
void activity_increased_eh(bool_var v) override {}
|
||||
|
||||
virtual void mk_var_eh(bool_var v) {}
|
||||
void mk_var_eh(bool_var v) override {}
|
||||
|
||||
virtual void del_var_eh(bool_var v) {}
|
||||
void del_var_eh(bool_var v) override {}
|
||||
|
||||
virtual void unassign_var_eh(bool_var v) {}
|
||||
void unassign_var_eh(bool_var v) override {}
|
||||
|
||||
virtual void relevant_eh(expr * n) {
|
||||
void relevant_eh(expr * n) override {
|
||||
if (!m_manager.is_bool(n))
|
||||
return;
|
||||
bool is_or = m_manager.is_or(n);
|
||||
|
@ -361,15 +361,15 @@ namespace smt {
|
|||
m_queue2.push_back(n);
|
||||
}
|
||||
|
||||
virtual void init_search_eh() {
|
||||
void init_search_eh() override {
|
||||
m_bs_num_bool_vars = m_context.get_num_bool_vars();
|
||||
}
|
||||
|
||||
virtual void end_search_eh() {
|
||||
void end_search_eh() override {
|
||||
m_bs_num_bool_vars = UINT_MAX;
|
||||
}
|
||||
|
||||
virtual void reset() {
|
||||
void reset() override {
|
||||
m_queue.reset();
|
||||
m_head = 0;
|
||||
m_queue2.reset();
|
||||
|
@ -377,7 +377,7 @@ namespace smt {
|
|||
m_scopes.reset();
|
||||
}
|
||||
|
||||
virtual void push_scope() {
|
||||
void push_scope() override {
|
||||
m_scopes.push_back(scope());
|
||||
scope & s = m_scopes.back();
|
||||
s.m_queue_trail = m_queue.size();
|
||||
|
@ -387,7 +387,7 @@ namespace smt {
|
|||
TRACE("case_split", tout << "head: " << m_head << "\n";);
|
||||
}
|
||||
|
||||
virtual void pop_scope(unsigned num_scopes) {
|
||||
void pop_scope(unsigned num_scopes) override {
|
||||
SASSERT(num_scopes <= m_scopes.size());
|
||||
unsigned new_lvl = m_scopes.size() - num_scopes;
|
||||
scope & s = m_scopes[new_lvl];
|
||||
|
@ -419,7 +419,7 @@ namespace smt {
|
|||
val = l_true;
|
||||
}
|
||||
if ((is_or && val == l_true) || (is_and && val == l_false)) {
|
||||
expr * undef_child = 0;
|
||||
expr * undef_child = nullptr;
|
||||
if (!has_child_assigned_to(m_context, to_app(curr), val, undef_child, m_params.m_rel_case_split_order)) {
|
||||
if (m_manager.has_trace_stream()) {
|
||||
m_manager.trace_stream() << "[decide-and-or] #" << curr->get_id() << " #" << undef_child->get_id() << "\n";
|
||||
|
@ -443,7 +443,7 @@ namespace smt {
|
|||
next = null_bool_var;
|
||||
}
|
||||
|
||||
virtual void next_case_split(bool_var & next, lbool & phase) {
|
||||
void next_case_split(bool_var & next, lbool & phase) override {
|
||||
next_case_split_core(m_queue, m_head, next, phase);
|
||||
if (next == null_bool_var)
|
||||
next_case_split_core(m_queue2, m_head2, next, phase);
|
||||
|
@ -471,7 +471,7 @@ namespace smt {
|
|||
out << "\n";
|
||||
}
|
||||
|
||||
virtual void display(std::ostream & out) {
|
||||
void display(std::ostream & out) override {
|
||||
if (m_queue.empty() && m_queue2.empty())
|
||||
return;
|
||||
out << "case-splits:\n";
|
||||
|
@ -507,9 +507,9 @@ namespace smt {
|
|||
m_delayed_queue(1024, bool_var_act_lt(ctx.get_activity_vector())) {
|
||||
}
|
||||
|
||||
virtual void activity_increased_eh(bool_var v) {}
|
||||
void activity_increased_eh(bool_var v) override {}
|
||||
|
||||
virtual void mk_var_eh(bool_var v) {
|
||||
void mk_var_eh(bool_var v) override {
|
||||
if (m_context.is_searching()) {
|
||||
SASSERT(v >= m_bs_num_bool_vars);
|
||||
m_delayed_queue.reserve(v+1);
|
||||
|
@ -517,19 +517,19 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
|
||||
virtual void del_var_eh(bool_var v) {
|
||||
void del_var_eh(bool_var v) override {
|
||||
if (v >= m_bs_num_bool_vars && m_delayed_queue.contains(v))
|
||||
m_delayed_queue.erase(v);
|
||||
}
|
||||
|
||||
virtual void unassign_var_eh(bool_var v) {
|
||||
void unassign_var_eh(bool_var v) override {
|
||||
if (v < m_bs_num_bool_vars)
|
||||
return;
|
||||
if (!m_delayed_queue.contains(v))
|
||||
m_delayed_queue.insert(v);
|
||||
}
|
||||
|
||||
virtual void relevant_eh(expr * n) {
|
||||
void relevant_eh(expr * n) override {
|
||||
if (!m_manager.is_bool(n))
|
||||
return;
|
||||
bool is_or = m_manager.is_or(n);
|
||||
|
@ -558,22 +558,22 @@ namespace smt {
|
|||
m_queue.push_back(n);
|
||||
}
|
||||
|
||||
virtual void init_search_eh() {
|
||||
void init_search_eh() override {
|
||||
m_bs_num_bool_vars = m_context.get_num_bool_vars();
|
||||
}
|
||||
|
||||
virtual void end_search_eh() {
|
||||
void end_search_eh() override {
|
||||
m_bs_num_bool_vars = UINT_MAX;
|
||||
}
|
||||
|
||||
virtual void reset() {
|
||||
void reset() override {
|
||||
m_queue.reset();
|
||||
m_head = 0;
|
||||
m_delayed_queue.reset();
|
||||
m_scopes.reset();
|
||||
}
|
||||
|
||||
virtual void push_scope() {
|
||||
void push_scope() override {
|
||||
m_scopes.push_back(scope());
|
||||
scope & s = m_scopes.back();
|
||||
s.m_queue_trail = m_queue.size();
|
||||
|
@ -581,7 +581,7 @@ namespace smt {
|
|||
TRACE("case_split", tout << "head: " << m_head << "\n";);
|
||||
}
|
||||
|
||||
virtual void pop_scope(unsigned num_scopes) {
|
||||
void pop_scope(unsigned num_scopes) override {
|
||||
SASSERT(num_scopes <= m_scopes.size());
|
||||
unsigned new_lvl = m_scopes.size() - num_scopes;
|
||||
scope & s = m_scopes[new_lvl];
|
||||
|
@ -611,7 +611,7 @@ namespace smt {
|
|||
val = l_true;
|
||||
}
|
||||
if ((is_or && val == l_true) || (is_and && val == l_false)) {
|
||||
expr * undef_child = 0;
|
||||
expr * undef_child = nullptr;
|
||||
if (!has_child_assigned_to(m_context, to_app(curr), val, undef_child, m_params.m_rel_case_split_order)) {
|
||||
TRACE("case_split", tout << "found AND/OR candidate: #" << curr->get_id() << " #" << undef_child->get_id() << "\n";);
|
||||
literal l = m_context.get_literal(undef_child);
|
||||
|
@ -632,7 +632,7 @@ namespace smt {
|
|||
next = null_bool_var;
|
||||
}
|
||||
|
||||
virtual void next_case_split(bool_var & next, lbool & phase) {
|
||||
void next_case_split(bool_var & next, lbool & phase) override {
|
||||
if (m_context.get_random_value() < static_cast<int>(0.02 * random_gen::max_value())) {
|
||||
next = m_context.get_random_value() % m_context.get_num_b_internalized();
|
||||
TRACE("random_split", tout << "next: " << next << " get_assignment(next): " << m_context.get_assignment(next) << "\n";);
|
||||
|
@ -664,7 +664,7 @@ namespace smt {
|
|||
out << "\n";
|
||||
}
|
||||
|
||||
virtual void display(std::ostream & out) {
|
||||
void display(std::ostream & out) override {
|
||||
if (m_queue.empty())
|
||||
return;
|
||||
out << "case-splits:\n";
|
||||
|
@ -747,19 +747,19 @@ namespace smt {
|
|||
m_head(0),
|
||||
m_bs_num_bool_vars(UINT_MAX),
|
||||
m_priority_queue2(0, generation_lt(*this)),
|
||||
m_current_goal(0) {
|
||||
m_current_goal(nullptr) {
|
||||
set_global_generation();
|
||||
}
|
||||
|
||||
virtual void activity_increased_eh(bool_var v) {}
|
||||
void activity_increased_eh(bool_var v) override {}
|
||||
|
||||
virtual void mk_var_eh(bool_var v) {}
|
||||
void mk_var_eh(bool_var v) override {}
|
||||
|
||||
virtual void del_var_eh(bool_var v) {}
|
||||
void del_var_eh(bool_var v) override {}
|
||||
|
||||
virtual void unassign_var_eh(bool_var v) {}
|
||||
void unassign_var_eh(bool_var v) override {}
|
||||
|
||||
virtual void relevant_eh(expr * n) {
|
||||
void relevant_eh(expr * n) override {
|
||||
if (get_generation(n) == 0 && m_current_generation != 0)
|
||||
set_generation_rec(n, m_current_generation);
|
||||
|
||||
|
@ -793,21 +793,21 @@ namespace smt {
|
|||
add_to_queue2(n);
|
||||
}
|
||||
|
||||
virtual void internalize_instance_eh(expr * e, unsigned gen)
|
||||
void internalize_instance_eh(expr * e, unsigned gen) override
|
||||
{
|
||||
//lower_generation(e, gen);
|
||||
}
|
||||
|
||||
virtual void init_search_eh() {
|
||||
void init_search_eh() override {
|
||||
m_bs_num_bool_vars = m_context.get_num_bool_vars();
|
||||
set_global_generation();
|
||||
}
|
||||
|
||||
virtual void end_search_eh() {
|
||||
void end_search_eh() override {
|
||||
m_bs_num_bool_vars = UINT_MAX;
|
||||
}
|
||||
|
||||
virtual void reset() {
|
||||
void reset() override {
|
||||
m_queue.reset();
|
||||
m_head = 0;
|
||||
m_queue2.reset();
|
||||
|
@ -816,7 +816,7 @@ namespace smt {
|
|||
set_global_generation();
|
||||
}
|
||||
|
||||
virtual void push_scope() {
|
||||
void push_scope() override {
|
||||
m_scopes.push_back(scope());
|
||||
scope & s = m_scopes.back();
|
||||
s.m_queue_trail = m_queue.size();
|
||||
|
@ -827,7 +827,7 @@ namespace smt {
|
|||
TRACE("case_split", tout << "head: " << m_head << "\n";);
|
||||
}
|
||||
|
||||
virtual void pop_scope(unsigned num_scopes) {
|
||||
void pop_scope(unsigned num_scopes) override {
|
||||
SASSERT(num_scopes <= m_scopes.size());
|
||||
unsigned new_lvl = m_scopes.size() - num_scopes;
|
||||
scope & s = m_scopes[new_lvl];
|
||||
|
@ -875,7 +875,7 @@ namespace smt {
|
|||
val = l_true;
|
||||
}
|
||||
if ((is_or && val == l_true) || (is_and && val == l_false)) {
|
||||
expr * undef_child = 0;
|
||||
expr * undef_child = nullptr;
|
||||
if (!has_child_assigned_to(m_context, to_app(curr), val, undef_child, m_params.m_rel_case_split_order)) {
|
||||
if (m_manager.has_trace_stream()) {
|
||||
m_manager.trace_stream() << "[decide-and-or] #" << curr->get_id() << " #" << undef_child->get_id() << "\n";
|
||||
|
@ -898,7 +898,7 @@ namespace smt {
|
|||
next = null_bool_var;
|
||||
}
|
||||
|
||||
virtual void next_case_split(bool_var & next, lbool & phase) {
|
||||
void next_case_split(bool_var & next, lbool & phase) override {
|
||||
phase = l_undef;
|
||||
next = null_bool_var;
|
||||
|
||||
|
@ -943,7 +943,7 @@ namespace smt {
|
|||
out << "\n";
|
||||
}
|
||||
|
||||
virtual void display(std::ostream & out) {
|
||||
void display(std::ostream & out) override {
|
||||
if (m_queue.empty() && m_queue2.empty())
|
||||
return;
|
||||
out << "case-splits:\n";
|
||||
|
@ -951,7 +951,7 @@ namespace smt {
|
|||
//display_core(out, m_queue2, m_head2, 2);
|
||||
}
|
||||
|
||||
virtual void assign_lit_eh(literal l) {
|
||||
void assign_lit_eh(literal l) override {
|
||||
// if (m_current_generation > stop_gen)
|
||||
// m_current_generation--;
|
||||
|
||||
|
@ -1128,41 +1128,41 @@ namespace smt {
|
|||
m_queue(1024, theory_aware_act_lt(ctx.get_activity_vector(), m_theory_var_priority)) {
|
||||
}
|
||||
|
||||
virtual void activity_increased_eh(bool_var v) {
|
||||
void activity_increased_eh(bool_var v) override {
|
||||
if (m_queue.contains(v))
|
||||
m_queue.decreased(v);
|
||||
}
|
||||
|
||||
virtual void mk_var_eh(bool_var v) {
|
||||
void mk_var_eh(bool_var v) override {
|
||||
m_queue.reserve(v+1);
|
||||
m_queue.insert(v);
|
||||
}
|
||||
|
||||
virtual void del_var_eh(bool_var v) {
|
||||
void del_var_eh(bool_var v) override {
|
||||
if (m_queue.contains(v))
|
||||
m_queue.erase(v);
|
||||
}
|
||||
|
||||
virtual void unassign_var_eh(bool_var v) {
|
||||
void unassign_var_eh(bool_var v) override {
|
||||
if (!m_queue.contains(v))
|
||||
m_queue.insert(v);
|
||||
}
|
||||
|
||||
virtual void relevant_eh(expr * n) {}
|
||||
void relevant_eh(expr * n) override {}
|
||||
|
||||
virtual void init_search_eh() {}
|
||||
void init_search_eh() override {}
|
||||
|
||||
virtual void end_search_eh() {}
|
||||
void end_search_eh() override {}
|
||||
|
||||
virtual void reset() {
|
||||
void reset() override {
|
||||
m_queue.reset();
|
||||
}
|
||||
|
||||
virtual void push_scope() {}
|
||||
void push_scope() override {}
|
||||
|
||||
virtual void pop_scope(unsigned num_scopes) {}
|
||||
void pop_scope(unsigned num_scopes) override {}
|
||||
|
||||
virtual void next_case_split(bool_var & next, lbool & phase) {
|
||||
void next_case_split(bool_var & next, lbool & phase) override {
|
||||
int threshold = static_cast<int>(m_params.m_random_var_freq * random_gen::max_value());
|
||||
SASSERT(threshold >= 0);
|
||||
if (m_context.get_random_value() < threshold) {
|
||||
|
@ -1187,7 +1187,7 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
|
||||
virtual void add_theory_aware_branching_info(bool_var v, double priority, lbool phase) {
|
||||
void add_theory_aware_branching_info(bool_var v, double priority, lbool phase) override {
|
||||
TRACE("theory_aware_branching", tout << "Add theory-aware branching information for l#" << v << ": priority=" << priority << std::endl;);
|
||||
m_theory_vars.insert(v);
|
||||
m_theory_var_phase.insert(v, phase);
|
||||
|
@ -1203,7 +1203,7 @@ namespace smt {
|
|||
// m_theory_queue.insert(v);
|
||||
}
|
||||
|
||||
virtual void display(std::ostream & out) {
|
||||
void display(std::ostream & out) override {
|
||||
bool first = true;
|
||||
bool_var_act_queue::const_iterator it = m_queue.begin();
|
||||
bool_var_act_queue::const_iterator end = m_queue.end();
|
||||
|
@ -1222,7 +1222,7 @@ namespace smt {
|
|||
|
||||
}
|
||||
|
||||
virtual ~theory_aware_branching_queue() {};
|
||||
~theory_aware_branching_queue() override {};
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -307,17 +307,17 @@ namespace smt {
|
|||
|
||||
enode * find(enode * n) const {
|
||||
SASSERT(n->get_num_args() > 0);
|
||||
enode * r = 0;
|
||||
enode * r = nullptr;
|
||||
void * t = const_cast<cg_table*>(this)->get_table(n);
|
||||
switch (static_cast<table_kind>(GET_TAG(t))) {
|
||||
case UNARY:
|
||||
return UNTAG(unary_table*, t)->find(n, r) ? r : 0;
|
||||
return UNTAG(unary_table*, t)->find(n, r) ? r : nullptr;
|
||||
case BINARY:
|
||||
return UNTAG(binary_table*, t)->find(n, r) ? r : 0;
|
||||
return UNTAG(binary_table*, t)->find(n, r) ? r : nullptr;
|
||||
case BINARY_COMM:
|
||||
return UNTAG(comm_table*, t)->find(n, r) ? r : 0;
|
||||
return UNTAG(comm_table*, t)->find(n, r) ? r : nullptr;
|
||||
default:
|
||||
return UNTAG(table*, t)->find(n, r) ? r : 0;
|
||||
return UNTAG(table*, t)->find(n, r) ? r : nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -125,28 +125,28 @@ namespace smt {
|
|||
unsigned num = n->get_num_args();
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
enode * arg = get_enode_eq_to(n->get_arg(i));
|
||||
if (arg == 0)
|
||||
return 0;
|
||||
if (arg == nullptr)
|
||||
return nullptr;
|
||||
buffer.push_back(arg);
|
||||
}
|
||||
enode * e = m_context.get_enode_eq_to(n->get_decl(), num, buffer.c_ptr());
|
||||
if (e == 0)
|
||||
return 0;
|
||||
return m_context.is_relevant(e) ? e : 0;
|
||||
if (e == nullptr)
|
||||
return nullptr;
|
||||
return m_context.is_relevant(e) ? e : nullptr;
|
||||
}
|
||||
|
||||
enode * checker::get_enode_eq_to(expr * n) {
|
||||
if (is_var(n)) {
|
||||
unsigned idx = to_var(n)->get_idx();
|
||||
if (idx >= m_num_bindings)
|
||||
return 0;
|
||||
return nullptr;
|
||||
return m_bindings[m_num_bindings - idx - 1];
|
||||
}
|
||||
if (m_context.e_internalized(n) && m_context.is_relevant(n))
|
||||
return m_context.get_enode(n);
|
||||
if (!is_app(n) || to_app(n)->get_num_args() == 0)
|
||||
return 0;
|
||||
enode * r = 0;
|
||||
return nullptr;
|
||||
enode * r = nullptr;
|
||||
if (n->get_ref_count() > 1 && m_to_enode_cache.find(n, r))
|
||||
return r;
|
||||
r = get_enode_eq_to_core(to_app(n));
|
||||
|
@ -179,7 +179,7 @@ namespace smt {
|
|||
m_context(c),
|
||||
m_manager(c.get_manager()),
|
||||
m_num_bindings(0),
|
||||
m_bindings(0) {
|
||||
m_bindings(nullptr) {
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
@ -47,8 +47,8 @@ namespace smt {
|
|||
|
||||
public:
|
||||
checker(context & c);
|
||||
bool is_sat(expr * n, unsigned num_bindings = 0, enode * const * bindings = 0);
|
||||
bool is_unsat(expr * n, unsigned num_bindings = 0, enode * const * bindings = 0);
|
||||
bool is_sat(expr * n, unsigned num_bindings = 0, enode * const * bindings = nullptr);
|
||||
bool is_unsat(expr * n, unsigned num_bindings = 0, enode * const * bindings = nullptr);
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace smt {
|
|||
clause_del_eh * del_eh, bool save_atoms, expr * const * bool_var2expr_map) {
|
||||
SASSERT(k == CLS_AUX || js == 0 || !js->in_region());
|
||||
SASSERT(num_lits >= 2);
|
||||
unsigned sz = get_obj_size(num_lits, k, save_atoms, del_eh != 0, js != 0);
|
||||
unsigned sz = get_obj_size(num_lits, k, save_atoms, del_eh != nullptr, js != nullptr);
|
||||
void * mem = m.get_allocator().allocate(sz);
|
||||
clause * cls = new (mem) clause();
|
||||
cls->m_num_literals = num_lits;
|
||||
|
@ -38,8 +38,8 @@ namespace smt {
|
|||
cls->m_reinit = save_atoms;
|
||||
cls->m_reinternalize_atoms = save_atoms;
|
||||
cls->m_has_atoms = save_atoms;
|
||||
cls->m_has_del_eh = del_eh != 0;
|
||||
cls->m_has_justification = js != 0;
|
||||
cls->m_has_del_eh = del_eh != nullptr;
|
||||
cls->m_has_justification = js != nullptr;
|
||||
cls->m_deleted = false;
|
||||
SASSERT(!m.proofs_enabled() || js != 0);
|
||||
memcpy(cls->m_lits, lits, sizeof(literal) * num_lits);
|
||||
|
@ -92,7 +92,7 @@ namespace smt {
|
|||
unsigned num_atoms = get_num_atoms();
|
||||
for (unsigned i = 0; i < num_atoms; i++) {
|
||||
m.dec_ref(get_atom(i));
|
||||
const_cast<expr**>(get_atoms_addr())[i] = 0;
|
||||
const_cast<expr**>(get_atoms_addr())[i] = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -149,8 +149,8 @@ namespace smt {
|
|||
void release_atoms(ast_manager & m);
|
||||
|
||||
public:
|
||||
static clause * mk(ast_manager & m, unsigned num_lits, literal * lits, clause_kind k, justification * js = 0,
|
||||
clause_del_eh * del_eh = 0, bool save_atoms = false, expr * const * bool_var2expr_map = 0);
|
||||
static clause * mk(ast_manager & m, unsigned num_lits, literal * lits, clause_kind k, justification * js = nullptr,
|
||||
clause_del_eh * del_eh = nullptr, bool save_atoms = false, expr * const * bool_var2expr_map = nullptr);
|
||||
|
||||
void deallocate(ast_manager & m);
|
||||
|
||||
|
@ -211,11 +211,11 @@ namespace smt {
|
|||
}
|
||||
|
||||
clause_del_eh * get_del_eh() const {
|
||||
return m_has_del_eh ? *(get_del_eh_addr()) : 0;
|
||||
return m_has_del_eh ? *(get_del_eh_addr()) : nullptr;
|
||||
}
|
||||
|
||||
justification * get_justification() const {
|
||||
return m_has_justification ? *(get_justification_addr()) : 0;
|
||||
return m_has_justification ? *(get_justification_addr()) : nullptr;
|
||||
}
|
||||
|
||||
unsigned get_num_atoms() const {
|
||||
|
@ -253,7 +253,7 @@ namespace smt {
|
|||
clause_del_eh * del_eh = get_del_eh();
|
||||
if (del_eh) {
|
||||
(*del_eh)(m, this);
|
||||
*(const_cast<clause_del_eh **>(get_del_eh_addr())) = 0;
|
||||
*(const_cast<clause_del_eh **>(get_del_eh_addr())) = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace smt {
|
|||
m_assigned_literals(assigned_literals),
|
||||
m_lemma_atoms(m),
|
||||
m_todo_js_qhead(0),
|
||||
m_antecedents(0),
|
||||
m_antecedents(nullptr),
|
||||
m_watches(watches),
|
||||
m_new_proofs(m),
|
||||
m_lemma_proof(m)
|
||||
|
@ -204,7 +204,7 @@ namespace smt {
|
|||
eq2literals(p.first, p.second);
|
||||
}
|
||||
if (m_todo_js_qhead == m_todo_js.size()) {
|
||||
m_antecedents = 0;
|
||||
m_antecedents = nullptr;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -480,7 +480,7 @@ namespace smt {
|
|||
|
||||
// save space for first uip
|
||||
m_lemma.push_back(null_literal);
|
||||
m_lemma_atoms.push_back(0);
|
||||
m_lemma_atoms.push_back(nullptr);
|
||||
|
||||
unsigned num_marks = 0;
|
||||
if (not_l != null_literal) {
|
||||
|
@ -758,7 +758,7 @@ namespace smt {
|
|||
return pr;
|
||||
}
|
||||
m_todo_pr.push_back(tp_elem(n1, n2));
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -766,7 +766,7 @@ namespace smt {
|
|||
*/
|
||||
proof * conflict_resolution::norm_eq_proof(enode * n1, enode * n2, proof * pr) {
|
||||
if (!pr)
|
||||
return 0;
|
||||
return nullptr;
|
||||
SASSERT(m_manager.has_fact(pr));
|
||||
app * fact = to_app(m_manager.get_fact(pr));
|
||||
app * n1_owner = n1->get_owner();
|
||||
|
@ -814,7 +814,7 @@ namespace smt {
|
|||
switch (js.get_kind()) {
|
||||
case eq_justification::AXIOM:
|
||||
UNREACHABLE();
|
||||
return 0;
|
||||
return nullptr;
|
||||
case eq_justification::EQUATION:
|
||||
TRACE("proof_gen_bug", tout << js.get_literal() << "\n"; m_ctx.display_literal_info(tout, js.get_literal()););
|
||||
return norm_eq_proof(n1, n2, get_proof(js.get_literal()));
|
||||
|
@ -845,11 +845,11 @@ namespace smt {
|
|||
visited = false;
|
||||
}
|
||||
if (!visited)
|
||||
return 0;
|
||||
return nullptr;
|
||||
app * e1 = n1->get_owner();
|
||||
app * e2 = n2->get_owner();
|
||||
app * e2_prime = m_manager.mk_app(e2->get_decl(), e2->get_arg(1), e2->get_arg(0));
|
||||
proof * pr1 = 0;
|
||||
proof * pr1 = nullptr;
|
||||
if (!prs.empty()) {
|
||||
pr1 = m_manager.mk_congruence(e1, e2_prime, prs.size(), prs.c_ptr());
|
||||
m_new_proofs.push_back(pr1);
|
||||
|
@ -877,14 +877,14 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
if (!visited)
|
||||
return 0;
|
||||
return nullptr;
|
||||
proof * pr = m_manager.mk_congruence(n1->get_owner(), n2->get_owner(), prs.size(), prs.c_ptr());
|
||||
m_new_proofs.push_back(pr);
|
||||
return pr;
|
||||
}
|
||||
default:
|
||||
UNREACHABLE();
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -899,7 +899,7 @@ namespace smt {
|
|||
return pr;
|
||||
}
|
||||
m_todo_pr.push_back(tp_elem(l));
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -945,7 +945,7 @@ namespace smt {
|
|||
SASSERT(js);
|
||||
proof * pr = get_proof(js);
|
||||
ptr_buffer<proof> prs;
|
||||
bool visited = pr != 0;
|
||||
bool visited = pr != nullptr;
|
||||
TRACE("get_proof_bug", if (pr != 0) tout << js->get_name() << "\n";);
|
||||
CTRACE("get_proof_bug_after", invocation_counter >= DUMP_AFTER_NUM_INVOCATIONS, if (pr != 0) tout << js->get_name() << "\n";);
|
||||
CTRACE("get_proof_bug_after", invocation_counter >= DUMP_AFTER_NUM_INVOCATIONS, if (pr != 0) js->display_debug_info(*this, tout););
|
||||
|
@ -973,7 +973,7 @@ namespace smt {
|
|||
visited = false;
|
||||
}
|
||||
if (!visited)
|
||||
return 0;
|
||||
return nullptr;
|
||||
expr_ref l_exr(m_manager);
|
||||
m_ctx.literal2expr(l, l_exr);
|
||||
TRACE("get_proof_bug",
|
||||
|
@ -1034,7 +1034,7 @@ namespace smt {
|
|||
}
|
||||
SASSERT(js != 0);
|
||||
m_todo_pr.push_back(tp_elem(js));
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void conflict_resolution::init_mk_proof() {
|
||||
|
@ -1061,7 +1061,7 @@ namespace smt {
|
|||
SASSERT(js.get_kind() != b_justification::AXIOM);
|
||||
if (js.get_kind() == b_justification::CLAUSE) {
|
||||
clause * cls = js.get_clause();
|
||||
bool visited = get_proof(cls->get_justification()) != 0;
|
||||
bool visited = get_proof(cls->get_justification()) != nullptr;
|
||||
unsigned num_lits = cls->get_num_literals();
|
||||
unsigned i = 0;
|
||||
if (l != false_literal) {
|
||||
|
@ -1070,20 +1070,20 @@ namespace smt {
|
|||
}
|
||||
else {
|
||||
SASSERT(cls->get_literal(1) == l);
|
||||
if (get_proof(~cls->get_literal(0)) == 0)
|
||||
if (get_proof(~cls->get_literal(0)) == nullptr)
|
||||
visited = false;
|
||||
i = 2;
|
||||
}
|
||||
}
|
||||
for (; i < num_lits; i++) {
|
||||
SASSERT(cls->get_literal(i) != l);
|
||||
if (get_proof(~cls->get_literal(i)) == 0)
|
||||
if (get_proof(~cls->get_literal(i)) == nullptr)
|
||||
visited = false;
|
||||
}
|
||||
return visited;
|
||||
}
|
||||
else
|
||||
return get_proof(js.get_justification()) != 0;
|
||||
return get_proof(js.get_justification()) != nullptr;
|
||||
}
|
||||
|
||||
void conflict_resolution::mk_proof(literal l, b_justification js) {
|
||||
|
@ -1114,11 +1114,11 @@ namespace smt {
|
|||
UNREACHABLE();
|
||||
break;
|
||||
case eq_justification::EQUATION:
|
||||
if (get_proof(js.get_literal()) == 0)
|
||||
if (get_proof(js.get_literal()) == nullptr)
|
||||
visited = false;
|
||||
break;
|
||||
case eq_justification::JUSTIFICATION:
|
||||
if (get_proof(js.get_justification()) == 0)
|
||||
if (get_proof(js.get_justification()) == nullptr)
|
||||
visited = false;
|
||||
break;
|
||||
case eq_justification::CONGRUENCE: {
|
||||
|
@ -1132,16 +1132,16 @@ namespace smt {
|
|||
enode * c1_2 = n1->get_arg(1);
|
||||
enode * c2_1 = n2->get_arg(0);
|
||||
enode * c2_2 = n2->get_arg(1);
|
||||
if (c1_1 != c2_2 && get_proof(c1_1, c2_2) == 0)
|
||||
if (c1_1 != c2_2 && get_proof(c1_1, c2_2) == nullptr)
|
||||
visited = false;
|
||||
if (c1_2 != c2_1 && get_proof(c1_2, c2_1) == 0)
|
||||
if (c1_2 != c2_1 && get_proof(c1_2, c2_1) == nullptr)
|
||||
visited = false;
|
||||
}
|
||||
else {
|
||||
for (unsigned i = 0; i < num_args; i++) {
|
||||
enode * c1 = n1->get_arg(i);
|
||||
enode * c2 = n2->get_arg(i);
|
||||
if (c1 != c2 && get_proof(c1, c2) == 0)
|
||||
if (c1 != c2 && get_proof(c1, c2) == nullptr)
|
||||
visited = false;
|
||||
}
|
||||
}
|
||||
|
@ -1204,7 +1204,7 @@ namespace smt {
|
|||
}
|
||||
prs2.pop_back();
|
||||
}
|
||||
proof * pr = 0;
|
||||
proof * pr = nullptr;
|
||||
SASSERT(!prs1.empty());
|
||||
if (prs1.size() == 1)
|
||||
pr = prs1[0];
|
||||
|
@ -1290,13 +1290,13 @@ namespace smt {
|
|||
}
|
||||
|
||||
SASSERT(visit_b_justification(consequent, conflict));
|
||||
proof * pr = 0;
|
||||
proof * pr = nullptr;
|
||||
if (not_l == null_literal) {
|
||||
pr = get_proof(false_literal, conflict);
|
||||
SASSERT(pr);
|
||||
}
|
||||
else {
|
||||
proof * prs[2] = { 0, 0};
|
||||
proof * prs[2] = { nullptr, nullptr};
|
||||
m_lit2proof.find(not_l, prs[0]);
|
||||
SASSERT(prs[0]);
|
||||
prs[1] = get_proof(consequent, conflict);
|
||||
|
@ -1310,13 +1310,13 @@ namespace smt {
|
|||
m_ctx.literal2expr(lit, l_expr);
|
||||
lits.push_back(l_expr);
|
||||
}
|
||||
expr * fact = 0;
|
||||
expr * fact = nullptr;
|
||||
switch (lits.size()) {
|
||||
case 0: fact = 0; break;
|
||||
case 0: fact = nullptr; break;
|
||||
case 1: fact = lits[0]; break;
|
||||
default: fact = m_manager.mk_or(lits.size(), lits.c_ptr());
|
||||
}
|
||||
if (fact == 0)
|
||||
if (fact == nullptr)
|
||||
m_lemma_proof = pr;
|
||||
else
|
||||
m_lemma_proof = m_manager.mk_lemma(pr, fact);
|
||||
|
|
|
@ -244,7 +244,7 @@ namespace smt {
|
|||
}
|
||||
literal lit = mk_diseq(k, v);
|
||||
literals.push_back(lit);
|
||||
mk_clause(literals.size(), literals.c_ptr(), 0);
|
||||
mk_clause(literals.size(), literals.c_ptr(), nullptr);
|
||||
TRACE("context", display_literals_verbose(tout, literals.size(), literals.c_ptr()););
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,13 +45,13 @@ namespace smt {
|
|||
m_fparams(p),
|
||||
m_params(_p),
|
||||
m_setup(*this, p),
|
||||
m_asserted_formulas(m, p),
|
||||
m_asserted_formulas(m, p, _p),
|
||||
m_qmanager(alloc(quantifier_manager, *this, p, _p)),
|
||||
m_model_generator(alloc(model_generator, m)),
|
||||
m_relevancy_propagator(mk_relevancy_propagator(*this)),
|
||||
m_random(p.m_random_seed),
|
||||
m_flushing(false),
|
||||
m_progress_callback(0),
|
||||
m_progress_callback(nullptr),
|
||||
m_next_progress_sample(0),
|
||||
m_fingerprints(m_region),
|
||||
m_b_internalized_stack(m),
|
||||
|
@ -59,7 +59,7 @@ namespace smt {
|
|||
m_final_check_idx(0),
|
||||
m_cg_table(m),
|
||||
m_dyn_ack_manager(*this, p),
|
||||
m_is_diseq_tmp(0),
|
||||
m_is_diseq_tmp(nullptr),
|
||||
m_units_to_reassert(m_manager),
|
||||
m_qhead(0),
|
||||
m_simp_qhead(0),
|
||||
|
@ -132,6 +132,10 @@ namespace smt {
|
|||
return !m_manager.limit().inc();
|
||||
}
|
||||
|
||||
void context::updt_params(params_ref const& p) {
|
||||
m_params.append(p);
|
||||
m_asserted_formulas.updt_params(p);
|
||||
}
|
||||
|
||||
void context::copy(context& src_ctx, context& dst_ctx) {
|
||||
ast_manager& dst_m = dst_ctx.get_manager();
|
||||
|
@ -176,7 +180,7 @@ namespace smt {
|
|||
for (unsigned i = 0; i < src_ctx.m_assigned_literals.size(); ++i) {
|
||||
literal lit;
|
||||
lit = TRANSLATE(src_ctx.m_assigned_literals[i]);
|
||||
dst_ctx.mk_clause(1, &lit, 0, CLS_AUX, 0);
|
||||
dst_ctx.mk_clause(1, &lit, nullptr, CLS_AUX, nullptr);
|
||||
}
|
||||
#if 0
|
||||
literal_vector lits;
|
||||
|
@ -232,8 +236,8 @@ namespace smt {
|
|||
}
|
||||
|
||||
context * context::mk_fresh(symbol const * l, smt_params * p) {
|
||||
context * new_ctx = alloc(context, m_manager, p == 0 ? m_fparams : *p);
|
||||
new_ctx->set_logic(l == 0 ? m_setup.get_logic() : *l);
|
||||
context * new_ctx = alloc(context, m_manager, p == nullptr ? m_fparams : *p);
|
||||
new_ctx->set_logic(l == nullptr ? m_setup.get_logic() : *l);
|
||||
copy_plugins(*this, *new_ctx);
|
||||
return new_ctx;
|
||||
}
|
||||
|
@ -476,7 +480,7 @@ namespace smt {
|
|||
m_r2_num_parents(r2_num_parents) {
|
||||
}
|
||||
|
||||
virtual void undo(context & ctx) {
|
||||
void undo(context & ctx) override {
|
||||
ctx.undo_add_eq(m_r1, m_n1, m_r2_num_parents);
|
||||
}
|
||||
};
|
||||
|
@ -741,9 +745,9 @@ namespace smt {
|
|||
enode * curr = n->m_trans.m_target;
|
||||
enode * prev = n;
|
||||
eq_justification js = n->m_trans.m_justification;
|
||||
prev->m_trans.m_target = 0;
|
||||
prev->m_trans.m_target = nullptr;
|
||||
prev->m_trans.m_justification = null_eq_justification;
|
||||
while (curr != 0) {
|
||||
while (curr != nullptr) {
|
||||
SASSERT(prev->trans_reaches(n));
|
||||
enode * new_curr = curr->m_trans.m_target;
|
||||
eq_justification new_js = curr->m_trans.m_justification;
|
||||
|
@ -798,7 +802,7 @@ namespace smt {
|
|||
theory_var context::get_closest_var(enode * n, theory_id th_id) {
|
||||
if (th_id == null_theory_id)
|
||||
return null_theory_var;
|
||||
while (n != 0) {
|
||||
while (n != nullptr) {
|
||||
theory_var v = n->get_th_var(th_id);
|
||||
if (v != null_theory_var)
|
||||
return v;
|
||||
|
@ -826,7 +830,7 @@ namespace smt {
|
|||
if (js.get_kind() == eq_justification::JUSTIFICATION)
|
||||
from_th = js.get_justification()->get_from_theory();
|
||||
|
||||
if (r2->m_th_var_list.get_next() == 0 && r1->m_th_var_list.get_next() == 0) {
|
||||
if (r2->m_th_var_list.get_next() == nullptr && r1->m_th_var_list.get_next() == nullptr) {
|
||||
// Common case: r2 and r1 have at most one theory var.
|
||||
theory_id t2 = r2->m_th_var_list.get_th_id();
|
||||
theory_id t1 = r1->m_th_var_list.get_th_id();
|
||||
|
@ -1023,7 +1027,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
// restore theory vars
|
||||
if (r2->m_th_var_list.get_next() == 0) {
|
||||
if (r2->m_th_var_list.get_next() == nullptr) {
|
||||
// common case: r2 has at most one variable
|
||||
theory_var v2 = r2->m_th_var_list.get_th_var();
|
||||
if (v2 != null_theory_var) {
|
||||
|
@ -1043,7 +1047,7 @@ namespace smt {
|
|||
// r1 -> .. -> n1 -> n2 -> ... -> r2
|
||||
SASSERT(r1->trans_reaches(r2));
|
||||
SASSERT(r1->trans_reaches(n1));
|
||||
n1->m_trans.m_target = 0;
|
||||
n1->m_trans.m_target = nullptr;
|
||||
n1->m_trans.m_justification = null_eq_justification;
|
||||
invert_trans(r1);
|
||||
// ---------------
|
||||
|
@ -1067,7 +1071,7 @@ namespace smt {
|
|||
*/
|
||||
void context::restore_theory_vars(enode * r2, enode * r1) {
|
||||
SASSERT(r2->get_root() == r2);
|
||||
theory_var_list * new_l2 = 0;
|
||||
theory_var_list * new_l2 = nullptr;
|
||||
theory_var_list * l2 = r2->get_th_var_list();
|
||||
while (l2) {
|
||||
theory_var v2 = l2->get_th_var();
|
||||
|
@ -1091,11 +1095,11 @@ namespace smt {
|
|||
}
|
||||
|
||||
if (new_l2) {
|
||||
new_l2->set_next(0);
|
||||
new_l2->set_next(nullptr);
|
||||
}
|
||||
else {
|
||||
r2->m_th_var_list.set_th_var(null_theory_var);
|
||||
r2->m_th_var_list.set_next(0);
|
||||
r2->m_th_var_list.set_next(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1128,7 +1132,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
// Propagate disequalities to theories
|
||||
if (r1->m_th_var_list.get_next() == 0 && r2->m_th_var_list.get_next() == 0) {
|
||||
if (r1->m_th_var_list.get_next() == nullptr && r2->m_th_var_list.get_next() == nullptr) {
|
||||
// common case: r2 and r1 have at most one theory var.
|
||||
theory_id t1 = r1->m_th_var_list.get_th_id();
|
||||
theory_var v1 = m_fparams.m_new_core2th_eq ? get_closest_var(n1, t1) : r1->m_th_var_list.get_th_var();
|
||||
|
@ -1451,7 +1455,7 @@ namespace smt {
|
|||
bool_var m_var;
|
||||
public:
|
||||
set_var_theory_trail(bool_var v):m_var(v) {}
|
||||
virtual void undo(context & ctx) {
|
||||
void undo(context & ctx) override {
|
||||
bool_var_data & d = ctx.m_bdata[m_var];
|
||||
d.reset_notify_theory();
|
||||
}
|
||||
|
@ -1646,11 +1650,11 @@ namespace smt {
|
|||
m_qmanager->relevant_eh(e);
|
||||
}
|
||||
|
||||
theory * propagated_th = 0;
|
||||
theory * propagated_th = nullptr;
|
||||
family_id fid = to_app(n)->get_family_id();
|
||||
if (fid != m_manager.get_basic_family_id()) {
|
||||
theory * th = get_theory(fid);
|
||||
if (th != 0) {
|
||||
if (th != nullptr) {
|
||||
th->relevant_eh(to_app(n));
|
||||
propagated_th = th; // <<< mark that relevancy_eh was already invoked for theory th.
|
||||
}
|
||||
|
@ -1791,7 +1795,7 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
|
||||
void context::set_conflict(b_justification js, literal not_l) {
|
||||
void context::set_conflict(const b_justification & js, literal not_l) {
|
||||
if (!inconsistent()) {
|
||||
TRACE("set_conflict", display_literal_verbose(tout, not_l); display(tout, js); );
|
||||
m_conflict = js;
|
||||
|
@ -2412,7 +2416,7 @@ namespace smt {
|
|||
if (!bs.m_inconsistent) {
|
||||
m_conflict = null_b_justification;
|
||||
m_not_l = null_literal;
|
||||
m_unsat_proof = 0;
|
||||
m_unsat_proof = nullptr;
|
||||
}
|
||||
m_base_scopes.shrink(new_lvl);
|
||||
}
|
||||
|
@ -2532,7 +2536,7 @@ namespace smt {
|
|||
if (m_manager.proofs_enabled() && !simp_lits.empty()) {
|
||||
SASSERT(m_scope_lvl == m_base_lvl);
|
||||
justification * js = cls->get_justification();
|
||||
justification * new_js = 0;
|
||||
justification * new_js = nullptr;
|
||||
if (js->in_region())
|
||||
new_js = mk_justification(unit_resolution_justification(m_region,
|
||||
js,
|
||||
|
@ -2586,7 +2590,7 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
justification * cls_js = cls->get_justification();
|
||||
justification * js = 0;
|
||||
justification * js = nullptr;
|
||||
if (!cls_js || cls_js->in_region()) {
|
||||
// If cls_js is 0 or is allocated in a region, then
|
||||
// we can allocate the new justification in a region too.
|
||||
|
@ -2598,7 +2602,7 @@ namespace smt {
|
|||
else {
|
||||
js = alloc(unit_resolution_justification, cls_js, simp_lits.size(), simp_lits.c_ptr());
|
||||
// js took ownership of the justification object.
|
||||
cls->set_justification(0);
|
||||
cls->set_justification(nullptr);
|
||||
m_justifications.push_back(js);
|
||||
}
|
||||
set_justification(v0, m_bdata[v0], b_justification(js));
|
||||
|
@ -2851,7 +2855,7 @@ namespace smt {
|
|||
#endif
|
||||
|
||||
void context::register_plugin(theory * th) {
|
||||
if (m_theories.get_plugin(th->get_family_id()) != 0) {
|
||||
if (m_theories.get_plugin(th->get_family_id()) != nullptr) {
|
||||
dealloc(th);
|
||||
return; // context already has a theory for the given family id.
|
||||
}
|
||||
|
@ -2905,12 +2909,12 @@ namespace smt {
|
|||
void context::flush() {
|
||||
flet<bool> l1(m_flushing, true);
|
||||
TRACE("flush", tout << "m_scope_lvl: " << m_scope_lvl << "\n";);
|
||||
m_relevancy_propagator = 0;
|
||||
m_relevancy_propagator = nullptr;
|
||||
m_model_generator->reset();
|
||||
for (theory* t : m_theory_set)
|
||||
t->flush_eh();
|
||||
undo_trail_stack(0);
|
||||
m_qmanager = 0;
|
||||
m_qmanager = nullptr;
|
||||
del_clauses(m_aux_clauses, 0);
|
||||
del_clauses(m_lemmas, 0);
|
||||
del_justifications(m_justifications, 0);
|
||||
|
@ -2918,7 +2922,7 @@ namespace smt {
|
|||
m_is_diseq_tmp->del_eh(m_manager, false);
|
||||
m_manager.dec_ref(m_is_diseq_tmp->get_owner());
|
||||
enode::del_dummy(m_is_diseq_tmp);
|
||||
m_is_diseq_tmp = 0;
|
||||
m_is_diseq_tmp = nullptr;
|
||||
}
|
||||
std::for_each(m_almost_cg_tables.begin(), m_almost_cg_tables.end(), delete_proc<almost_cg_table>());
|
||||
}
|
||||
|
@ -2929,7 +2933,7 @@ namespace smt {
|
|||
TRACE("begin_assert_expr", tout << mk_pp(e, m_manager) << "\n";);
|
||||
TRACE("begin_assert_expr_ll", tout << mk_ll_pp(e, m_manager) << "\n";);
|
||||
pop_to_base_lvl();
|
||||
if (pr == 0)
|
||||
if (pr == nullptr)
|
||||
m_asserted_formulas.assert_expr(e);
|
||||
else
|
||||
m_asserted_formulas.assert_expr(e, pr);
|
||||
|
@ -2937,7 +2941,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
void context::assert_expr(expr * e) {
|
||||
assert_expr(e, 0);
|
||||
assert_expr(e, nullptr);
|
||||
}
|
||||
|
||||
void context::assert_expr(expr * e, proof * pr) {
|
||||
|
@ -2951,7 +2955,7 @@ namespace smt {
|
|||
case_split_insert_trail(literal l):
|
||||
l(l) {
|
||||
}
|
||||
virtual void undo(context & ctx) {
|
||||
void undo(context & ctx) override {
|
||||
ctx.undo_th_case_split(l);
|
||||
}
|
||||
};
|
||||
|
@ -2966,7 +2970,7 @@ namespace smt {
|
|||
for (unsigned j = i+1; j < num_lits; ++j) {
|
||||
literal l1 = lits[i];
|
||||
literal l2 = lits[j];
|
||||
mk_clause(~l1, ~l2, (justification*) 0);
|
||||
mk_clause(~l1, ~l2, (justification*) nullptr);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -3084,7 +3088,7 @@ namespace smt {
|
|||
}
|
||||
if (m_asserted_formulas.inconsistent() && !inconsistent()) {
|
||||
proof * pr = m_asserted_formulas.get_inconsistency_proof();
|
||||
if (pr == 0) {
|
||||
if (pr == nullptr) {
|
||||
set_conflict(b_justification::mk_axiom());
|
||||
}
|
||||
else {
|
||||
|
@ -3143,6 +3147,7 @@ namespace smt {
|
|||
push_scope();
|
||||
for (unsigned i = 0; i < num_assumptions; i++) {
|
||||
expr * curr_assumption = assumptions[i];
|
||||
if (m_manager.is_true(curr_assumption)) continue;
|
||||
SASSERT(is_valid_assumption(m_manager, curr_assumption));
|
||||
proof * pr = m_manager.mk_asserted(curr_assumption);
|
||||
internalize_assertion(curr_assumption, pr, 0);
|
||||
|
@ -3202,10 +3207,8 @@ namespace smt {
|
|||
});
|
||||
validate_unsat_core();
|
||||
// theory validation of unsat core
|
||||
ptr_vector<theory>::iterator th_it = m_theory_set.begin();
|
||||
ptr_vector<theory>::iterator th_end = m_theory_set.end();
|
||||
for (; th_it != th_end; ++th_it) {
|
||||
lbool theory_result = (*th_it)->validate_unsat_core(m_unsat_core);
|
||||
for (theory* th : m_theory_set) {
|
||||
lbool theory_result = th->validate_unsat_core(m_unsat_core);
|
||||
if (theory_result == l_undef) {
|
||||
return l_undef;
|
||||
}
|
||||
|
@ -3296,10 +3299,8 @@ namespace smt {
|
|||
#ifndef _EXTERNAL_RELEASE
|
||||
if (m_fparams.m_display_installed_theories) {
|
||||
std::cout << "(theories";
|
||||
ptr_vector<theory>::iterator it = m_theory_set.begin();
|
||||
ptr_vector<theory>::iterator end = m_theory_set.end();
|
||||
for (; it != end; ++it) {
|
||||
std::cout << " " << (*it)->get_name();
|
||||
for (theory* th : m_theory_set) {
|
||||
std::cout << " " << th->get_name();
|
||||
}
|
||||
std::cout << ")" << std::endl;
|
||||
}
|
||||
|
@ -3316,17 +3317,13 @@ namespace smt {
|
|||
m_fparams.m_relevancy_lemma = false;
|
||||
|
||||
// setup all the theories
|
||||
ptr_vector<theory>::iterator it = m_theory_set.begin();
|
||||
ptr_vector<theory>::iterator end = m_theory_set.end();
|
||||
for (; it != end; ++it)
|
||||
(*it)->setup();
|
||||
for (theory* th : m_theory_set)
|
||||
th->setup();
|
||||
}
|
||||
|
||||
void context::add_theory_assumptions(expr_ref_vector & theory_assumptions) {
|
||||
ptr_vector<theory>::iterator it = m_theory_set.begin();
|
||||
ptr_vector<theory>::iterator end = m_theory_set.end();
|
||||
for (; it != end; ++it) {
|
||||
(*it)->add_theory_assumptions(theory_assumptions);
|
||||
for (theory* th : m_theory_set) {
|
||||
th->add_theory_assumptions(theory_assumptions);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3342,18 +3339,7 @@ namespace smt {
|
|||
if (!check_preamble(reset_cancel))
|
||||
return l_undef;
|
||||
|
||||
expr_ref_vector all_assumptions(m_manager, ext_num_assumptions, ext_assumptions);
|
||||
if (!already_did_theory_assumptions) {
|
||||
add_theory_assumptions(all_assumptions);
|
||||
}
|
||||
|
||||
unsigned num_assumptions = all_assumptions.size();
|
||||
expr * const * assumptions = all_assumptions.c_ptr();
|
||||
|
||||
if (!validate_assumptions(num_assumptions, assumptions))
|
||||
return l_undef;
|
||||
TRACE("check_bug", tout << "inconsistent: " << inconsistent() << ", m_unsat_core.empty(): " << m_unsat_core.empty() << "\n";);
|
||||
TRACE("unsat_core_bug", for (unsigned i = 0; i < num_assumptions; i++) { tout << mk_pp(assumptions[i], m_manager) << "\n";});
|
||||
pop_to_base_lvl();
|
||||
TRACE("before_search", display(tout););
|
||||
SASSERT(at_base_level());
|
||||
|
@ -3363,6 +3349,18 @@ namespace smt {
|
|||
}
|
||||
else {
|
||||
setup_context(false);
|
||||
expr_ref_vector all_assumptions(m_manager, ext_num_assumptions, ext_assumptions);
|
||||
if (!already_did_theory_assumptions) {
|
||||
add_theory_assumptions(all_assumptions);
|
||||
}
|
||||
|
||||
unsigned num_assumptions = all_assumptions.size();
|
||||
expr * const * assumptions = all_assumptions.c_ptr();
|
||||
|
||||
if (!validate_assumptions(num_assumptions, assumptions))
|
||||
return l_undef;
|
||||
TRACE("unsat_core_bug", tout << all_assumptions << "\n";);
|
||||
|
||||
internalize_assertions();
|
||||
TRACE("after_internalize_assertions", display(tout););
|
||||
if (m_asserted_formulas.inconsistent()) {
|
||||
|
@ -3411,7 +3409,7 @@ namespace smt {
|
|||
m_luby_idx = 1;
|
||||
m_lemma_gc_threshold = m_fparams.m_lemma_gc_initial;
|
||||
m_last_search_failure = OK;
|
||||
m_unsat_proof = 0;
|
||||
m_unsat_proof = nullptr;
|
||||
m_unsat_core .reset();
|
||||
m_dyn_ack_manager .init_search_eh();
|
||||
m_final_check_idx = 0;
|
||||
|
@ -3551,10 +3549,9 @@ namespace smt {
|
|||
pop_scope(m_scope_lvl - curr_lvl);
|
||||
SASSERT(at_search_level());
|
||||
}
|
||||
ptr_vector<theory>::iterator it = m_theory_set.begin();
|
||||
ptr_vector<theory>::iterator end = m_theory_set.end();
|
||||
for (; it != end && !inconsistent(); ++it)
|
||||
(*it)->restart_eh();
|
||||
for (theory* th : m_theory_set) {
|
||||
if (!inconsistent()) th->restart_eh();
|
||||
}
|
||||
TRACE("mbqi_bug_detail", tout << "before instantiating quantifiers...\n";);
|
||||
if (!inconsistent()) {
|
||||
m_qmanager->restart_eh();
|
||||
|
@ -3874,7 +3871,7 @@ namespace smt {
|
|||
expr_signs.push_back(l.sign());
|
||||
}
|
||||
#endif
|
||||
proof * pr = 0;
|
||||
proof * pr = nullptr;
|
||||
if (m_manager.proofs_enabled()) {
|
||||
pr = m_conflict_resolution->get_lemma_proof();
|
||||
// check_proof(pr);
|
||||
|
@ -3947,7 +3944,7 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
#endif
|
||||
justification * js = 0;
|
||||
justification * js = nullptr;
|
||||
if (m_manager.proofs_enabled()) {
|
||||
js = alloc(justification_proof_wrapper, *this, pr, false);
|
||||
}
|
||||
|
@ -4070,10 +4067,7 @@ namespace smt {
|
|||
bool include = false;
|
||||
if (at_lbls) {
|
||||
// include if there is a label with the '@' sign.
|
||||
buffer<symbol>::const_iterator it = lbls.begin();
|
||||
buffer<symbol>::const_iterator end = lbls.end();
|
||||
for (; it != end; ++it) {
|
||||
symbol const & s = *it;
|
||||
for (symbol const& s : lbls) {
|
||||
if (s.contains('@')) {
|
||||
include = true;
|
||||
break;
|
||||
|
@ -4142,7 +4136,7 @@ namespace smt {
|
|||
bool_var m_var;
|
||||
public:
|
||||
set_true_first_trail(bool_var v):m_var(v) {}
|
||||
virtual void undo(context & ctx) {
|
||||
void undo(context & ctx) override {
|
||||
ctx.m_bdata[m_var].reset_true_first_flag();
|
||||
}
|
||||
};
|
||||
|
@ -4282,7 +4276,7 @@ namespace smt {
|
|||
sort * s = m_manager.get_sort(n->get_owner());
|
||||
family_id fid = s->get_family_id();
|
||||
theory * th = get_theory(fid);
|
||||
if (th == 0)
|
||||
if (th == nullptr)
|
||||
return false;
|
||||
return th->get_value(n, value);
|
||||
}
|
||||
|
@ -4324,21 +4318,19 @@ namespace smt {
|
|||
if (m_fparams.m_model_compact)
|
||||
m_proto_model->compress();
|
||||
TRACE("mbqi_bug", tout << "after cleanup:\n"; model_pp(tout, *m_proto_model););
|
||||
}
|
||||
else {
|
||||
|
||||
IF_VERBOSE(11, model_pp(verbose_stream(), *m_proto_model););
|
||||
}
|
||||
}
|
||||
|
||||
proof * context::get_proof() {
|
||||
if (!m_manager.proofs_enabled())
|
||||
return 0;
|
||||
return nullptr;
|
||||
return m_unsat_proof;
|
||||
}
|
||||
|
||||
void context::get_model(model_ref & m) const {
|
||||
if (inconsistent())
|
||||
m = 0;
|
||||
m = nullptr;
|
||||
else
|
||||
m = const_cast<model*>(m_model.get());
|
||||
}
|
||||
|
|
|
@ -203,11 +203,11 @@ namespace smt {
|
|||
struct scoped_mk_model {
|
||||
context & m_ctx;
|
||||
scoped_mk_model(context & ctx):m_ctx(ctx) {
|
||||
m_ctx.m_proto_model = 0;
|
||||
m_ctx.m_model = 0;
|
||||
m_ctx.m_proto_model = nullptr;
|
||||
m_ctx.m_model = nullptr;
|
||||
}
|
||||
~scoped_mk_model() {
|
||||
if (m_ctx.m_proto_model.get() != 0) {
|
||||
if (m_ctx.m_proto_model.get() != nullptr) {
|
||||
m_ctx.m_model = m_ctx.m_proto_model->mk_model();
|
||||
try {
|
||||
m_ctx.add_rec_funs_to_model();
|
||||
|
@ -215,7 +215,7 @@ namespace smt {
|
|||
catch (...) {
|
||||
// no op
|
||||
}
|
||||
m_ctx.m_proto_model = 0; // proto_model is not needed anymore.
|
||||
m_ctx.m_proto_model = nullptr; // proto_model is not needed anymore.
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -262,6 +262,8 @@ namespace smt {
|
|||
return m_params;
|
||||
}
|
||||
|
||||
void updt_params(params_ref const& p);
|
||||
|
||||
bool get_cancel_flag();
|
||||
|
||||
region & get_region() {
|
||||
|
@ -514,12 +516,12 @@ namespace smt {
|
|||
|
||||
enode_vector::const_iterator begin_enodes_of(func_decl const * decl) const {
|
||||
unsigned id = decl->get_decl_id();
|
||||
return id < m_decl2enodes.size() ? m_decl2enodes[id].begin() : 0;
|
||||
return id < m_decl2enodes.size() ? m_decl2enodes[id].begin() : nullptr;
|
||||
}
|
||||
|
||||
enode_vector::const_iterator end_enodes_of(func_decl const * decl) const {
|
||||
unsigned id = decl->get_decl_id();
|
||||
return id < m_decl2enodes.size() ? m_decl2enodes[id].end() : 0;
|
||||
return id < m_decl2enodes.size() ? m_decl2enodes[id].end() : nullptr;
|
||||
}
|
||||
|
||||
ptr_vector<enode>::const_iterator begin_enodes() const {
|
||||
|
@ -746,7 +748,7 @@ namespace smt {
|
|||
friend class mk_bool_var_trail;
|
||||
class mk_bool_var_trail : public trail<context> {
|
||||
public:
|
||||
virtual void undo(context & ctx) { ctx.undo_mk_bool_var(); }
|
||||
void undo(context & ctx) override { ctx.undo_mk_bool_var(); }
|
||||
};
|
||||
mk_bool_var_trail m_mk_bool_var_trail;
|
||||
|
||||
|
@ -755,7 +757,7 @@ namespace smt {
|
|||
friend class mk_enode_trail;
|
||||
class mk_enode_trail : public trail<context> {
|
||||
public:
|
||||
virtual void undo(context & ctx) { ctx.undo_mk_enode(); }
|
||||
void undo(context & ctx) override { ctx.undo_mk_enode(); }
|
||||
};
|
||||
|
||||
mk_enode_trail m_mk_enode_trail;
|
||||
|
@ -822,17 +824,17 @@ namespace smt {
|
|||
|
||||
void internalize(expr * n, bool gate_ctx, unsigned generation);
|
||||
|
||||
clause * mk_clause(unsigned num_lits, literal * lits, justification * j, clause_kind k = CLS_AUX, clause_del_eh * del_eh = 0);
|
||||
clause * mk_clause(unsigned num_lits, literal * lits, justification * j, clause_kind k = CLS_AUX, clause_del_eh * del_eh = nullptr);
|
||||
|
||||
void mk_clause(literal l1, literal l2, justification * j);
|
||||
|
||||
void mk_clause(literal l1, literal l2, literal l3, justification * j);
|
||||
|
||||
void mk_th_axiom(theory_id tid, unsigned num_lits, literal * lits, unsigned num_params = 0, parameter * params = 0);
|
||||
void mk_th_axiom(theory_id tid, unsigned num_lits, literal * lits, unsigned num_params = 0, parameter * params = nullptr);
|
||||
|
||||
void mk_th_axiom(theory_id tid, literal l1, literal l2, unsigned num_params = 0, parameter * params = 0);
|
||||
void mk_th_axiom(theory_id tid, literal l1, literal l2, unsigned num_params = 0, parameter * params = nullptr);
|
||||
|
||||
void mk_th_axiom(theory_id tid, literal l1, literal l2, literal l3, unsigned num_params = 0, parameter * params = 0);
|
||||
void mk_th_axiom(theory_id tid, literal l1, literal l2, literal l3, unsigned num_params = 0, parameter * params = nullptr);
|
||||
|
||||
/*
|
||||
* Provide a hint to the core solver that the specified literals form a "theory case split".
|
||||
|
@ -897,7 +899,7 @@ namespace smt {
|
|||
void trace_assign(literal l, b_justification j, bool decision) const;
|
||||
|
||||
public:
|
||||
void assign(literal l, b_justification j, bool decision = false) {
|
||||
void assign(literal l, const b_justification & j, bool decision = false) {
|
||||
SASSERT(l != false_literal);
|
||||
SASSERT(l != null_literal);
|
||||
switch (get_assignment(l)) {
|
||||
|
@ -998,9 +1000,9 @@ namespace smt {
|
|||
|
||||
void assign_quantifier(quantifier * q);
|
||||
|
||||
void set_conflict(b_justification js, literal not_l);
|
||||
void set_conflict(const b_justification & js, literal not_l);
|
||||
|
||||
void set_conflict(b_justification js) {
|
||||
void set_conflict(const b_justification & js) {
|
||||
set_conflict(js, null_literal);
|
||||
}
|
||||
|
||||
|
@ -1387,7 +1389,7 @@ namespace smt {
|
|||
void flush();
|
||||
config_mode get_config_mode(bool use_static_features) const;
|
||||
virtual void setup_context(bool use_static_features);
|
||||
void setup_components(void);
|
||||
void setup_components();
|
||||
void pop_to_base_lvl();
|
||||
void pop_to_search_lvl();
|
||||
#ifdef Z3DEBUG
|
||||
|
@ -1460,7 +1462,7 @@ namespace smt {
|
|||
If l == 0, then the logic of this context is used in the new context.
|
||||
If p == 0, then this->m_params is used
|
||||
*/
|
||||
context * mk_fresh(symbol const * l = 0, smt_params * p = 0);
|
||||
context * mk_fresh(symbol const * l = nullptr, smt_params * p = nullptr);
|
||||
|
||||
static void copy(context& src, context& dst);
|
||||
|
||||
|
@ -1482,7 +1484,7 @@ namespace smt {
|
|||
|
||||
void pop(unsigned num_scopes);
|
||||
|
||||
lbool check(unsigned num_assumptions = 0, expr * const * assumptions = 0, bool reset_cancel = true, bool already_did_theory_assumptions = false);
|
||||
lbool check(unsigned num_assumptions = 0, expr * const * assumptions = nullptr, bool reset_cancel = true, bool already_did_theory_assumptions = false);
|
||||
|
||||
lbool get_consequences(expr_ref_vector const& assumptions, expr_ref_vector const& vars, expr_ref_vector& conseq, expr_ref_vector& unfixed);
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace smt {
|
|||
n->m_owner = owner;
|
||||
n->m_root = n;
|
||||
n->m_next = n;
|
||||
n->m_cg = 0;
|
||||
n->m_cg = nullptr;
|
||||
n->m_class_size = 1;
|
||||
n->m_generation = generation;
|
||||
n->m_func_decl_id = UINT_MAX;
|
||||
|
@ -130,11 +130,11 @@ namespace smt {
|
|||
if (m_th_var_list.get_th_var() == null_theory_var) {
|
||||
m_th_var_list.set_th_var(v);
|
||||
m_th_var_list.set_th_id(id);
|
||||
m_th_var_list.set_next(0);
|
||||
m_th_var_list.set_next(nullptr);
|
||||
}
|
||||
else {
|
||||
theory_var_list * l = &m_th_var_list;
|
||||
while (l->get_next() != 0) {
|
||||
while (l->get_next() != nullptr) {
|
||||
SASSERT(l->get_th_id() != id);
|
||||
l = l->get_next();
|
||||
}
|
||||
|
@ -172,11 +172,11 @@ namespace smt {
|
|||
SASSERT(get_th_var(id) != null_theory_var);
|
||||
if (m_th_var_list.get_th_id() == id) {
|
||||
theory_var_list * next = m_th_var_list.get_next();
|
||||
if (next == 0) {
|
||||
if (next == nullptr) {
|
||||
// most common case
|
||||
m_th_var_list.set_th_var(null_theory_var);
|
||||
m_th_var_list.set_th_id(null_theory_id);
|
||||
m_th_var_list.set_next(0);
|
||||
m_th_var_list.set_next(nullptr);
|
||||
}
|
||||
else {
|
||||
m_th_var_list = *next;
|
||||
|
@ -405,7 +405,7 @@ namespace smt {
|
|||
tmp_enode::tmp_enode():
|
||||
m_app(0),
|
||||
m_capacity(0),
|
||||
m_enode_data(0) {
|
||||
m_enode_data(nullptr) {
|
||||
SASSERT(m_app.get_app()->get_decl() == 0);
|
||||
set_capacity(5);
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace smt {
|
|||
enode * m_target;
|
||||
eq_justification m_justification;
|
||||
trans_justification():
|
||||
m_target(0),
|
||||
m_target(nullptr),
|
||||
m_justification(null_eq_justification) {
|
||||
}
|
||||
};
|
||||
|
@ -116,7 +116,7 @@ namespace smt {
|
|||
|
||||
|
||||
theory_var_list * get_th_var_list() {
|
||||
return m_th_var_list.get_th_var() == null_theory_var ? 0 : &m_th_var_list;
|
||||
return m_th_var_list.get_th_var() == null_theory_var ? nullptr : &m_th_var_list;
|
||||
}
|
||||
|
||||
friend class set_merge_tf_trail;
|
||||
|
@ -306,7 +306,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
theory_var_list const * get_th_var_list() const {
|
||||
return m_th_var_list.get_th_var() == null_theory_var ? 0 : &m_th_var_list;
|
||||
return m_th_var_list.get_th_var() == null_theory_var ? nullptr : &m_th_var_list;
|
||||
}
|
||||
|
||||
bool has_th_vars() const {
|
||||
|
|
|
@ -78,7 +78,7 @@ namespace smt {
|
|||
}
|
||||
};
|
||||
|
||||
const eq_justification null_eq_justification(static_cast<justification*>(0));
|
||||
const eq_justification null_eq_justification(static_cast<justification*>(nullptr));
|
||||
};
|
||||
|
||||
#endif /* SMT_EQ_JUSTIFICATION_H_ */
|
||||
|
|
|
@ -93,8 +93,8 @@ namespace smt {
|
|||
for_each_relevant_expr(ctx),
|
||||
m_buffer(b) {
|
||||
}
|
||||
virtual ~collect_relevant_label_lits() {}
|
||||
virtual void operator()(expr * n);
|
||||
~collect_relevant_label_lits() override {}
|
||||
void operator()(expr * n) override;
|
||||
};
|
||||
|
||||
class collect_relevant_labels : public for_each_relevant_expr {
|
||||
|
@ -104,8 +104,8 @@ namespace smt {
|
|||
for_each_relevant_expr(ctx),
|
||||
m_buffer(b) {
|
||||
}
|
||||
virtual ~collect_relevant_labels() {}
|
||||
virtual void operator()(expr * n);
|
||||
~collect_relevant_labels() override {}
|
||||
void operator()(expr * n) override;
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
@ -96,7 +96,7 @@ namespace smt {
|
|||
++m_stats_calls;
|
||||
m_solver.push();
|
||||
m_solver.assert_expr(m.mk_not(m.mk_eq(s, t)));
|
||||
bool is_eq = l_false == m_solver.check_sat(0,0);
|
||||
bool is_eq = l_false == m_solver.check_sat(0,nullptr);
|
||||
m_solver.pop(1);
|
||||
TRACE("get_implied_equalities", tout << mk_pp(t, m) << " = " << mk_pp(s, m) << " " << (is_eq?"eq":"unrelated") << "\n";);
|
||||
if (is_eq) {
|
||||
|
@ -123,7 +123,7 @@ namespace smt {
|
|||
m_stats_timer.start();
|
||||
m_solver.push();
|
||||
m_solver.assert_expr(m.mk_not(m.mk_eq(s, t)));
|
||||
bool is_eq = l_false == m_solver.check_sat(0,0);
|
||||
bool is_eq = l_false == m_solver.check_sat(0,nullptr);
|
||||
m_solver.pop(1);
|
||||
m_stats_timer.stop();
|
||||
TRACE("get_implied_equalities", tout << mk_pp(t, m) << " = " << mk_pp(s, m) << " " << (is_eq?"eq":"unrelated") << "\n";);
|
||||
|
@ -155,7 +155,7 @@ namespace smt {
|
|||
m_solver.push();
|
||||
unsigned arity = get_array_arity(srt);
|
||||
expr_ref_vector args(m);
|
||||
args.push_back(0);
|
||||
args.push_back(nullptr);
|
||||
for (unsigned i = 0; i < arity; ++i) {
|
||||
sort* srt_i = get_array_domain(srt, i);
|
||||
expr* idx = m.mk_fresh_const("index", srt_i);
|
||||
|
@ -163,10 +163,10 @@ namespace smt {
|
|||
}
|
||||
for (unsigned i = 0; i < terms.size(); ++i) {
|
||||
args[0] = terms[i].term;
|
||||
terms[i].term = m.mk_app(m_array_util.get_family_id(), OP_SELECT, 0, 0, args.size(), args.c_ptr());
|
||||
terms[i].term = m.mk_app(m_array_util.get_family_id(), OP_SELECT, 0, nullptr, args.size(), args.c_ptr());
|
||||
}
|
||||
assert_relevant(terms);
|
||||
VERIFY(m_solver.check_sat(0,0) != l_false);
|
||||
VERIFY(m_solver.check_sat(0,nullptr) != l_false);
|
||||
model_ref model1;
|
||||
m_solver.get_model(model1);
|
||||
SASSERT(model1.get());
|
||||
|
@ -215,7 +215,7 @@ namespace smt {
|
|||
expr* s = terms[vec[j]].term;
|
||||
m_solver.push();
|
||||
m_solver.assert_expr(m.mk_not(m.mk_eq(t, s)));
|
||||
lbool is_sat = m_solver.check_sat(0,0);
|
||||
lbool is_sat = m_solver.check_sat(0,nullptr);
|
||||
m_solver.pop(1);
|
||||
TRACE("get_implied_equalities", tout << mk_pp(t, m) << " = " << mk_pp(s, m) << " " << is_sat << "\n";);
|
||||
if (is_sat == l_false) {
|
||||
|
@ -284,7 +284,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
lbool reduce_cond(model_ref& model, expr* e) {
|
||||
expr* e1 = 0, *e2 = 0;
|
||||
expr* e1 = nullptr, *e2 = nullptr;
|
||||
if (m.is_eq(e, e1, e2) && m_array_util.is_as_array(e1) && m_array_util.is_as_array(e2)) {
|
||||
if (e1 == e2) {
|
||||
return l_true;
|
||||
|
@ -335,7 +335,7 @@ namespace smt {
|
|||
|
||||
m_solver.push();
|
||||
assert_relevant(num_terms, terms);
|
||||
lbool is_sat = m_solver.check_sat(0,0);
|
||||
lbool is_sat = m_solver.check_sat(0,nullptr);
|
||||
|
||||
if (is_sat != l_false) {
|
||||
model_ref model;
|
||||
|
|
|
@ -121,7 +121,7 @@ namespace smt {
|
|||
bool visited = true;
|
||||
family_id fid = to_app(n)->get_family_id();
|
||||
theory * th = m_theories.get_plugin(fid);
|
||||
bool def_int = th == 0 || th->default_internalizer();
|
||||
bool def_int = th == nullptr || th->default_internalizer();
|
||||
if (!def_int) {
|
||||
ptr_buffer<expr> descendants;
|
||||
get_foreign_descendants(to_app(n), fid, descendants);
|
||||
|
@ -301,7 +301,7 @@ namespace smt {
|
|||
e->mark_as_interpreted();
|
||||
app_ref eq(m_manager.mk_eq(fapp, val), m_manager);
|
||||
TRACE("assert_distinct", tout << "eq: " << mk_pp(eq, m_manager) << "\n";);
|
||||
assert_default(eq, 0);
|
||||
assert_default(eq, nullptr);
|
||||
mark_as_relevant(eq.get());
|
||||
// TODO: we may want to hide the auxiliary values val and the function f from the model.
|
||||
}
|
||||
|
@ -369,7 +369,7 @@ namespace smt {
|
|||
else {
|
||||
TRACE("internalize_bug", tout << "creating enode for #" << n->get_id() << "\n";);
|
||||
mk_enode(to_app(n),
|
||||
true, /* supress arguments, we not not use CC for this kind of enode */
|
||||
true, /* suppress arguments, we not not use CC for this kind of enode */
|
||||
true, /* bool enode must be merged with true/false, since it is not in the context of a gate */
|
||||
false /* CC is not enabled */ );
|
||||
set_enode_flag(v, false);
|
||||
|
@ -453,7 +453,7 @@ namespace smt {
|
|||
// must be associated with an enode.
|
||||
if (!e_internalized(n)) {
|
||||
mk_enode(to_app(n),
|
||||
true, /* supress arguments, we not not use CC for this kind of enode */
|
||||
true, /* suppress arguments, we not not use CC for this kind of enode */
|
||||
true /* bool enode must be merged with true/false, since it is not in the context of a gate */,
|
||||
false /* CC is not enabled */);
|
||||
}
|
||||
|
@ -631,7 +631,7 @@ namespace smt {
|
|||
set_merge_tf_trail(enode * n):
|
||||
m_node(n) {
|
||||
}
|
||||
virtual void undo(context & ctx) {
|
||||
void undo(context & ctx) override {
|
||||
m_node->m_merge_tf = false;
|
||||
}
|
||||
};
|
||||
|
@ -667,7 +667,7 @@ namespace smt {
|
|||
set_enode_flag_trail(bool_var v):
|
||||
m_var(v) {
|
||||
}
|
||||
virtual void undo(context & ctx) {
|
||||
void undo(context & ctx) override {
|
||||
bool_var_data & data = ctx.m_bdata[m_var];
|
||||
data.reset_enode_flag();
|
||||
}
|
||||
|
@ -695,7 +695,7 @@ namespace smt {
|
|||
void context::internalize_term(app * n) {
|
||||
if (e_internalized(n)) {
|
||||
theory * th = m_theories.get_plugin(n->get_family_id());
|
||||
if (th != 0) {
|
||||
if (th != nullptr) {
|
||||
// This code is necessary because some theories may decide
|
||||
// not to create theory variables for a nested application.
|
||||
// Example:
|
||||
|
@ -739,7 +739,7 @@ namespace smt {
|
|||
app_ref eq1(mk_eq_atom(n, t), m_manager);
|
||||
app_ref eq2(mk_eq_atom(n, e), m_manager);
|
||||
mk_enode(n,
|
||||
true /* supress arguments, I don't want to apply CC on ite terms */,
|
||||
true /* suppress arguments, I don't want to apply CC on ite terms */,
|
||||
false /* it is a term, so it should not be merged with true/false */,
|
||||
false /* CC is not enabled */);
|
||||
internalize(c, true);
|
||||
|
@ -797,7 +797,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
enode * e = mk_enode(n,
|
||||
false, /* do not supress args */
|
||||
false, /* do not suppress args */
|
||||
false, /* it is a term, so it should not be merged with true/false */
|
||||
true);
|
||||
apply_sort_cnstr(n, e);
|
||||
|
@ -1271,7 +1271,7 @@ namespace smt {
|
|||
case CLS_AUX: {
|
||||
literal_buffer simp_lits;
|
||||
if (!simplify_aux_clause_literals(num_lits, lits, simp_lits))
|
||||
return 0; // clause is equivalent to true;
|
||||
return nullptr; // clause is equivalent to true;
|
||||
DEBUG_CODE({
|
||||
for (unsigned i = 0; i < simp_lits.size(); i++) {
|
||||
SASSERT(get_assignment(simp_lits[i]) == l_true);
|
||||
|
@ -1284,7 +1284,7 @@ namespace smt {
|
|||
}
|
||||
case CLS_AUX_LEMMA: {
|
||||
if (!simplify_aux_lemma_literals(num_lits, lits))
|
||||
return 0; // clause is equivalent to true
|
||||
return nullptr; // clause is equivalent to true
|
||||
// simplify_aux_lemma_literals does not delete literals assigned to false, so
|
||||
// it is not necessary to create a unit_resolution_justification
|
||||
break;
|
||||
|
@ -1303,14 +1303,14 @@ namespace smt {
|
|||
if (j && !j->in_region())
|
||||
m_justifications.push_back(j);
|
||||
TRACE("mk_clause", tout << "empty clause... setting conflict\n";);
|
||||
set_conflict(j == 0 ? b_justification::mk_axiom() : b_justification(j));
|
||||
set_conflict(j == nullptr ? b_justification::mk_axiom() : b_justification(j));
|
||||
SASSERT(inconsistent());
|
||||
return 0;
|
||||
return nullptr;
|
||||
case 1:
|
||||
if (j && !j->in_region())
|
||||
m_justifications.push_back(j);
|
||||
assign(lits[0], j);
|
||||
return 0;
|
||||
return nullptr;
|
||||
case 2:
|
||||
if (use_binary_clause_opt(lits[0], lits[1], lemma)) {
|
||||
literal l1 = lits[0];
|
||||
|
@ -1321,7 +1321,7 @@ namespace smt {
|
|||
assign(l1, b_justification(~l2));
|
||||
|
||||
m_stats.m_num_mk_bin_clause++;
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
default: {
|
||||
m_stats.m_num_mk_clause++;
|
||||
|
@ -1404,7 +1404,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
void context::mk_th_axiom(theory_id tid, unsigned num_lits, literal * lits, unsigned num_params, parameter * params) {
|
||||
justification * js = 0;
|
||||
justification * js = nullptr;
|
||||
TRACE("mk_th_axiom",
|
||||
display_literals_verbose(tout, num_lits, lits);
|
||||
tout << "\n";);
|
||||
|
@ -1449,12 +1449,12 @@ namespace smt {
|
|||
|
||||
void context::mk_gate_clause(unsigned num_lits, literal * lits) {
|
||||
if (m_manager.proofs_enabled()) {
|
||||
proof * pr = mk_clause_def_axiom(num_lits, lits, 0);
|
||||
proof * pr = mk_clause_def_axiom(num_lits, lits, nullptr);
|
||||
TRACE("gate_clause", tout << mk_ll_pp(pr, m_manager););
|
||||
mk_clause(num_lits, lits, mk_justification(justification_proof_wrapper(*this, pr)));
|
||||
}
|
||||
else {
|
||||
mk_clause(num_lits, lits, 0);
|
||||
mk_clause(num_lits, lits, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1487,7 +1487,7 @@ namespace smt {
|
|||
mk_clause(num_lits, lits, mk_justification(justification_proof_wrapper(*this, pr)));
|
||||
}
|
||||
else {
|
||||
mk_clause(num_lits, lits, 0);
|
||||
mk_clause(num_lits, lits, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1506,7 +1506,7 @@ namespace smt {
|
|||
relevancy_eh * eh = m_relevancy_propagator->mk_and_relevancy_eh(n);
|
||||
unsigned num = n->get_num_args();
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
// if one child is assigned to false, the the and-parent must be notified
|
||||
// if one child is assigned to false, the and-parent must be notified
|
||||
literal l = get_literal(n->get_arg(i));
|
||||
add_rel_watch(~l, eh);
|
||||
}
|
||||
|
@ -1518,7 +1518,7 @@ namespace smt {
|
|||
relevancy_eh * eh = m_relevancy_propagator->mk_or_relevancy_eh(n);
|
||||
unsigned num = n->get_num_args();
|
||||
for (unsigned i = 0; i < num; i++) {
|
||||
// if one child is assigned to true, the the or-parent must be notified
|
||||
// if one child is assigned to true, the or-parent must be notified
|
||||
literal l = get_literal(n->get_arg(i));
|
||||
add_rel_watch(l, eh);
|
||||
}
|
||||
|
@ -1612,7 +1612,7 @@ namespace smt {
|
|||
SASSERT(m_th_var != null_theory_var);
|
||||
}
|
||||
|
||||
virtual void undo(context & ctx) {
|
||||
void undo(context & ctx) override {
|
||||
theory_var v = m_enode->get_th_var(m_th_id);
|
||||
SASSERT(v != null_theory_var);
|
||||
SASSERT(m_th_var == v);
|
||||
|
@ -1637,7 +1637,7 @@ namespace smt {
|
|||
m_old_th_var(old_var) {
|
||||
}
|
||||
|
||||
virtual void undo(context & ctx) {
|
||||
void undo(context & ctx) override {
|
||||
SASSERT(m_enode->get_th_var(m_th_id) != null_theory_var);
|
||||
m_enode->replace_th_var(m_old_th_var, m_th_id);
|
||||
}
|
||||
|
|
|
@ -90,17 +90,17 @@ namespace smt {
|
|||
SASSERT(m_antecedent);
|
||||
ptr_buffer<proof> prs;
|
||||
proof * pr = cr.get_proof(m_antecedent);
|
||||
bool visited = pr != 0;
|
||||
bool visited = pr != nullptr;
|
||||
prs.push_back(pr);
|
||||
for (unsigned i = 0; i < m_num_literals; i++) {
|
||||
proof * pr = cr.get_proof(m_literals[i]);
|
||||
if (pr == 0)
|
||||
if (pr == nullptr)
|
||||
visited = false;
|
||||
else
|
||||
prs.push_back(pr);
|
||||
}
|
||||
if (!visited)
|
||||
return 0;
|
||||
return nullptr;
|
||||
ast_manager & m = cr.get_manager();
|
||||
TRACE("unit_resolution_justification_bug",
|
||||
tout << "in mk_proof\n";
|
||||
|
@ -150,7 +150,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
if (!visited)
|
||||
return 0;
|
||||
return nullptr;
|
||||
|
||||
expr * lhs = m_node1->get_root()->get_owner();
|
||||
expr * rhs = m_node2->get_root()->get_owner();
|
||||
|
@ -178,7 +178,7 @@ namespace smt {
|
|||
proof * pr2 = m.mk_rewrite(m.get_fact(pr1), lit);
|
||||
return m.mk_modus_ponens(pr1, pr2);
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void eq_propagation_justification::get_antecedents(conflict_resolution & cr) {
|
||||
|
@ -241,7 +241,7 @@ namespace smt {
|
|||
mk_pp(m.get_fact(pr), m) << "\n";);
|
||||
return pr;
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
simple_justification::simple_justification(region & r, unsigned num_lits, literal const * lits):
|
||||
|
@ -266,7 +266,7 @@ namespace smt {
|
|||
bool visited = true;
|
||||
for (unsigned i = 0; i < m_num_literals; i++) {
|
||||
proof * pr = cr.get_proof(m_literals[i]);
|
||||
if (pr == 0)
|
||||
if (pr == nullptr)
|
||||
visited = false;
|
||||
else
|
||||
result.push_back(pr);
|
||||
|
@ -284,15 +284,15 @@ namespace smt {
|
|||
lits.push_back(l);
|
||||
}
|
||||
if (lits.size() == 1)
|
||||
return m.mk_th_lemma(m_th_id, lits.get(0), 0, 0, m_params.size(), m_params.c_ptr());
|
||||
return m.mk_th_lemma(m_th_id, lits.get(0), 0, nullptr, m_params.size(), m_params.c_ptr());
|
||||
else
|
||||
return m.mk_th_lemma(m_th_id, m.mk_or(lits.size(), lits.c_ptr()), 0, 0, m_params.size(), m_params.c_ptr());
|
||||
return m.mk_th_lemma(m_th_id, m.mk_or(lits.size(), lits.c_ptr()), 0, nullptr, m_params.size(), m_params.c_ptr());
|
||||
}
|
||||
|
||||
proof * theory_propagation_justification::mk_proof(conflict_resolution & cr) {
|
||||
ptr_buffer<proof> prs;
|
||||
if (!antecedent2proof(cr, prs))
|
||||
return 0;
|
||||
return nullptr;
|
||||
context & ctx = cr.get_context();
|
||||
ast_manager & m = cr.get_manager();
|
||||
expr_ref fact(m);
|
||||
|
@ -303,7 +303,7 @@ namespace smt {
|
|||
proof * theory_conflict_justification::mk_proof(conflict_resolution & cr) {
|
||||
ptr_buffer<proof> prs;
|
||||
if (!antecedent2proof(cr, prs))
|
||||
return 0;
|
||||
return nullptr;
|
||||
ast_manager & m = cr.get_manager();
|
||||
return m.mk_th_lemma(m_th_id, m.mk_false(), prs.size(), prs.c_ptr(), m_params.size(), m_params.c_ptr());
|
||||
}
|
||||
|
@ -334,7 +334,7 @@ namespace smt {
|
|||
for (unsigned i = 0; i < m_num_eqs; i++) {
|
||||
enode_pair const & p = m_eqs[i];
|
||||
proof * pr = cr.get_proof(p.first, p.second);
|
||||
if (pr == 0)
|
||||
if (pr == nullptr)
|
||||
visited = false;
|
||||
else
|
||||
result.push_back(pr);
|
||||
|
@ -345,7 +345,7 @@ namespace smt {
|
|||
proof * ext_theory_propagation_justification::mk_proof(conflict_resolution & cr) {
|
||||
ptr_buffer<proof> prs;
|
||||
if (!antecedent2proof(cr, prs))
|
||||
return 0;
|
||||
return nullptr;
|
||||
context & ctx = cr.get_context();
|
||||
ast_manager & m = cr.get_manager();
|
||||
expr_ref fact(m);
|
||||
|
@ -356,7 +356,7 @@ namespace smt {
|
|||
proof * ext_theory_conflict_justification::mk_proof(conflict_resolution & cr) {
|
||||
ptr_buffer<proof> prs;
|
||||
if (!antecedent2proof(cr, prs))
|
||||
return 0;
|
||||
return nullptr;
|
||||
ast_manager & m = cr.get_manager();
|
||||
return m.mk_th_lemma(m_th_id, m.mk_false(), prs.size(), prs.c_ptr(), m_params.size(), m_params.c_ptr());
|
||||
}
|
||||
|
@ -364,7 +364,7 @@ namespace smt {
|
|||
proof * ext_theory_eq_propagation_justification::mk_proof(conflict_resolution & cr) {
|
||||
ptr_buffer<proof> prs;
|
||||
if (!antecedent2proof(cr, prs))
|
||||
return 0;
|
||||
return nullptr;
|
||||
ast_manager & m = cr.get_manager();
|
||||
context & ctx = cr.get_context();
|
||||
expr * fact = ctx.mk_eq_atom(m_lhs->get_owner(), m_rhs->get_owner());
|
||||
|
@ -415,9 +415,9 @@ namespace smt {
|
|||
lits.push_back(l);
|
||||
}
|
||||
if (lits.size() == 1)
|
||||
return m.mk_th_lemma(m_th_id, lits.get(0), 0, 0, m_params.size(), m_params.c_ptr());
|
||||
return m.mk_th_lemma(m_th_id, lits.get(0), 0, nullptr, m_params.size(), m_params.c_ptr());
|
||||
else
|
||||
return m.mk_th_lemma(m_th_id, m.mk_or(lits.size(), lits.c_ptr()), 0, 0, m_params.size(), m_params.c_ptr());
|
||||
return m.mk_th_lemma(m_th_id, m.mk_or(lits.size(), lits.c_ptr()), 0, nullptr, m_params.size(), m_params.c_ptr());
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
@ -102,15 +102,15 @@ namespace smt {
|
|||
public:
|
||||
justification_proof_wrapper(context & ctx, proof * pr, bool in_region = true);
|
||||
|
||||
virtual bool has_del_eh() const {
|
||||
bool has_del_eh() const override {
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual void del_eh(ast_manager & m);
|
||||
void del_eh(ast_manager & m) override;
|
||||
|
||||
virtual proof * mk_proof(conflict_resolution & cr);
|
||||
proof * mk_proof(conflict_resolution & cr) override;
|
||||
|
||||
virtual char const * get_name() const { return "proof-wrapper"; }
|
||||
char const * get_name() const override { return "proof-wrapper"; }
|
||||
};
|
||||
|
||||
class unit_resolution_justification : public justification {
|
||||
|
@ -122,21 +122,21 @@ namespace smt {
|
|||
|
||||
unit_resolution_justification(justification * js, unsigned num_lits, literal const * lits);
|
||||
|
||||
~unit_resolution_justification();
|
||||
~unit_resolution_justification() override;
|
||||
|
||||
virtual bool has_del_eh() const {
|
||||
bool has_del_eh() const override {
|
||||
return !in_region() && m_antecedent && m_antecedent->has_del_eh();
|
||||
}
|
||||
|
||||
virtual void del_eh(ast_manager & m) {
|
||||
void del_eh(ast_manager & m) override {
|
||||
if (!in_region() && m_antecedent) m_antecedent->del_eh(m);
|
||||
}
|
||||
|
||||
virtual void get_antecedents(conflict_resolution & cr);
|
||||
void get_antecedents(conflict_resolution & cr) override;
|
||||
|
||||
virtual proof * mk_proof(conflict_resolution & cr);
|
||||
proof * mk_proof(conflict_resolution & cr) override;
|
||||
|
||||
virtual char const * get_name() const { return "unit-resolution"; }
|
||||
char const * get_name() const override { return "unit-resolution"; }
|
||||
};
|
||||
|
||||
class eq_conflict_justification : public justification {
|
||||
|
@ -150,11 +150,11 @@ namespace smt {
|
|||
m_js(js) {
|
||||
}
|
||||
|
||||
virtual void get_antecedents(conflict_resolution & cr);
|
||||
void get_antecedents(conflict_resolution & cr) override;
|
||||
|
||||
virtual proof * mk_proof(conflict_resolution & cr);
|
||||
proof * mk_proof(conflict_resolution & cr) override;
|
||||
|
||||
virtual char const * get_name() const { return "eq-conflict"; }
|
||||
char const * get_name() const override { return "eq-conflict"; }
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -166,11 +166,11 @@ namespace smt {
|
|||
eq_root_propagation_justification(enode * n):m_node(n) {
|
||||
}
|
||||
|
||||
virtual void get_antecedents(conflict_resolution & cr);
|
||||
void get_antecedents(conflict_resolution & cr) override;
|
||||
|
||||
virtual proof * mk_proof(conflict_resolution & cr);
|
||||
proof * mk_proof(conflict_resolution & cr) override;
|
||||
|
||||
virtual char const * get_name() const { return "eq-root"; }
|
||||
char const * get_name() const override { return "eq-root"; }
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -184,11 +184,11 @@ namespace smt {
|
|||
SASSERT(n1 != n2);
|
||||
}
|
||||
|
||||
virtual void get_antecedents(conflict_resolution & cr);
|
||||
void get_antecedents(conflict_resolution & cr) override;
|
||||
|
||||
virtual proof * mk_proof(conflict_resolution & cr);
|
||||
proof * mk_proof(conflict_resolution & cr) override;
|
||||
|
||||
virtual char const * get_name() const { return "eq-propagation"; }
|
||||
char const * get_name() const override { return "eq-propagation"; }
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -201,11 +201,11 @@ namespace smt {
|
|||
mp_iff_justification(enode * n1, enode * n2):m_node1(n1), m_node2(n2) {
|
||||
}
|
||||
|
||||
virtual void get_antecedents(conflict_resolution & cr);
|
||||
void get_antecedents(conflict_resolution & cr) override;
|
||||
|
||||
virtual proof * mk_proof(conflict_resolution & cr);
|
||||
proof * mk_proof(conflict_resolution & cr) override;
|
||||
|
||||
virtual char const * get_name() const { return "mp-iff"; }
|
||||
char const * get_name() const override { return "mp-iff"; }
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -221,11 +221,11 @@ namespace smt {
|
|||
public:
|
||||
simple_justification(region & r, unsigned num_lits, literal const * lits);
|
||||
|
||||
virtual void get_antecedents(conflict_resolution & cr);
|
||||
void get_antecedents(conflict_resolution & cr) override;
|
||||
|
||||
virtual proof * mk_proof(conflict_resolution & cr) = 0;
|
||||
proof * mk_proof(conflict_resolution & cr) override = 0;
|
||||
|
||||
virtual char const * get_name() const { return "simple"; }
|
||||
char const * get_name() const override { return "simple"; }
|
||||
|
||||
};
|
||||
|
||||
|
@ -240,13 +240,13 @@ namespace smt {
|
|||
unsigned num_params, parameter* params):
|
||||
simple_justification(r, num_lits, lits),
|
||||
m_th_id(fid), m_params(num_params, params) {}
|
||||
virtual ~simple_theory_justification() {}
|
||||
~simple_theory_justification() override {}
|
||||
|
||||
virtual bool has_del_eh() const { return !m_params.empty(); }
|
||||
bool has_del_eh() const override { return !m_params.empty(); }
|
||||
|
||||
virtual void del_eh(ast_manager & m) { m_params.reset(); }
|
||||
void del_eh(ast_manager & m) override { m_params.reset(); }
|
||||
|
||||
virtual theory_id get_from_theory() const { return m_th_id; }
|
||||
theory_id get_from_theory() const override { return m_th_id; }
|
||||
|
||||
};
|
||||
|
||||
|
@ -255,39 +255,39 @@ namespace smt {
|
|||
|
||||
theory_axiom_justification(family_id fid, region & r,
|
||||
unsigned num_lits, literal const * lits,
|
||||
unsigned num_params = 0, parameter* params = 0):
|
||||
unsigned num_params = 0, parameter* params = nullptr):
|
||||
simple_theory_justification(fid, r, num_lits, lits, num_params, params) {}
|
||||
|
||||
virtual void get_antecedents(conflict_resolution & cr) {}
|
||||
void get_antecedents(conflict_resolution & cr) override {}
|
||||
|
||||
virtual proof * mk_proof(conflict_resolution & cr);
|
||||
proof * mk_proof(conflict_resolution & cr) override;
|
||||
|
||||
virtual char const * get_name() const { return "theory-axiom"; }
|
||||
char const * get_name() const override { return "theory-axiom"; }
|
||||
};
|
||||
|
||||
class theory_propagation_justification : public simple_theory_justification {
|
||||
literal m_consequent;
|
||||
public:
|
||||
theory_propagation_justification(family_id fid, region & r, unsigned num_lits, literal const * lits, literal consequent,
|
||||
unsigned num_params = 0, parameter* params = 0):
|
||||
unsigned num_params = 0, parameter* params = nullptr):
|
||||
simple_theory_justification(fid, r, num_lits, lits, num_params, params), m_consequent(consequent) {}
|
||||
|
||||
virtual proof * mk_proof(conflict_resolution & cr);
|
||||
proof * mk_proof(conflict_resolution & cr) override;
|
||||
|
||||
|
||||
virtual char const * get_name() const { return "theory-propagation"; }
|
||||
char const * get_name() const override { return "theory-propagation"; }
|
||||
|
||||
};
|
||||
|
||||
class theory_conflict_justification : public simple_theory_justification {
|
||||
public:
|
||||
theory_conflict_justification(family_id fid, region & r, unsigned num_lits, literal const * lits,
|
||||
unsigned num_params = 0, parameter* params = 0):
|
||||
unsigned num_params = 0, parameter* params = nullptr):
|
||||
simple_theory_justification(fid, r, num_lits, lits, num_params, params) {}
|
||||
|
||||
virtual proof * mk_proof(conflict_resolution & cr);
|
||||
proof * mk_proof(conflict_resolution & cr) override;
|
||||
|
||||
virtual char const * get_name() const { return "theory-conflict"; }
|
||||
char const * get_name() const override { return "theory-conflict"; }
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -304,11 +304,11 @@ namespace smt {
|
|||
ext_simple_justification(region & r, unsigned num_lits, literal const * lits,
|
||||
unsigned num_eqs, enode_pair const * eqs);
|
||||
|
||||
virtual void get_antecedents(conflict_resolution & cr);
|
||||
void get_antecedents(conflict_resolution & cr) override;
|
||||
|
||||
virtual proof * mk_proof(conflict_resolution & cr) = 0;
|
||||
proof * mk_proof(conflict_resolution & cr) override = 0;
|
||||
|
||||
virtual char const * get_name() const { return "ext-simple"; }
|
||||
char const * get_name() const override { return "ext-simple"; }
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -322,16 +322,16 @@ namespace smt {
|
|||
public:
|
||||
ext_theory_simple_justification(family_id fid, region & r, unsigned num_lits, literal const * lits,
|
||||
unsigned num_eqs, enode_pair const * eqs,
|
||||
unsigned num_params = 0, parameter* params = 0):
|
||||
unsigned num_params = 0, parameter* params = nullptr):
|
||||
ext_simple_justification(r, num_lits, lits, num_eqs, eqs), m_th_id(fid), m_params(num_params, params) {}
|
||||
|
||||
virtual ~ext_theory_simple_justification() {}
|
||||
~ext_theory_simple_justification() override {}
|
||||
|
||||
virtual bool has_del_eh() const { return !m_params.empty(); }
|
||||
bool has_del_eh() const override { return !m_params.empty(); }
|
||||
|
||||
virtual void del_eh(ast_manager & m) { m_params.reset(); }
|
||||
void del_eh(ast_manager & m) override { m_params.reset(); }
|
||||
|
||||
virtual theory_id get_from_theory() const { return m_th_id; }
|
||||
theory_id get_from_theory() const override { return m_th_id; }
|
||||
};
|
||||
|
||||
class ext_theory_propagation_justification : public ext_theory_simple_justification {
|
||||
|
@ -341,25 +341,25 @@ namespace smt {
|
|||
unsigned num_lits, literal const * lits,
|
||||
unsigned num_eqs, enode_pair const * eqs,
|
||||
literal consequent,
|
||||
unsigned num_params = 0, parameter* params = 0):
|
||||
unsigned num_params = 0, parameter* params = nullptr):
|
||||
ext_theory_simple_justification(fid, r, num_lits, lits, num_eqs, eqs, num_params, params),
|
||||
m_consequent(consequent) {}
|
||||
|
||||
virtual proof * mk_proof(conflict_resolution & cr);
|
||||
proof * mk_proof(conflict_resolution & cr) override;
|
||||
|
||||
virtual char const * get_name() const { return "ext-theory-propagation"; }
|
||||
char const * get_name() const override { return "ext-theory-propagation"; }
|
||||
};
|
||||
|
||||
class ext_theory_conflict_justification : public ext_theory_simple_justification {
|
||||
public:
|
||||
ext_theory_conflict_justification(family_id fid, region & r, unsigned num_lits, literal const * lits,
|
||||
unsigned num_eqs, enode_pair const * eqs,
|
||||
unsigned num_params = 0, parameter* params = 0):
|
||||
unsigned num_params = 0, parameter* params = nullptr):
|
||||
ext_theory_simple_justification(fid, r, num_lits, lits, num_eqs, eqs, num_params, params) {}
|
||||
|
||||
virtual proof * mk_proof(conflict_resolution & cr);
|
||||
proof * mk_proof(conflict_resolution & cr) override;
|
||||
|
||||
virtual char const * get_name() const { return "ext-theory-conflict"; }
|
||||
char const * get_name() const override { return "ext-theory-conflict"; }
|
||||
};
|
||||
|
||||
class ext_theory_eq_propagation_justification : public ext_theory_simple_justification {
|
||||
|
@ -371,12 +371,12 @@ namespace smt {
|
|||
unsigned num_lits, literal const * lits,
|
||||
unsigned num_eqs, enode_pair const * eqs,
|
||||
enode * lhs, enode * rhs,
|
||||
unsigned num_params = 0, parameter* params = 0):
|
||||
unsigned num_params = 0, parameter* params = nullptr):
|
||||
ext_theory_simple_justification(fid, r, num_lits, lits, num_eqs, eqs, num_params, params), m_lhs(lhs), m_rhs(rhs) {}
|
||||
|
||||
virtual proof * mk_proof(conflict_resolution & cr);
|
||||
proof * mk_proof(conflict_resolution & cr) override;
|
||||
|
||||
virtual char const * get_name() const { return "ext-theory-eq-propagation"; }
|
||||
char const * get_name() const override { return "ext-theory-eq-propagation"; }
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -392,21 +392,21 @@ namespace smt {
|
|||
|
||||
public:
|
||||
theory_lemma_justification(family_id fid, context & ctx, unsigned num_lits, literal const * lits,
|
||||
unsigned num_params = 0, parameter* params = 0);
|
||||
unsigned num_params = 0, parameter* params = nullptr);
|
||||
|
||||
virtual ~theory_lemma_justification();
|
||||
~theory_lemma_justification() override;
|
||||
|
||||
virtual bool has_del_eh() const {
|
||||
bool has_del_eh() const override {
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual void del_eh(ast_manager & m);
|
||||
void del_eh(ast_manager & m) override;
|
||||
|
||||
virtual void get_antecedents(conflict_resolution & cr) {}
|
||||
void get_antecedents(conflict_resolution & cr) override {}
|
||||
|
||||
virtual proof * mk_proof(conflict_resolution & cr);
|
||||
proof * mk_proof(conflict_resolution & cr) override;
|
||||
|
||||
virtual char const * get_name() const { return "theory-lemma"; }
|
||||
char const * get_name() const override { return "theory-lemma"; }
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
@ -123,7 +123,6 @@ namespace smt {
|
|||
return m_kernel.preferred_sat(asms, cores);
|
||||
}
|
||||
|
||||
|
||||
lbool find_mutexes(expr_ref_vector const& vars, vector<expr_ref_vector>& mutexes) {
|
||||
return m_kernel.find_mutexes(vars, mutexes);
|
||||
}
|
||||
|
@ -196,9 +195,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
void updt_params(params_ref const & p) {
|
||||
// We don't need params2smt_params anymore. smt_params has support for reading params_ref.
|
||||
// The update is performed at smt_kernel "users".
|
||||
// params2smt_params(p, fparams());
|
||||
m_kernel.updt_params(p);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -218,7 +215,6 @@ namespace smt {
|
|||
imp::copy(*src.m_imp, *dst.m_imp);
|
||||
}
|
||||
|
||||
|
||||
bool kernel::set_logic(symbol logic) {
|
||||
return m_imp->set_logic(logic);
|
||||
}
|
||||
|
@ -263,9 +259,9 @@ namespace smt {
|
|||
}
|
||||
|
||||
void kernel::reset() {
|
||||
ast_manager & _m = m();
|
||||
ast_manager & _m = m();
|
||||
smt_params & fps = m_imp->fparams();
|
||||
params_ref ps = m_imp->params();
|
||||
params_ref ps = m_imp->params();
|
||||
#pragma omp critical (smt_kernel)
|
||||
{
|
||||
m_imp->~imp();
|
||||
|
|
|
@ -126,7 +126,7 @@ namespace smt {
|
|||
/**
|
||||
\brief Satisfiability check.
|
||||
*/
|
||||
lbool check(unsigned num_assumptions = 0, expr * const * assumptions = 0);
|
||||
lbool check(unsigned num_assumptions = 0, expr * const * assumptions = nullptr);
|
||||
|
||||
lbool check(expr_ref_vector const& asms) { return check(asms.size(), asms.c_ptr()); }
|
||||
|
||||
|
|
|
@ -33,19 +33,19 @@ namespace smt {
|
|||
m(m),
|
||||
m_params(p),
|
||||
m_autil(m),
|
||||
m_qm(0),
|
||||
m_context(0),
|
||||
m_root2value(0),
|
||||
m_qm(nullptr),
|
||||
m_context(nullptr),
|
||||
m_root2value(nullptr),
|
||||
m_model_finder(mf),
|
||||
m_max_cexs(1),
|
||||
m_iteration_idx(0),
|
||||
m_curr_model(0),
|
||||
m_curr_model(nullptr),
|
||||
m_pinned_exprs(m) {
|
||||
}
|
||||
|
||||
model_checker::~model_checker() {
|
||||
m_aux_context = 0; // delete aux context before fparams
|
||||
m_fparams = 0;
|
||||
m_aux_context = nullptr; // delete aux context before fparams
|
||||
m_fparams = nullptr;
|
||||
}
|
||||
|
||||
quantifier * model_checker::get_flat_quantifier(quantifier * q) {
|
||||
|
@ -72,7 +72,7 @@ namespace smt {
|
|||
m_value2expr.insert(val, n->get_owner());
|
||||
}
|
||||
}
|
||||
expr * t = 0;
|
||||
expr * t = nullptr;
|
||||
m_value2expr.find(val, t);
|
||||
return t;
|
||||
}
|
||||
|
@ -111,10 +111,10 @@ namespace smt {
|
|||
ptr_buffer<expr> subst_args;
|
||||
unsigned num_decls = q->get_num_decls();
|
||||
subst_args.resize(num_decls, 0);
|
||||
sks.resize(num_decls, 0);
|
||||
sks.resize(num_decls, nullptr);
|
||||
for (unsigned i = 0; i < num_decls; i++) {
|
||||
sort * s = q->get_decl_sort(num_decls - i - 1);
|
||||
expr * sk = m.mk_fresh_const(0, s);
|
||||
expr * sk = m.mk_fresh_const(nullptr, s);
|
||||
sks[num_decls - i - 1] = sk;
|
||||
subst_args[num_decls - i - 1] = sk;
|
||||
if (m_curr_model->is_finite(s)) {
|
||||
|
@ -132,7 +132,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
bool model_checker::add_instance(quantifier * q, model * cex, expr_ref_vector & sks, bool use_inv) {
|
||||
if (cex == 0) {
|
||||
if (cex == nullptr) {
|
||||
TRACE("model_checker", tout << "no model is available\n";);
|
||||
return false;
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ namespace smt {
|
|||
if (use_inv) {
|
||||
unsigned sk_term_gen;
|
||||
expr * sk_term = m_model_finder.get_inv(q, i, sk_value, sk_term_gen);
|
||||
if (sk_term != 0) {
|
||||
if (sk_term != nullptr) {
|
||||
TRACE("model_checker", tout << "Found inverse " << mk_pp(sk_term, m) << "\n";);
|
||||
SASSERT(!m.is_model_value(sk_term));
|
||||
if (sk_term_gen > max_generation)
|
||||
|
@ -172,7 +172,7 @@ namespace smt {
|
|||
}
|
||||
else {
|
||||
expr * sk_term = get_term_from_ctx(sk_value);
|
||||
if (sk_term != 0) {
|
||||
if (sk_term != nullptr) {
|
||||
sk_value = sk_term;
|
||||
}
|
||||
}
|
||||
|
@ -323,7 +323,7 @@ namespace smt {
|
|||
bool is_undef = false;
|
||||
expr_ref_vector args(m);
|
||||
unsigned num_decls = q->get_num_decls();
|
||||
args.resize(num_decls, 0);
|
||||
args.resize(num_decls, nullptr);
|
||||
var_subst sub(m);
|
||||
expr_ref tmp(m), result(m);
|
||||
for (; it != end; ++it) {
|
||||
|
@ -502,7 +502,7 @@ namespace smt {
|
|||
expr_ref inst_expr(m);
|
||||
instantiate(m, q, inst->m_bindings, inst_expr);
|
||||
tout << "(assert " << mk_ismt2_pp(inst_expr, m) << ")\n";);
|
||||
m_context->add_instance(q, 0, num_decls, bindings.c_ptr(), gen, gen, gen, dummy);
|
||||
m_context->add_instance(q, nullptr, num_decls, bindings.c_ptr(), gen, gen, gen, dummy);
|
||||
TRACE("model_checker_bug_detail", tout << "after instantiating, inconsistent: " << m_context->inconsistent() << "\n";);
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -29,10 +29,10 @@ namespace smt {
|
|||
|
||||
model_generator::model_generator(ast_manager & m):
|
||||
m_manager(m),
|
||||
m_context(0),
|
||||
m_context(nullptr),
|
||||
m_fresh_idx(1),
|
||||
m_asts(m_manager),
|
||||
m_model(0) {
|
||||
m_model(nullptr) {
|
||||
}
|
||||
|
||||
model_generator::~model_generator() {
|
||||
|
@ -44,7 +44,7 @@ namespace smt {
|
|||
m_fresh_idx = 1;
|
||||
m_root2value.reset();
|
||||
m_asts.reset();
|
||||
m_model = 0;
|
||||
m_model = nullptr;
|
||||
}
|
||||
|
||||
void model_generator::init_model() {
|
||||
|
@ -89,7 +89,7 @@ namespace smt {
|
|||
if (r == r->get_root() && m_context->is_relevant(r)) {
|
||||
roots.push_back(r);
|
||||
sort * s = m_manager.get_sort(r->get_owner());
|
||||
model_value_proc * proc = 0;
|
||||
model_value_proc * proc = nullptr;
|
||||
if (m_manager.is_bool(s)) {
|
||||
CTRACE("model", m_context->get_assignment(r) == l_undef,
|
||||
tout << mk_pp(r->get_owner(), m_manager) << "\n";);
|
||||
|
@ -177,7 +177,7 @@ namespace smt {
|
|||
if (m_manager.get_sort(r->get_owner()) != s)
|
||||
continue;
|
||||
SASSERT(r == r->get_root());
|
||||
model_value_proc * proc = 0;
|
||||
model_value_proc * proc = nullptr;
|
||||
root2proc.find(r, proc);
|
||||
SASSERT(proc);
|
||||
if (proc->is_fresh())
|
||||
|
@ -196,7 +196,7 @@ namespace smt {
|
|||
enode * n = src.get_enode();
|
||||
SASSERT(n == n->get_root());
|
||||
bool visited = true;
|
||||
model_value_proc * proc = 0;
|
||||
model_value_proc * proc = nullptr;
|
||||
root2proc.find(n, proc);
|
||||
SASSERT(proc);
|
||||
buffer<model_value_dependency> dependencies;
|
||||
|
@ -283,7 +283,7 @@ namespace smt {
|
|||
sz = roots.size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
enode * r = roots[i];
|
||||
model_value_proc * proc = 0;
|
||||
model_value_proc * proc = nullptr;
|
||||
root2proc.find(r, proc);
|
||||
SASSERT(proc);
|
||||
if (!proc->is_fresh())
|
||||
|
@ -345,7 +345,7 @@ namespace smt {
|
|||
TRACE("mg_top_sort", tout << "#" << n->get_owner_id() << "\n";);
|
||||
dependencies.reset();
|
||||
dependency_values.reset();
|
||||
model_value_proc * proc = 0;
|
||||
model_value_proc * proc = nullptr;
|
||||
VERIFY(root2proc.find(n, proc));
|
||||
SASSERT(proc);
|
||||
proc->get_dependencies(dependencies);
|
||||
|
@ -364,7 +364,7 @@ namespace smt {
|
|||
enode * child = d.get_enode();
|
||||
TRACE("mg_top_sort", tout << "#" << n->get_owner_id() << " (" << mk_pp(n->get_owner(), m_manager) << "): " << mk_pp(child->get_owner(), m_manager) << " " << mk_pp(child->get_root()->get_owner(), m_manager) << "\n";);
|
||||
child = child->get_root();
|
||||
app * val = 0;
|
||||
app * val = nullptr;
|
||||
m_root2value.find(child, val);
|
||||
SASSERT(val);
|
||||
dependency_values.push_back(val);
|
||||
|
@ -395,7 +395,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
app * model_generator::get_value(enode * n) const {
|
||||
app * val = 0;
|
||||
app * val = nullptr;
|
||||
m_root2value.find(n->get_root(), val);
|
||||
SASSERT(val);
|
||||
return val;
|
||||
|
@ -438,7 +438,7 @@ namespace smt {
|
|||
args.push_back(arg);
|
||||
}
|
||||
func_interp * fi = m_model->get_func_interp(f);
|
||||
if (fi == 0) {
|
||||
if (fi == nullptr) {
|
||||
fi = alloc(func_interp, m_manager, f->get_arity());
|
||||
m_model->register_decl(f, fi);
|
||||
}
|
||||
|
@ -454,7 +454,7 @@ namespace smt {
|
|||
tout << "value: #" << n->get_owner_id() << "\n" << mk_ismt2_pp(result, m_manager) << "\n";);
|
||||
if (m_context->get_last_search_failure() == smt::THEORY) {
|
||||
// if the theory solvers are incomplete, then we cannot assume the e-graph is close under congruence
|
||||
if (fi->get_entry(args.c_ptr()) == 0)
|
||||
if (fi->get_entry(args.c_ptr()) == nullptr)
|
||||
fi->insert_new_entry(args.c_ptr(), result);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -80,7 +80,7 @@ namespace smt {
|
|||
unsigned m_idx;
|
||||
expr * m_value;
|
||||
public:
|
||||
extra_fresh_value(sort * s, unsigned idx):m_sort(s), m_idx(idx), m_value(0) {}
|
||||
extra_fresh_value(sort * s, unsigned idx):m_sort(s), m_idx(idx), m_value(nullptr) {}
|
||||
sort * get_sort() const { return m_sort; }
|
||||
unsigned get_idx() const { return m_idx; }
|
||||
void set_value(expr * n) { SASSERT(m_value == 0); m_value = n; }
|
||||
|
@ -100,7 +100,7 @@ namespace smt {
|
|||
extra_fresh_value * m_value; //!< When m_fresh == true, contains the sort of the fresh value
|
||||
};
|
||||
public:
|
||||
model_value_dependency():m_fresh(true), m_value(0) {}
|
||||
model_value_dependency():m_fresh(true), m_value(nullptr) {}
|
||||
model_value_dependency(enode * n):m_fresh(false), m_enode(n->get_root()) {}
|
||||
model_value_dependency(extra_fresh_value * v):m_fresh(true), m_value(v) {}
|
||||
bool is_fresh_value() const { return m_fresh; }
|
||||
|
@ -159,16 +159,16 @@ namespace smt {
|
|||
app * m_value;
|
||||
public:
|
||||
expr_wrapper_proc(app * v):m_value(v) {}
|
||||
virtual app * mk_value(model_generator & m, ptr_vector<expr> & values) { return m_value; }
|
||||
app * mk_value(model_generator & m, ptr_vector<expr> & values) override { return m_value; }
|
||||
};
|
||||
|
||||
class fresh_value_proc : public model_value_proc {
|
||||
extra_fresh_value * m_value;
|
||||
public:
|
||||
fresh_value_proc(extra_fresh_value * v):m_value(v) {}
|
||||
virtual void get_dependencies(buffer<model_value_dependency> & result) { result.push_back(m_value); }
|
||||
virtual app * mk_value(model_generator & m, ptr_vector<expr> & values) { return to_app(values[0]); }
|
||||
virtual bool is_fresh() const { return true; }
|
||||
void get_dependencies(buffer<model_value_dependency> & result) override { result.push_back(m_value); }
|
||||
app * mk_value(model_generator & m, ptr_vector<expr> & values) override { return to_app(values[0]); }
|
||||
bool is_fresh() const override { return true; }
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -143,7 +143,7 @@ namespace smt {
|
|||
tout << "inserted: " << (f != 0) << "\n";
|
||||
);
|
||||
|
||||
return f != 0;
|
||||
return f != nullptr;
|
||||
}
|
||||
|
||||
void init_search_eh() {
|
||||
|
@ -300,7 +300,7 @@ namespace smt {
|
|||
|
||||
bool quantifier_manager::add_instance(quantifier * q, unsigned num_bindings, enode * const * bindings, unsigned generation) {
|
||||
ptr_vector<enode> tmp;
|
||||
return add_instance(q, 0, num_bindings, bindings, generation, generation, generation, tmp);
|
||||
return add_instance(q, nullptr, num_bindings, bindings, generation, generation, generation, tmp);
|
||||
}
|
||||
|
||||
void quantifier_manager::init_search_eh() {
|
||||
|
@ -408,17 +408,17 @@ namespace smt {
|
|||
bool m_active;
|
||||
public:
|
||||
default_qm_plugin():
|
||||
m_qm(0),
|
||||
m_context(0),
|
||||
m_qm(nullptr),
|
||||
m_context(nullptr),
|
||||
m_new_enode_qhead(0),
|
||||
m_lazy_matching_idx(0),
|
||||
m_active(false) {
|
||||
}
|
||||
|
||||
virtual ~default_qm_plugin() {
|
||||
~default_qm_plugin() override {
|
||||
}
|
||||
|
||||
virtual void set_manager(quantifier_manager & qm) {
|
||||
void set_manager(quantifier_manager & qm) override {
|
||||
SASSERT(m_qm == 0);
|
||||
m_qm = &qm;
|
||||
m_context = &(qm.get_context());
|
||||
|
@ -434,11 +434,11 @@ namespace smt {
|
|||
m_model_checker->set_qm(qm);
|
||||
}
|
||||
|
||||
virtual quantifier_manager_plugin * mk_fresh() { return alloc(default_qm_plugin); }
|
||||
quantifier_manager_plugin * mk_fresh() override { return alloc(default_qm_plugin); }
|
||||
|
||||
virtual bool model_based() const { return m_fparams->m_mbqi; }
|
||||
bool model_based() const override { return m_fparams->m_mbqi; }
|
||||
|
||||
virtual bool mbqi_enabled(quantifier *q) const {
|
||||
bool mbqi_enabled(quantifier *q) const override {
|
||||
if (!m_fparams->m_mbqi_id) return true;
|
||||
const symbol &s = q->get_qid();
|
||||
size_t len = strlen(m_fparams->m_mbqi_id);
|
||||
|
@ -450,16 +450,16 @@ namespace smt {
|
|||
/* Quantifier id's must begin with the prefix specified by parameter
|
||||
mbqi.id to be instantiated with MBQI. The default value is the
|
||||
empty string, so all quantifiers are instantiated. */
|
||||
virtual void add(quantifier * q) {
|
||||
void add(quantifier * q) override {
|
||||
if (m_fparams->m_mbqi && mbqi_enabled(q)) {
|
||||
m_active = true;
|
||||
m_model_finder->register_quantifier(q);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void del(quantifier * q) { }
|
||||
void del(quantifier * q) override { }
|
||||
|
||||
virtual void push() {
|
||||
void push() override {
|
||||
m_mam->push_scope();
|
||||
m_lazy_mam->push_scope();
|
||||
if (m_fparams->m_mbqi) {
|
||||
|
@ -467,7 +467,7 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
|
||||
virtual void pop(unsigned num_scopes) {
|
||||
void pop(unsigned num_scopes) override {
|
||||
m_mam->pop_scope(num_scopes);
|
||||
m_lazy_mam->pop_scope(num_scopes);
|
||||
if (m_fparams->m_mbqi) {
|
||||
|
@ -475,7 +475,7 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
|
||||
virtual void init_search_eh() {
|
||||
void init_search_eh() override {
|
||||
m_lazy_matching_idx = 0;
|
||||
if (m_fparams->m_mbqi) {
|
||||
m_model_finder->init_search_eh();
|
||||
|
@ -483,7 +483,7 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
|
||||
virtual void assign_eh(quantifier * q) {
|
||||
void assign_eh(quantifier * q) override {
|
||||
m_active = true;
|
||||
ast_manager& m = m_context->get_manager();
|
||||
if (!m_fparams->m_ematching) {
|
||||
|
@ -531,23 +531,23 @@ namespace smt {
|
|||
return m_fparams->m_ematching && !m_qm->empty();
|
||||
}
|
||||
|
||||
virtual void add_eq_eh(enode * e1, enode * e2) {
|
||||
void add_eq_eh(enode * e1, enode * e2) override {
|
||||
if (use_ematching())
|
||||
m_mam->add_eq_eh(e1, e2);
|
||||
}
|
||||
|
||||
virtual void relevant_eh(enode * e) {
|
||||
void relevant_eh(enode * e) override {
|
||||
if (use_ematching()) {
|
||||
m_mam->relevant_eh(e, false);
|
||||
m_lazy_mam->relevant_eh(e, true);
|
||||
}
|
||||
}
|
||||
|
||||
virtual bool can_propagate() const {
|
||||
bool can_propagate() const override {
|
||||
return m_mam->has_work();
|
||||
}
|
||||
|
||||
virtual void restart_eh() {
|
||||
void restart_eh() override {
|
||||
if (m_fparams->m_mbqi) {
|
||||
m_model_finder->restart_eh();
|
||||
m_model_checker->restart_eh();
|
||||
|
@ -555,17 +555,17 @@ namespace smt {
|
|||
TRACE("mam_stats", m_mam->display(tout););
|
||||
}
|
||||
|
||||
virtual bool is_shared(enode * n) const {
|
||||
bool is_shared(enode * n) const override {
|
||||
return m_active && (m_mam->is_shared(n) || m_lazy_mam->is_shared(n));
|
||||
}
|
||||
|
||||
virtual void adjust_model(proto_model * m) {
|
||||
void adjust_model(proto_model * m) override {
|
||||
if (m_fparams->m_mbqi) {
|
||||
m_model_finder->fix_model(m);
|
||||
}
|
||||
}
|
||||
|
||||
virtual void propagate() {
|
||||
void propagate() override {
|
||||
m_mam->match();
|
||||
if (!m_context->relevancy() && use_ematching()) {
|
||||
ptr_vector<enode>::const_iterator it = m_context->begin_enodes();
|
||||
|
@ -585,8 +585,8 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
|
||||
virtual quantifier_manager::check_model_result
|
||||
check_model(proto_model * m, obj_map<enode, app *> const & root2value) {
|
||||
quantifier_manager::check_model_result
|
||||
check_model(proto_model * m, obj_map<enode, app *> const & root2value) override {
|
||||
if (m_fparams->m_mbqi) {
|
||||
IF_VERBOSE(10, verbose_stream() << "(smt.mbqi)\n";);
|
||||
if (m_model_checker->check(m, root2value)) {
|
||||
|
@ -599,7 +599,7 @@ namespace smt {
|
|||
return quantifier_manager::UNKNOWN;
|
||||
}
|
||||
|
||||
virtual final_check_status final_check_eh(bool full) {
|
||||
final_check_status final_check_eh(bool full) override {
|
||||
if (!full) {
|
||||
if (m_fparams->m_qi_lazy_instantiation)
|
||||
return final_check_quant();
|
||||
|
|
|
@ -152,7 +152,7 @@ namespace smt {
|
|||
virtual bool mbqi_enabled(quantifier *q) const {return true;}
|
||||
|
||||
/**
|
||||
\brief Give a change to the plugin to adjust the interpretation of unintepreted functions.
|
||||
\brief Give a change to the plugin to adjust the interpretation of uninterpreted functions.
|
||||
It can basically change the "else" of each uninterpreted function.
|
||||
*/
|
||||
virtual void adjust_model(proto_model * m) = 0;
|
||||
|
|
|
@ -119,7 +119,7 @@ namespace smt {
|
|||
expr * m_expr;
|
||||
unsigned m_depth:31;
|
||||
bool m_depth_only:1; //!< track only the depth of this entry.
|
||||
entry():m_expr(0), m_depth(0), m_depth_only(false) {}
|
||||
entry():m_expr(nullptr), m_depth(0), m_depth_only(false) {}
|
||||
entry(expr * n, unsigned depth = 0, bool depth_only = false):m_expr(n), m_depth(depth), m_depth_only(depth_only) {}
|
||||
};
|
||||
ast_manager & m_manager;
|
||||
|
|
|
@ -108,7 +108,7 @@ namespace smt {
|
|||
if (n->get_family_id() != m_manager.get_basic_family_id())
|
||||
collect(arg, n->get_decl(), j);
|
||||
else
|
||||
collect(arg, 0, 0);
|
||||
collect(arg, nullptr, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -157,7 +157,7 @@ namespace smt {
|
|||
flet<bool> l(m_conservative, conservative);
|
||||
init(q);
|
||||
TRACE("collector", tout << "model checking: #" << q->get_id() << "\n" << mk_pp(q, m_manager) << "\n";);
|
||||
collect(q->get_expr(), 0, 0);
|
||||
collect(q->get_expr(), nullptr, 0);
|
||||
save_result(candidates);
|
||||
}
|
||||
|
||||
|
@ -251,7 +251,7 @@ namespace smt {
|
|||
TRACE("quick_checker_sizes", tout << "found new candidate\n";
|
||||
for (unsigned i = 0; i < m_num_bindings; i++) tout << "#" << m_bindings[i]->get_owner_id() << " "; tout << "\n";);
|
||||
unsigned max_generation = get_max_generation(m_num_bindings, m_bindings.c_ptr());
|
||||
if (m_context.add_instance(q, 0 /* no pattern was used */, m_num_bindings, m_bindings.c_ptr(), max_generation,
|
||||
if (m_context.add_instance(q, nullptr /* no pattern was used */, m_num_bindings, m_bindings.c_ptr(), max_generation,
|
||||
0, // min_top_generation is only available for instances created by the MAM
|
||||
0, // max_top_generation is only available for instances created by the MAM
|
||||
empty_used_enodes))
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace smt {
|
|||
expr * m_expr;
|
||||
func_decl * m_parent;
|
||||
unsigned m_parent_pos;
|
||||
entry(expr * n = 0, func_decl * d = 0, unsigned p = 0):m_expr(n), m_parent(d), m_parent_pos(p) {}
|
||||
entry(expr * n = nullptr, func_decl * d = nullptr, unsigned p = 0):m_expr(n), m_parent(d), m_parent_pos(p) {}
|
||||
unsigned hash() const { return m_parent ? mk_mix(m_expr->get_id(), m_parent->get_id(), m_parent_pos) : m_expr->get_id(); }
|
||||
bool operator==(entry const & e) const { return m_expr == e.m_expr && m_parent == e.m_parent && m_parent_pos == e.m_parent_pos; }
|
||||
};
|
||||
|
|
|
@ -52,24 +52,24 @@ namespace smt {
|
|||
app * m_parent;
|
||||
public:
|
||||
and_relevancy_eh(app * p):m_parent(p) {}
|
||||
virtual ~and_relevancy_eh() {}
|
||||
virtual void operator()(relevancy_propagator & rp);
|
||||
~and_relevancy_eh() override {}
|
||||
void operator()(relevancy_propagator & rp) override;
|
||||
};
|
||||
|
||||
class or_relevancy_eh : public relevancy_eh {
|
||||
app * m_parent;
|
||||
public:
|
||||
or_relevancy_eh(app * p):m_parent(p) {}
|
||||
virtual ~or_relevancy_eh() {}
|
||||
virtual void operator()(relevancy_propagator & rp);
|
||||
~or_relevancy_eh() override {}
|
||||
void operator()(relevancy_propagator & rp) override;
|
||||
};
|
||||
|
||||
class ite_relevancy_eh : public relevancy_eh {
|
||||
app * m_parent;
|
||||
public:
|
||||
ite_relevancy_eh(app * p):m_parent(p) {}
|
||||
virtual ~ite_relevancy_eh() {}
|
||||
virtual void operator()(relevancy_propagator & rp);
|
||||
~ite_relevancy_eh() override {}
|
||||
void operator()(relevancy_propagator & rp) override;
|
||||
};
|
||||
|
||||
class ite_term_relevancy_eh : public relevancy_eh {
|
||||
|
@ -78,8 +78,8 @@ namespace smt {
|
|||
app * m_else_eq;
|
||||
public:
|
||||
ite_term_relevancy_eh(app * p, app * then_eq, app * else_eq):m_parent(p), m_then_eq(then_eq), m_else_eq(else_eq) {}
|
||||
virtual ~ite_term_relevancy_eh() {}
|
||||
virtual void operator()(relevancy_propagator & rp);
|
||||
~ite_term_relevancy_eh() override {}
|
||||
void operator()(relevancy_propagator & rp) override;
|
||||
};
|
||||
|
||||
relevancy_propagator::relevancy_propagator(context & ctx):
|
||||
|
@ -154,33 +154,33 @@ namespace smt {
|
|||
relevancy_propagator(ctx), m_qhead(0), m_relevant_exprs(ctx.get_manager()),
|
||||
m_propagating(false) {}
|
||||
|
||||
virtual ~relevancy_propagator_imp() {
|
||||
~relevancy_propagator_imp() override {
|
||||
undo_trail(0);
|
||||
}
|
||||
|
||||
relevancy_ehs * get_handlers(expr * n) {
|
||||
relevancy_ehs * r = 0;
|
||||
relevancy_ehs * r = nullptr;
|
||||
m_relevant_ehs.find(n, r);
|
||||
SASSERT(m_relevant_ehs.contains(n) || r == 0);
|
||||
return r;
|
||||
}
|
||||
|
||||
void set_handlers(expr * n, relevancy_ehs * ehs) {
|
||||
if (ehs == 0)
|
||||
if (ehs == nullptr)
|
||||
m_relevant_ehs.erase(n);
|
||||
else
|
||||
m_relevant_ehs.insert(n, ehs);
|
||||
}
|
||||
|
||||
relevancy_ehs * get_watches(expr * n, bool val) {
|
||||
relevancy_ehs * r = 0;
|
||||
relevancy_ehs * r = nullptr;
|
||||
m_watches[val ? 1 : 0].find(n, r);
|
||||
SASSERT(m_watches[val ? 1 : 0].contains(n) || r == 0);
|
||||
return r;
|
||||
}
|
||||
|
||||
void set_watches(expr * n, bool val, relevancy_ehs * ehs) {
|
||||
if (ehs == 0)
|
||||
if (ehs == nullptr)
|
||||
m_watches[val ? 1 : 0].erase(n);
|
||||
else
|
||||
m_watches[val ? 1 : 0].insert(n, ehs);
|
||||
|
@ -191,7 +191,7 @@ namespace smt {
|
|||
m_trail.push_back(t);
|
||||
}
|
||||
|
||||
virtual void add_handler(expr * source, relevancy_eh * eh) {
|
||||
void add_handler(expr * source, relevancy_eh * eh) override {
|
||||
if (!enabled())
|
||||
return;
|
||||
if (is_relevant_core(source)) {
|
||||
|
@ -204,7 +204,7 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
|
||||
virtual void add_watch(expr * n, bool val, relevancy_eh * eh) {
|
||||
void add_watch(expr * n, bool val, relevancy_eh * eh) override {
|
||||
if (!enabled())
|
||||
return;
|
||||
lbool lval = m_context.find_assignment(n);
|
||||
|
@ -224,7 +224,7 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
|
||||
virtual void add_watch(expr * n, bool val, expr * target) {
|
||||
void add_watch(expr * n, bool val, expr * target) override {
|
||||
if (!enabled())
|
||||
return;
|
||||
lbool lval = m_context.find_assignment(n);
|
||||
|
@ -244,18 +244,18 @@ namespace smt {
|
|||
|
||||
bool is_relevant_core(expr * n) const { return m_is_relevant.contains(n); }
|
||||
|
||||
virtual bool is_relevant(expr * n) const {
|
||||
bool is_relevant(expr * n) const override {
|
||||
return !enabled() || is_relevant_core(n);
|
||||
}
|
||||
|
||||
virtual void push() {
|
||||
void push() override {
|
||||
m_scopes.push_back(scope());
|
||||
scope & s = m_scopes.back();
|
||||
s.m_relevant_exprs_lim = m_relevant_exprs.size();
|
||||
s.m_trail_lim = m_trail.size();
|
||||
}
|
||||
|
||||
virtual void pop(unsigned num_scopes) {
|
||||
void pop(unsigned num_scopes) override {
|
||||
SASSERT(m_context.get_scope_level() == m_scopes.size());
|
||||
unsigned lvl = m_scopes.size();
|
||||
SASSERT(num_scopes <= lvl);
|
||||
|
@ -325,12 +325,12 @@ namespace smt {
|
|||
\brief Mark the given expression as relevant if it is not
|
||||
already marked.
|
||||
*/
|
||||
virtual void mark_as_relevant(expr * n) {
|
||||
void mark_as_relevant(expr * n) override {
|
||||
if (!enabled())
|
||||
return;
|
||||
if (!is_relevant_core(n)) {
|
||||
enode * e = m_context.find_enode(n);
|
||||
if (e != 0) {
|
||||
if (e != nullptr) {
|
||||
enode * curr = e;
|
||||
do {
|
||||
set_relevant(curr->get_owner());
|
||||
|
@ -376,7 +376,7 @@ namespace smt {
|
|||
case l_undef:
|
||||
break;
|
||||
case l_true: {
|
||||
expr * true_arg = 0;
|
||||
expr * true_arg = nullptr;
|
||||
unsigned num_args = n->get_num_args();
|
||||
for (unsigned i = 0; i < num_args; i++) {
|
||||
expr * arg = n->get_arg(i);
|
||||
|
@ -400,7 +400,7 @@ namespace smt {
|
|||
lbool val = m_context.find_assignment(n);
|
||||
switch (val) {
|
||||
case l_false: {
|
||||
expr * false_arg = 0;
|
||||
expr * false_arg = nullptr;
|
||||
unsigned num_args = n->get_num_args();
|
||||
for (unsigned i = 0; i < num_args; i++) {
|
||||
expr * arg = n->get_arg(i);
|
||||
|
@ -450,7 +450,7 @@ namespace smt {
|
|||
[m_qhead, m_relevant_exprs.size()) in the stack of
|
||||
relevant expressions.
|
||||
*/
|
||||
virtual void propagate() {
|
||||
void propagate() override {
|
||||
if (m_propagating) {
|
||||
return;
|
||||
}
|
||||
|
@ -487,18 +487,18 @@ namespace smt {
|
|||
}
|
||||
|
||||
relevancy_ehs * ehs = get_handlers(n);
|
||||
while (ehs != 0) {
|
||||
while (ehs != nullptr) {
|
||||
ehs->head()->operator()(*this, n);
|
||||
ehs = ehs->tail();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
virtual bool can_propagate() const {
|
||||
bool can_propagate() const override {
|
||||
return m_qhead < m_relevant_exprs.size();
|
||||
}
|
||||
|
||||
virtual void assign_eh(expr * n, bool val) {
|
||||
void assign_eh(expr * n, bool val) override {
|
||||
if (!enabled())
|
||||
return;
|
||||
ast_manager & m = get_manager();
|
||||
|
@ -510,13 +510,13 @@ namespace smt {
|
|||
propagate_relevant_and(to_app(n));
|
||||
}
|
||||
relevancy_ehs * ehs = get_watches(n, val);
|
||||
while (ehs != 0) {
|
||||
while (ehs != nullptr) {
|
||||
ehs->head()->operator()(*this, n, val);
|
||||
ehs = ehs->tail();
|
||||
}
|
||||
}
|
||||
|
||||
virtual void display(std::ostream & out) const {
|
||||
void display(std::ostream & out) const override {
|
||||
if (enabled() && !m_relevant_exprs.empty()) {
|
||||
out << "relevant exprs:\n";
|
||||
for (unsigned i = 0; i < m_relevant_exprs.size(); i++) {
|
||||
|
@ -527,7 +527,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
#ifdef Z3DEBUG
|
||||
bool check_relevancy_app(app * n) const {
|
||||
bool check_relevancy_app(app * n) const {
|
||||
SASSERT(is_relevant(n));
|
||||
unsigned num_args = n->get_num_args();
|
||||
for (unsigned i = 0; i < num_args; i++) {
|
||||
|
@ -537,7 +537,7 @@ namespace smt {
|
|||
return true;
|
||||
}
|
||||
|
||||
virtual bool check_relevancy_or(app * n, bool root) const {
|
||||
bool check_relevancy_or(app * n, bool root) const override {
|
||||
lbool val = root ? l_true : m_context.find_assignment(n);
|
||||
if (val == l_false)
|
||||
return check_relevancy_app(n);
|
||||
|
@ -600,7 +600,7 @@ namespace smt {
|
|||
return true;
|
||||
}
|
||||
|
||||
bool check_relevancy(expr_ref_vector const & v) const {
|
||||
bool check_relevancy(expr_ref_vector const & v) const override {
|
||||
SASSERT(!can_propagate());
|
||||
ast_manager & m = get_manager();
|
||||
unsigned sz = v.size();
|
||||
|
|
|
@ -50,8 +50,8 @@ namespace smt {
|
|||
expr * m_target;
|
||||
public:
|
||||
simple_relevancy_eh(expr * t):m_target(t) {}
|
||||
virtual ~simple_relevancy_eh() {}
|
||||
virtual void operator()(relevancy_propagator & rp);
|
||||
~simple_relevancy_eh() override {}
|
||||
void operator()(relevancy_propagator & rp) override;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -63,8 +63,8 @@ namespace smt {
|
|||
expr * m_target;
|
||||
public:
|
||||
pair_relevancy_eh(expr * s1, expr * s2, expr * t):m_source1(s1), m_source2(s2), m_target(t) {}
|
||||
virtual ~pair_relevancy_eh() {}
|
||||
virtual void operator()(relevancy_propagator & rp);
|
||||
~pair_relevancy_eh() override {}
|
||||
void operator()(relevancy_propagator & rp) override;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -507,7 +507,7 @@ namespace smt {
|
|||
m_params.m_nnf_cnf = false;
|
||||
if (st.m_max_ite_tree_depth > 50) {
|
||||
m_params.m_arith_eq2ineq = false;
|
||||
m_params.m_pull_cheap_ite_trees = true;
|
||||
m_params.m_pull_cheap_ite = true;
|
||||
m_params.m_arith_propagate_eqs = true;
|
||||
m_params.m_relevancy_lvl = 2;
|
||||
m_params.m_relevancy_lemma = false;
|
||||
|
@ -968,7 +968,7 @@ namespace smt {
|
|||
if (st.num_theories() == 2 && st.has_uf() && is_arith(st)) {
|
||||
if (!st.m_has_real)
|
||||
setup_QF_UFLIA(st);
|
||||
else if (!st.m_has_int)
|
||||
else if (!st.m_has_int && st.m_num_non_linear == 0)
|
||||
setup_QF_UFLRA();
|
||||
else
|
||||
setup_unknown();
|
||||
|
|
|
@ -55,7 +55,7 @@ namespace smt {
|
|||
updt_params(p);
|
||||
}
|
||||
|
||||
virtual solver * translate(ast_manager & m, params_ref const & p) {
|
||||
solver * translate(ast_manager & m, params_ref const & p) override {
|
||||
ast_translation translator(get_manager(), m);
|
||||
|
||||
smt_solver * result = alloc(smt_solver, m, p, m_logic);
|
||||
|
@ -68,11 +68,11 @@ namespace smt {
|
|||
return result;
|
||||
}
|
||||
|
||||
virtual ~smt_solver() {
|
||||
~smt_solver() override {
|
||||
dec_ref_values(get_manager(), m_name2assertion);
|
||||
}
|
||||
|
||||
virtual void updt_params(params_ref const & p) {
|
||||
void updt_params(params_ref const & p) override {
|
||||
solver::updt_params(p);
|
||||
m_smt_params.updt_params(p);
|
||||
m_context.updt_params(p);
|
||||
|
@ -82,28 +82,28 @@ namespace smt {
|
|||
m_core_extend_nonlocal_patterns = smth.core_extend_nonlocal_patterns();
|
||||
}
|
||||
|
||||
virtual void collect_param_descrs(param_descrs & r) {
|
||||
void collect_param_descrs(param_descrs & r) override {
|
||||
m_context.collect_param_descrs(r);
|
||||
}
|
||||
|
||||
virtual void collect_statistics(statistics & st) const {
|
||||
void collect_statistics(statistics & st) const override {
|
||||
m_context.collect_statistics(st);
|
||||
}
|
||||
|
||||
virtual lbool get_consequences_core(expr_ref_vector const& assumptions, expr_ref_vector const& vars, expr_ref_vector& conseq) {
|
||||
lbool get_consequences_core(expr_ref_vector const& assumptions, expr_ref_vector const& vars, expr_ref_vector& conseq) override {
|
||||
expr_ref_vector unfixed(m_context.m());
|
||||
return m_context.get_consequences(assumptions, vars, conseq, unfixed);
|
||||
}
|
||||
|
||||
virtual lbool find_mutexes(expr_ref_vector const& vars, vector<expr_ref_vector>& mutexes) {
|
||||
lbool find_mutexes(expr_ref_vector const& vars, vector<expr_ref_vector>& mutexes) override {
|
||||
return m_context.find_mutexes(vars, mutexes);
|
||||
}
|
||||
|
||||
virtual void assert_expr(expr * t) {
|
||||
void assert_expr(expr * t) override {
|
||||
m_context.assert_expr(t);
|
||||
}
|
||||
|
||||
virtual void assert_expr(expr * t, expr * a) {
|
||||
void assert_expr(expr * t, expr * a) override {
|
||||
if (m_name2assertion.contains(a)) {
|
||||
throw default_exception("named assertion defined twice");
|
||||
}
|
||||
|
@ -112,11 +112,11 @@ namespace smt {
|
|||
m_name2assertion.insert(a, t);
|
||||
}
|
||||
|
||||
virtual void push_core() {
|
||||
void push_core() override {
|
||||
m_context.push();
|
||||
}
|
||||
|
||||
virtual void pop_core(unsigned n) {
|
||||
void pop_core(unsigned n) override {
|
||||
unsigned cur_sz = m_assumptions.size();
|
||||
if (n > 0 && cur_sz > 0) {
|
||||
unsigned lvl = m_scopes.size();
|
||||
|
@ -135,7 +135,7 @@ namespace smt {
|
|||
m_context.pop(n);
|
||||
}
|
||||
|
||||
virtual lbool check_sat_core(unsigned num_assumptions, expr * const * assumptions) {
|
||||
lbool check_sat_core(unsigned num_assumptions, expr * const * assumptions) override {
|
||||
TRACE("solver_na2as", tout << "smt_solver::check_sat_core: " << num_assumptions << "\n";);
|
||||
return m_context.check(num_assumptions, assumptions);
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ namespace smt {
|
|||
}
|
||||
};
|
||||
|
||||
virtual void get_unsat_core(ptr_vector<expr> & r) {
|
||||
void get_unsat_core(ptr_vector<expr> & r) override {
|
||||
unsigned sz = m_context.get_unsat_core_size();
|
||||
for (unsigned i = 0; i < sz; i++) {
|
||||
r.push_back(m_context.get_unsat_core_expr(i));
|
||||
|
@ -177,40 +177,40 @@ namespace smt {
|
|||
add_nonlocal_pattern_literals_to_core(r);
|
||||
}
|
||||
|
||||
virtual void get_model(model_ref & m) {
|
||||
void get_model(model_ref & m) override {
|
||||
m_context.get_model(m);
|
||||
}
|
||||
|
||||
virtual proof * get_proof() {
|
||||
proof * get_proof() override {
|
||||
return m_context.get_proof();
|
||||
}
|
||||
|
||||
virtual std::string reason_unknown() const {
|
||||
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 void get_labels(svector<symbol> & r) {
|
||||
void get_labels(svector<symbol> & r) override {
|
||||
buffer<symbol> tmp;
|
||||
m_context.get_relevant_labels(0, tmp);
|
||||
m_context.get_relevant_labels(nullptr, tmp);
|
||||
r.append(tmp.size(), tmp.c_ptr());
|
||||
}
|
||||
|
||||
virtual ast_manager & get_manager() const { return m_context.m(); }
|
||||
ast_manager & get_manager() const override { return m_context.m(); }
|
||||
|
||||
virtual void set_progress_callback(progress_callback * callback) {
|
||||
void set_progress_callback(progress_callback * callback) override {
|
||||
m_callback = callback;
|
||||
m_context.set_progress_callback(callback);
|
||||
}
|
||||
|
||||
virtual unsigned get_num_assertions() const {
|
||||
unsigned get_num_assertions() const override {
|
||||
return m_context.size();
|
||||
}
|
||||
|
||||
virtual expr * get_assertion(unsigned idx) const {
|
||||
expr * get_assertion(unsigned idx) const override {
|
||||
SASSERT(idx < get_num_assertions());
|
||||
return m_context.get_formula(idx);
|
||||
}
|
||||
|
@ -368,7 +368,7 @@ solver * mk_smt_solver(ast_manager & m, params_ref const & p, symbol const & log
|
|||
|
||||
class smt_solver_factory : public solver_factory {
|
||||
public:
|
||||
virtual solver * operator()(ast_manager & m, params_ref const & p, bool proofs_enabled, bool models_enabled, bool unsat_core_enabled, symbol const & logic) {
|
||||
solver * operator()(ast_manager & m, params_ref const & p, bool proofs_enabled, bool models_enabled, bool unsat_core_enabled, symbol const & logic) override {
|
||||
return mk_smt_solver(m, p, logic);
|
||||
}
|
||||
};
|
||||
|
|
|
@ -130,8 +130,8 @@ namespace smt {
|
|||
|
||||
theory::theory(family_id fid):
|
||||
m_id(fid),
|
||||
m_context(0),
|
||||
m_manager(0) {
|
||||
m_context(nullptr),
|
||||
m_manager(nullptr) {
|
||||
}
|
||||
|
||||
theory::~theory() {
|
||||
|
|
|
@ -235,7 +235,7 @@ namespace smt {
|
|||
disequality propagation.
|
||||
*/
|
||||
virtual justification * why_is_diseq(theory_var v1, theory_var v2) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -369,7 +369,7 @@ namespace smt {
|
|||
theory_var other = null_theory_var;
|
||||
TRACE("assume_eqs",
|
||||
tout << "#" << n->get_owner_id() << " is_relevant_and_shared: " << is_relevant_and_shared(n) << "\n";);
|
||||
if (n != 0 && is_relevant_and_shared(n)) {
|
||||
if (n != nullptr && is_relevant_and_shared(n)) {
|
||||
other = table.insert_if_not_there(v);
|
||||
if (other != v) {
|
||||
enode * n2 = get_enode(other);
|
||||
|
@ -423,7 +423,7 @@ namespace smt {
|
|||
\brief Return a functor that can build the value (interpretation) for n.
|
||||
*/
|
||||
virtual model_value_proc * mk_value(enode * n, model_generator & mg) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
virtual bool include_func_interp(func_decl* f) {
|
||||
|
|
|
@ -32,10 +32,10 @@ namespace smt {
|
|||
theory_var_list():
|
||||
m_th_id(null_theory_id),
|
||||
m_th_var(null_theory_var),
|
||||
m_next(0) {
|
||||
m_next(nullptr) {
|
||||
}
|
||||
|
||||
theory_var_list(theory_id t, theory_var v, theory_var_list * n = 0):
|
||||
theory_var_list(theory_id t, theory_var v, theory_var_list * n = nullptr):
|
||||
m_th_id(t),
|
||||
m_th_var(v),
|
||||
m_next(n) {
|
||||
|
|
|
@ -43,11 +43,11 @@ public:
|
|||
m_fn = m.mk_func_decl(symbol(0xbeef101), i_sort, m.mk_bool_sort());
|
||||
}
|
||||
|
||||
virtual tactic * translate(ast_manager & m) {
|
||||
tactic * translate(ast_manager & m) override {
|
||||
return alloc(ctx_solver_simplify_tactic, m, m_params);
|
||||
}
|
||||
|
||||
virtual ~ctx_solver_simplify_tactic() {
|
||||
~ctx_solver_simplify_tactic() override {
|
||||
obj_map<sort, func_decl*>::iterator it = m_fns.begin(), end = m_fns.end();
|
||||
for (; it != end; ++it) {
|
||||
m.dec_ref(it->m_value);
|
||||
|
@ -55,33 +55,32 @@ public:
|
|||
m_fns.reset();
|
||||
}
|
||||
|
||||
virtual void updt_params(params_ref const & p) {
|
||||
void updt_params(params_ref const & p) override {
|
||||
m_solver.updt_params(p);
|
||||
}
|
||||
|
||||
virtual void collect_param_descrs(param_descrs & r) {
|
||||
void collect_param_descrs(param_descrs & r) override {
|
||||
m_solver.collect_param_descrs(r);
|
||||
}
|
||||
|
||||
virtual void collect_statistics(statistics & st) const {
|
||||
void collect_statistics(statistics & st) const override {
|
||||
st.update("solver-simplify-steps", m_num_steps);
|
||||
}
|
||||
|
||||
virtual void reset_statistics() { m_num_steps = 0; }
|
||||
void reset_statistics() override { m_num_steps = 0; }
|
||||
|
||||
virtual void operator()(goal_ref const & in,
|
||||
goal_ref_buffer & result,
|
||||
model_converter_ref & mc,
|
||||
proof_converter_ref & pc,
|
||||
expr_dependency_ref & core) {
|
||||
|
||||
mc = 0; pc = 0; core = 0;
|
||||
void operator()(goal_ref const & in,
|
||||
goal_ref_buffer & result,
|
||||
model_converter_ref & mc,
|
||||
proof_converter_ref & pc,
|
||||
expr_dependency_ref & core) override {
|
||||
mc = nullptr; pc = nullptr; core = nullptr;
|
||||
reduce(*(in.get()));
|
||||
in->inc_depth();
|
||||
result.push_back(in.get());
|
||||
}
|
||||
|
||||
virtual void cleanup() {
|
||||
void cleanup() override {
|
||||
reset_statistics();
|
||||
m_solver.reset();
|
||||
}
|
||||
|
@ -127,7 +126,7 @@ protected:
|
|||
m_solver.pop(1);
|
||||
});
|
||||
g.reset();
|
||||
g.assert_expr(fml, 0, 0);
|
||||
g.assert_expr(fml, nullptr, nullptr);
|
||||
IF_VERBOSE(TACTIC_VERBOSITY_LVL, verbose_stream() << "(ctx-solver-simplify :num-steps " << m_num_steps << ")\n";);
|
||||
SASSERT(g.is_well_sorted());
|
||||
}
|
||||
|
@ -141,7 +140,7 @@ protected:
|
|||
m_parent(p), m_self(s), m_idx(i), m_expr(e)
|
||||
{}
|
||||
expr_pos():
|
||||
m_parent(0), m_self(0), m_idx(0), m_expr(0)
|
||||
m_parent(0), m_self(0), m_idx(0), m_expr(nullptr)
|
||||
{}
|
||||
};
|
||||
|
||||
|
@ -194,7 +193,7 @@ protected:
|
|||
|
||||
a = to_app(e);
|
||||
sz = a->get_num_args();
|
||||
n2 = 0;
|
||||
n2 = nullptr;
|
||||
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
expr* arg = a->get_arg(i);
|
||||
|
|
|
@ -47,17 +47,17 @@ class smt_tactic : public tactic {
|
|||
public:
|
||||
smt_tactic(params_ref const & p):
|
||||
m_params_ref(p),
|
||||
m_ctx(0),
|
||||
m_callback(0) {
|
||||
m_ctx(nullptr),
|
||||
m_callback(nullptr) {
|
||||
updt_params_core(p);
|
||||
TRACE("smt_tactic", tout << "p: " << p << "\n";);
|
||||
}
|
||||
|
||||
virtual tactic * translate(ast_manager & m) {
|
||||
tactic * translate(ast_manager & m) override {
|
||||
return alloc(smt_tactic, m_params_ref);
|
||||
}
|
||||
|
||||
virtual ~smt_tactic() {
|
||||
~smt_tactic() override {
|
||||
SASSERT(m_ctx == 0);
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ public:
|
|||
m_fail_if_inconclusive = p.get_bool("fail_if_inconclusive", true);
|
||||
}
|
||||
|
||||
virtual void updt_params(params_ref const & p) {
|
||||
void updt_params(params_ref const & p) override {
|
||||
TRACE("smt_tactic", tout << "updt_params: " << p << "\n";);
|
||||
updt_params_core(p);
|
||||
fparams().updt_params(p);
|
||||
|
@ -86,7 +86,7 @@ public:
|
|||
SASSERT(p.get_bool("auto_config", fparams().m_auto_config) == fparams().m_auto_config);
|
||||
}
|
||||
|
||||
virtual void collect_param_descrs(param_descrs & r) {
|
||||
void collect_param_descrs(param_descrs & r) override {
|
||||
r.insert("candidate_models", CPK_BOOL, "(default: false) create candidate models even when quantifier or theory reasoning is incomplete.");
|
||||
r.insert("fail_if_inconclusive", CPK_BOOL, "(default: true) fail if found unsat (sat) for under (over) approximated goal.");
|
||||
smt_params_helper::collect_param_descrs(r);
|
||||
|
@ -94,25 +94,25 @@ public:
|
|||
}
|
||||
|
||||
|
||||
virtual void collect_statistics(statistics & st) const {
|
||||
void collect_statistics(statistics & st) const override {
|
||||
if (m_ctx)
|
||||
m_ctx->collect_statistics(st); // ctx is still running...
|
||||
else
|
||||
st.copy(m_stats);
|
||||
}
|
||||
|
||||
virtual void cleanup() {
|
||||
void cleanup() override {
|
||||
}
|
||||
|
||||
virtual void reset_statistics() {
|
||||
void reset_statistics() override {
|
||||
m_stats.reset();
|
||||
}
|
||||
|
||||
virtual void set_logic(symbol const & l) {
|
||||
void set_logic(symbol const & l) override {
|
||||
m_logic = l;
|
||||
}
|
||||
|
||||
virtual void set_progress_callback(progress_callback * callback) {
|
||||
void set_progress_callback(progress_callback * callback) override {
|
||||
m_callback = callback;
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ public:
|
|||
|
||||
~scoped_init_ctx() {
|
||||
smt::kernel * d = m_owner.m_ctx;
|
||||
m_owner.m_ctx = 0;
|
||||
m_owner.m_ctx = nullptr;
|
||||
|
||||
if (d)
|
||||
dealloc(d);
|
||||
|
@ -144,14 +144,14 @@ public:
|
|||
};
|
||||
|
||||
|
||||
virtual void operator()(goal_ref const & in,
|
||||
goal_ref_buffer & result,
|
||||
model_converter_ref & mc,
|
||||
proof_converter_ref & pc,
|
||||
expr_dependency_ref & core) {
|
||||
void operator()(goal_ref const & in,
|
||||
goal_ref_buffer & result,
|
||||
model_converter_ref & mc,
|
||||
proof_converter_ref & pc,
|
||||
expr_dependency_ref & core) override {
|
||||
try {
|
||||
IF_VERBOSE(10, verbose_stream() << "(smt.tactic start)\n";);
|
||||
mc = 0; pc = 0; core = 0;
|
||||
mc = nullptr; pc = nullptr; core = nullptr;
|
||||
SASSERT(in->is_well_sorted());
|
||||
ast_manager & m = in->m();
|
||||
TRACE("smt_tactic", tout << this << "\nAUTO_CONFIG: " << fparams().m_auto_config << " HIDIV0: " << fparams().m_hi_div0 << " "
|
||||
|
@ -220,7 +220,7 @@ public:
|
|||
model_ref md;
|
||||
m_ctx->get_model(md);
|
||||
buffer<symbol> r;
|
||||
m_ctx->get_relevant_labels(0, r);
|
||||
m_ctx->get_relevant_labels(nullptr, r);
|
||||
mc = model_and_labels2model_converter(md.get(), r);
|
||||
mc = concat(fmc.get(), mc.get());
|
||||
}
|
||||
|
@ -233,8 +233,8 @@ public:
|
|||
}
|
||||
// formula is unsat, reset the goal, and store false there.
|
||||
in->reset();
|
||||
proof * pr = 0;
|
||||
expr_dependency * lcore = 0;
|
||||
proof * pr = nullptr;
|
||||
expr_dependency * lcore = nullptr;
|
||||
if (in->proofs_enabled())
|
||||
pr = m_ctx->get_proof();
|
||||
if (in->unsat_core_enabled()) {
|
||||
|
@ -269,7 +269,7 @@ public:
|
|||
model_ref md;
|
||||
m_ctx->get_model(md);
|
||||
buffer<symbol> r;
|
||||
m_ctx->get_relevant_labels(0, r);
|
||||
m_ctx->get_relevant_labels(nullptr, r);
|
||||
mc = model_and_labels2model_converter(md.get(), r);
|
||||
}
|
||||
return;
|
||||
|
|
|
@ -37,22 +37,22 @@ struct unit_subsumption_tactic : public tactic {
|
|||
m_clauses(m) {
|
||||
}
|
||||
|
||||
void cleanup() {}
|
||||
void cleanup() override {}
|
||||
|
||||
virtual void operator()(/* in */ goal_ref const & in,
|
||||
/* out */ goal_ref_buffer & result,
|
||||
/* out */ model_converter_ref & mc,
|
||||
/* out */ proof_converter_ref & pc,
|
||||
/* out */ expr_dependency_ref & core) {
|
||||
void operator()(/* in */ goal_ref const & in,
|
||||
/* out */ goal_ref_buffer & result,
|
||||
/* out */ model_converter_ref & mc,
|
||||
/* out */ proof_converter_ref & pc,
|
||||
/* out */ expr_dependency_ref & core) override {
|
||||
reduce_core(in, result);
|
||||
}
|
||||
|
||||
virtual void updt_params(params_ref const& p) {
|
||||
void updt_params(params_ref const& p) override {
|
||||
m_params = p;
|
||||
// m_context.updt_params(p); does not exist.
|
||||
}
|
||||
|
||||
virtual tactic* translate(ast_manager& m) {
|
||||
tactic* translate(ast_manager& m) override {
|
||||
return alloc(unit_subsumption_tactic, m, m_params);
|
||||
}
|
||||
|
||||
|
|
|
@ -306,16 +306,16 @@ namespace smt {
|
|||
public:
|
||||
atom(bool_var bv, theory_var v, inf_numeral const & k, atom_kind kind);
|
||||
atom_kind get_atom_kind() const { return static_cast<atom_kind>(m_atom_kind); }
|
||||
virtual ~atom() {}
|
||||
~atom() override {}
|
||||
inline inf_numeral const & get_k() const { return m_k; }
|
||||
bool_var get_bool_var() const { return m_bvar; }
|
||||
bool is_true() const { return m_is_true; }
|
||||
void assign_eh(bool is_true, inf_numeral const & epsilon);
|
||||
virtual bool has_justification() const { return true; }
|
||||
virtual void push_justification(antecedents& a, numeral const& coeff, bool proofs_enabled) {
|
||||
bool has_justification() const override { return true; }
|
||||
void push_justification(antecedents& a, numeral const& coeff, bool proofs_enabled) override {
|
||||
a.push_lit(literal(get_bool_var(), !m_is_true), coeff, proofs_enabled);
|
||||
}
|
||||
virtual void display(theory_arith const& th, std::ostream& out) const;
|
||||
void display(theory_arith const& th, std::ostream& out) const override;
|
||||
};
|
||||
|
||||
class eq_bound : public bound {
|
||||
|
@ -328,13 +328,13 @@ namespace smt {
|
|||
m_rhs(rhs) {
|
||||
SASSERT(m_lhs->get_root() == m_rhs->get_root());
|
||||
}
|
||||
virtual ~eq_bound() {}
|
||||
virtual bool has_justification() const { return true; }
|
||||
virtual void push_justification(antecedents& a, numeral const& coeff, bool proofs_enabled) {
|
||||
~eq_bound() override {}
|
||||
bool has_justification() const override { return true; }
|
||||
void push_justification(antecedents& a, numeral const& coeff, bool proofs_enabled) override {
|
||||
SASSERT(m_lhs->get_root() == m_rhs->get_root());
|
||||
a.push_eq(enode_pair(m_lhs, m_rhs), coeff, proofs_enabled);
|
||||
}
|
||||
virtual void display(theory_arith const& th, std::ostream& out) const;
|
||||
void display(theory_arith const& th, std::ostream& out) const override;
|
||||
};
|
||||
|
||||
class derived_bound : public bound {
|
||||
|
@ -344,14 +344,14 @@ namespace smt {
|
|||
friend class theory_arith;
|
||||
public:
|
||||
derived_bound(theory_var v, inf_numeral const & val, bound_kind k):bound(v, val, k, false) {}
|
||||
virtual ~derived_bound() {}
|
||||
~derived_bound() override {}
|
||||
literal_vector const& lits() const { return m_lits; }
|
||||
eq_vector const& eqs() const { return m_eqs; }
|
||||
virtual bool has_justification() const { return true; }
|
||||
virtual void push_justification(antecedents& a, numeral const& coeff, bool proofs_enabled);
|
||||
bool has_justification() const override { return true; }
|
||||
void push_justification(antecedents& a, numeral const& coeff, bool proofs_enabled) override;
|
||||
virtual void push_lit(literal l, numeral const&) { m_lits.push_back(l); }
|
||||
virtual void push_eq(enode_pair const& p, numeral const&) { m_eqs.push_back(p); }
|
||||
virtual void display(theory_arith const& th, std::ostream& out) const;
|
||||
void display(theory_arith const& th, std::ostream& out) const override;
|
||||
|
||||
};
|
||||
|
||||
|
@ -361,12 +361,12 @@ namespace smt {
|
|||
friend class theory_arith;
|
||||
public:
|
||||
justified_derived_bound(theory_var v, inf_numeral const & val, bound_kind k):derived_bound(v, val, k) {}
|
||||
virtual ~justified_derived_bound() {}
|
||||
virtual bool has_justification() const { return true; }
|
||||
virtual void push_justification(antecedents& a, numeral const& coeff, bool proofs_enabled);
|
||||
virtual void push_lit(literal l, numeral const& coeff);
|
||||
~justified_derived_bound() override {}
|
||||
bool has_justification() const override { return true; }
|
||||
void push_justification(antecedents& a, numeral const& coeff, bool proofs_enabled) override;
|
||||
void push_lit(literal l, numeral const& coeff) override;
|
||||
|
||||
virtual void push_eq(enode_pair const& p, numeral const& coeff);
|
||||
void push_eq(enode_pair const& p, numeral const& coeff) override;
|
||||
};
|
||||
|
||||
typedef int_hashtable<int_hash, default_eq<int> > literal_idx_set;
|
||||
|
@ -510,7 +510,7 @@ namespace smt {
|
|||
typedef int_hashtable<var_value_hash, var_value_eq> var_value_table;
|
||||
var_value_table m_var_value_table;
|
||||
|
||||
virtual theory_var mk_var(enode * n);
|
||||
theory_var mk_var(enode * n) override;
|
||||
|
||||
void found_unsupported_op(app * n);
|
||||
void found_underspecified_op(app * n);
|
||||
|
@ -561,16 +561,16 @@ namespace smt {
|
|||
bound * upper(theory_var v) const { return m_bounds[1][v]; }
|
||||
inf_numeral const & lower_bound(theory_var v) const { SASSERT(lower(v) != 0); return lower(v)->get_value(); }
|
||||
inf_numeral const & upper_bound(theory_var v) const { SASSERT(upper(v) != 0); return upper(v)->get_value(); }
|
||||
bool below_lower(theory_var v) const { bound * l = lower(v); return l != 0 && get_value(v) < l->get_value(); }
|
||||
bool above_upper(theory_var v) const { bound * u = upper(v); return u != 0 && get_value(v) > u->get_value(); }
|
||||
bool below_upper(theory_var v) const { bound * u = upper(v); return u == 0 || get_value(v) < u->get_value(); }
|
||||
bool above_lower(theory_var v) const { bound * l = lower(v); return l == 0 || get_value(v) > l->get_value(); }
|
||||
bool below_lower(theory_var v) const { bound * l = lower(v); return l != nullptr && get_value(v) < l->get_value(); }
|
||||
bool above_upper(theory_var v) const { bound * u = upper(v); return u != nullptr && get_value(v) > u->get_value(); }
|
||||
bool below_upper(theory_var v) const { bound * u = upper(v); return u == nullptr || get_value(v) < u->get_value(); }
|
||||
bool above_lower(theory_var v) const { bound * l = lower(v); return l == nullptr || get_value(v) > l->get_value(); }
|
||||
bool at_bound(theory_var v) const;
|
||||
bool at_lower(theory_var v) const { bound * l = lower(v); return l != 0 && get_value(v) == l->get_value(); }
|
||||
bool at_upper(theory_var v) const { bound * u = upper(v); return u != 0 && get_value(v) == u->get_value(); }
|
||||
bool is_free(theory_var v) const { return lower(v) == 0 && upper(v) == 0; }
|
||||
bool is_non_free(theory_var v) const { return lower(v) != 0 || upper(v) != 0; }
|
||||
bool is_bounded(theory_var v) const { return lower(v) != 0 && upper(v) != 0; }
|
||||
bool at_lower(theory_var v) const { bound * l = lower(v); return l != nullptr && get_value(v) == l->get_value(); }
|
||||
bool at_upper(theory_var v) const { bound * u = upper(v); return u != nullptr && get_value(v) == u->get_value(); }
|
||||
bool is_free(theory_var v) const { return lower(v) == nullptr && upper(v) == nullptr; }
|
||||
bool is_non_free(theory_var v) const { return lower(v) != nullptr || upper(v) != nullptr; }
|
||||
bool is_bounded(theory_var v) const { return lower(v) != nullptr && upper(v) != nullptr; }
|
||||
bool is_free(expr * n) const {
|
||||
SASSERT(get_context().e_internalized(n) && get_context().get_enode(n)->get_th_var(get_id()) != null_theory_var);
|
||||
return is_free(get_context().get_enode(n)->get_th_var(get_id()));
|
||||
|
@ -635,24 +635,24 @@ namespace smt {
|
|||
struct compare_atoms {
|
||||
bool operator()(atom* a1, atom* a2) const { return a1->get_k() < a2->get_k(); }
|
||||
};
|
||||
virtual bool default_internalizer() const { return false; }
|
||||
virtual bool internalize_atom(app * n, bool gate_ctx);
|
||||
virtual bool internalize_term(app * term);
|
||||
virtual void internalize_eq_eh(app * atom, bool_var v);
|
||||
virtual void apply_sort_cnstr(enode * n, sort * s);
|
||||
bool default_internalizer() const override { return false; }
|
||||
bool internalize_atom(app * n, bool gate_ctx) override;
|
||||
bool internalize_term(app * term) override;
|
||||
void internalize_eq_eh(app * atom, bool_var v) override;
|
||||
void apply_sort_cnstr(enode * n, sort * s) override;
|
||||
|
||||
virtual void assign_eh(bool_var v, bool is_true);
|
||||
virtual void new_eq_eh(theory_var v1, theory_var v2);
|
||||
virtual bool use_diseqs() const;
|
||||
virtual void new_diseq_eh(theory_var v1, theory_var v2);
|
||||
void assign_eh(bool_var v, bool is_true) override;
|
||||
void new_eq_eh(theory_var v1, theory_var v2) override;
|
||||
bool use_diseqs() const override;
|
||||
void new_diseq_eh(theory_var v1, theory_var v2) override;
|
||||
|
||||
virtual void push_scope_eh();
|
||||
virtual void pop_scope_eh(unsigned num_scopes);
|
||||
void push_scope_eh() override;
|
||||
void pop_scope_eh(unsigned num_scopes) override;
|
||||
|
||||
virtual void relevant_eh(app * n);
|
||||
void relevant_eh(app * n) override;
|
||||
|
||||
virtual void restart_eh();
|
||||
virtual void init_search_eh();
|
||||
void restart_eh() override;
|
||||
void init_search_eh() override;
|
||||
/**
|
||||
\brief True if the assignment may be changed during final
|
||||
check. assume_eqs, check_int_feasibility,
|
||||
|
@ -660,7 +660,7 @@ namespace smt {
|
|||
satisfy their respective constraints. However, when they
|
||||
do that the may create inconsistencies in the other
|
||||
modules. I use m_liberal_final_check to avoid infinite
|
||||
loops where the modules keep changing the assigment and no
|
||||
loops where the modules keep changing the assignment and no
|
||||
progress is made. If m_liberal_final_check is set to false,
|
||||
these modules will avoid mutating the assignment to satisfy
|
||||
constraints.
|
||||
|
@ -669,18 +669,18 @@ namespace smt {
|
|||
*/
|
||||
bool m_liberal_final_check;
|
||||
final_check_status final_check_core();
|
||||
virtual final_check_status final_check_eh();
|
||||
final_check_status final_check_eh() override;
|
||||
|
||||
virtual bool can_propagate();
|
||||
virtual void propagate();
|
||||
bool can_propagate() override;
|
||||
void propagate() override;
|
||||
bool propagate_core();
|
||||
void failed();
|
||||
|
||||
|
||||
virtual void flush_eh();
|
||||
virtual void reset_eh();
|
||||
void flush_eh() override;
|
||||
void reset_eh() override;
|
||||
|
||||
virtual bool validate_eq_in_model(theory_var v1, theory_var v2, bool is_true) const;
|
||||
bool validate_eq_in_model(theory_var v1, theory_var v2, bool is_true) const override;
|
||||
|
||||
// -----------------------------------
|
||||
//
|
||||
|
@ -867,7 +867,7 @@ namespace smt {
|
|||
void propagate_cheap_eq(unsigned rid);
|
||||
void propagate_eq_to_core(theory_var x, theory_var y, antecedents& antecedents);
|
||||
|
||||
virtual bool is_shared(theory_var v) const;
|
||||
bool is_shared(theory_var v) const override;
|
||||
|
||||
// -----------------------------------
|
||||
//
|
||||
|
@ -909,7 +909,7 @@ namespace smt {
|
|||
/**
|
||||
\brief See comment in theory::mk_eq_atom
|
||||
*/
|
||||
virtual app * mk_eq_atom(expr * lhs, expr * rhs) { return m_util.mk_eq(lhs, rhs); }
|
||||
app * mk_eq_atom(expr * lhs, expr * rhs) override { return m_util.mk_eq(lhs, rhs); }
|
||||
|
||||
// -----------------------------------
|
||||
//
|
||||
|
@ -1039,13 +1039,13 @@ namespace smt {
|
|||
// -----------------------------------
|
||||
public:
|
||||
theory_arith(ast_manager & m, theory_arith_params & params);
|
||||
virtual ~theory_arith();
|
||||
~theory_arith() override;
|
||||
|
||||
virtual theory * mk_fresh(context * new_ctx);
|
||||
theory * mk_fresh(context * new_ctx) override;
|
||||
|
||||
virtual void setup();
|
||||
void setup() override;
|
||||
|
||||
virtual char const * get_name() const { return "arithmetic"; }
|
||||
char const * get_name() const override { return "arithmetic"; }
|
||||
|
||||
// -----------------------------------
|
||||
//
|
||||
|
@ -1058,15 +1058,15 @@ namespace smt {
|
|||
void compute_epsilon();
|
||||
void refine_epsilon();
|
||||
|
||||
virtual void init_model(model_generator & m);
|
||||
virtual model_value_proc * mk_value(enode * n, model_generator & mg);
|
||||
void init_model(model_generator & m) override;
|
||||
model_value_proc * mk_value(enode * n, model_generator & mg) override;
|
||||
|
||||
// -----------------------------------
|
||||
//
|
||||
// Model checker
|
||||
//
|
||||
// -----------------------------------
|
||||
virtual bool get_value(enode * n, expr_ref & r);
|
||||
bool get_value(enode * n, expr_ref & r) override;
|
||||
|
||||
bool get_lower(enode* n, expr_ref& r);
|
||||
bool get_upper(enode* n, expr_ref& r);
|
||||
|
@ -1078,9 +1078,9 @@ namespace smt {
|
|||
// Optimization
|
||||
//
|
||||
// -----------------------------------
|
||||
virtual inf_eps_rational<inf_rational> maximize(theory_var v, expr_ref& blocker, bool& has_shared);
|
||||
virtual inf_eps_rational<inf_rational> value(theory_var v);
|
||||
virtual theory_var add_objective(app* term);
|
||||
inf_eps_rational<inf_rational> maximize(theory_var v, expr_ref& blocker, bool& has_shared) override;
|
||||
inf_eps_rational<inf_rational> value(theory_var v) override;
|
||||
theory_var add_objective(app* term) override;
|
||||
expr_ref mk_ge(filter_model_converter& fm, theory_var v, inf_numeral const& val);
|
||||
void enable_record_conflict(expr* bound);
|
||||
void record_conflict(unsigned num_lits, literal const * lits,
|
||||
|
@ -1102,8 +1102,8 @@ namespace smt {
|
|||
//
|
||||
// -----------------------------------
|
||||
public:
|
||||
virtual void collect_statistics(::statistics & st) const;
|
||||
virtual void display(std::ostream & out) const;
|
||||
void collect_statistics(::statistics & st) const override;
|
||||
void display(std::ostream & out) const override;
|
||||
protected:
|
||||
void display_row(std::ostream & out, unsigned r_id, bool compact = true) const;
|
||||
void display_row(std::ostream & out, row const & r, bool compact = true) const;
|
||||
|
|
|
@ -279,7 +279,7 @@ namespace smt {
|
|||
return it;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template<typename Ext>
|
||||
|
@ -357,7 +357,7 @@ namespace smt {
|
|||
|
||||
template<typename Ext>
|
||||
parameter * theory_arith<Ext>::antecedents_t::params(char const* name) {
|
||||
if (empty()) return 0;
|
||||
if (empty()) return nullptr;
|
||||
init();
|
||||
m_params[0] = parameter(symbol(name));
|
||||
return m_params.c_ptr();
|
||||
|
@ -444,19 +444,19 @@ namespace smt {
|
|||
template<typename Ext>
|
||||
bool theory_arith<Ext>::at_bound(theory_var v) const {
|
||||
bound * l = lower(v);
|
||||
if (l != 0 && get_value(v) == l->get_value())
|
||||
if (l != nullptr && get_value(v) == l->get_value())
|
||||
return true;
|
||||
bound * u = upper(v);
|
||||
return u != 0 && get_value(v) == u->get_value();
|
||||
return u != nullptr && get_value(v) == u->get_value();
|
||||
}
|
||||
|
||||
template<typename Ext>
|
||||
bool theory_arith<Ext>::is_fixed(theory_var v) const {
|
||||
bound * l = lower(v);
|
||||
if (l == 0)
|
||||
if (l == nullptr)
|
||||
return false;
|
||||
bound * u = upper(v);
|
||||
if (u == 0)
|
||||
if (u == nullptr)
|
||||
return false;
|
||||
return l->get_value() == u->get_value();
|
||||
}
|
||||
|
@ -483,7 +483,7 @@ namespace smt {
|
|||
while (true) {
|
||||
column const & c = m_columns[v];
|
||||
if (c.size() == 0)
|
||||
return 0;
|
||||
return nullptr;
|
||||
int quasi_base_rid = -1;
|
||||
typename svector<col_entry>::const_iterator it = c.begin_entries();
|
||||
typename svector<col_entry>::const_iterator end = c.end_entries();
|
||||
|
@ -533,7 +533,7 @@ namespace smt {
|
|||
typename theory_arith<Ext>::col_entry const * theory_arith<Ext>::get_row_for_eliminating(theory_var v) const {
|
||||
column const & c = m_columns[v];
|
||||
if (c.size() == 0)
|
||||
return 0;
|
||||
return nullptr;
|
||||
typename svector<col_entry>::const_iterator it = c.begin_entries();
|
||||
typename svector<col_entry>::const_iterator end = c.end_entries();
|
||||
for (; it != end; ++it) {
|
||||
|
@ -556,7 +556,7 @@ namespace smt {
|
|||
return it;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template<typename Ext>
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace smt {
|
|||
template<typename Ext>
|
||||
void theory_arith<Ext>::found_underspecified_op(app * n) {
|
||||
if (!m_found_underspecified_op) {
|
||||
TRACE("arith", tout << "found underspecificed expression:\n" << mk_pp(n, get_manager()) << "\n";);
|
||||
TRACE("arith", tout << "found underspecified expression:\n" << mk_pp(n, get_manager()) << "\n";);
|
||||
get_context().push_trail(value_trail<context, bool>(m_found_underspecified_op));
|
||||
m_found_underspecified_op = true;
|
||||
}
|
||||
|
@ -472,7 +472,7 @@ namespace smt {
|
|||
tout << s_ante << "\n" << s_conseq << "\n";);
|
||||
|
||||
// literal lits[2] = {l_ante, l_conseq};
|
||||
mk_clause(l_ante, l_conseq, 0, 0);
|
||||
mk_clause(l_ante, l_conseq, 0, nullptr);
|
||||
if (ctx.relevancy()) {
|
||||
if (l_ante == false_literal) {
|
||||
ctx.mark_as_relevant(l_conseq);
|
||||
|
@ -1347,8 +1347,8 @@ namespace smt {
|
|||
std::swap(n1, n2);
|
||||
}
|
||||
rational k;
|
||||
bound * b1 = 0;
|
||||
bound * b2 = 0;
|
||||
bound * b1 = nullptr;
|
||||
bound * b2 = nullptr;
|
||||
if (m_util.is_numeral(n2->get_owner(), k)) {
|
||||
inf_numeral val(k);
|
||||
b1 = alloc(eq_bound, v1, val, B_LOWER, n1, n2);
|
||||
|
@ -2342,7 +2342,7 @@ namespace smt {
|
|||
row const & r = m_rows[get_var_row(x_i)];
|
||||
int idx = r.get_idx_of(x_i);
|
||||
SASSERT(idx >= 0);
|
||||
bound * b = 0;
|
||||
bound * b = nullptr;
|
||||
|
||||
// Remark:
|
||||
// if x_i is an integer variable, then delta can be negative:
|
||||
|
@ -2616,7 +2616,7 @@ namespace smt {
|
|||
return;
|
||||
}
|
||||
bool is_pos = it->m_coeff.is_pos();
|
||||
if (lower(it->m_var) == 0) {
|
||||
if (lower(it->m_var) == nullptr) {
|
||||
if (is_pos) {
|
||||
UPDATE_IDX(upper_idx);
|
||||
}
|
||||
|
@ -2624,7 +2624,7 @@ namespace smt {
|
|||
UPDATE_IDX(lower_idx);
|
||||
}
|
||||
}
|
||||
if (upper(it->m_var) == 0) {
|
||||
if (upper(it->m_var) == nullptr) {
|
||||
if (is_pos) {
|
||||
UPDATE_IDX(lower_idx);
|
||||
}
|
||||
|
@ -2661,7 +2661,7 @@ namespace smt {
|
|||
if (entry.m_coeff.is_pos() == is_lower) {
|
||||
// implied_k is a lower bound for entry.m_var
|
||||
bound * curr = lower(entry.m_var);
|
||||
if (curr == 0 || implied_k > curr->get_value()) {
|
||||
if (curr == nullptr || implied_k > curr->get_value()) {
|
||||
TRACE("arith_imply_bound",
|
||||
tout << "implying lower bound for v" << entry.m_var << " " << implied_k << " using row:\n";
|
||||
display_row_info(tout, r);
|
||||
|
@ -2672,7 +2672,7 @@ namespace smt {
|
|||
else {
|
||||
// implied_k is an upper bound for it->m_var
|
||||
bound * curr = upper(entry.m_var);
|
||||
if (curr == 0 || implied_k < curr->get_value()) {
|
||||
if (curr == nullptr || implied_k < curr->get_value()) {
|
||||
TRACE("arith_imply_bound",
|
||||
tout << "implying upper bound for v" << entry.m_var << " " << implied_k << " using row:\n";
|
||||
display_row_info(tout, r);
|
||||
|
@ -2722,7 +2722,7 @@ namespace smt {
|
|||
if (it->m_coeff.is_pos() == is_lower) {
|
||||
// implied_k is a lower bound for it->m_var
|
||||
bound * curr = lower(it->m_var);
|
||||
if (curr == 0 || implied_k > curr->get_value()) {
|
||||
if (curr == nullptr || implied_k > curr->get_value()) {
|
||||
// improved lower bound
|
||||
TRACE("arith_imply_bound",
|
||||
tout << "implying lower bound for v" << it->m_var << " " << implied_k << " using row:\n";
|
||||
|
@ -2734,7 +2734,7 @@ namespace smt {
|
|||
else {
|
||||
// implied_k is an upper bound for it->m_var
|
||||
bound * curr = upper(it->m_var);
|
||||
if (curr == 0 || implied_k < curr->get_value()) {
|
||||
if (curr == nullptr || implied_k < curr->get_value()) {
|
||||
// improved upper bound
|
||||
TRACE("arith_imply_bound",
|
||||
tout << "implying upper bound for v" << it->m_var << " " << implied_k << " using row:\n";
|
||||
|
@ -2809,7 +2809,7 @@ namespace smt {
|
|||
TRACE("propagate_bounds_bug", tout << "is_b_lower: " << is_b_lower << " k1: " << k_1 << " limit_k1: "
|
||||
<< limit_k1 << " delta: " << delta << " coeff: " << coeff << "\n";);
|
||||
inf_numeral k_2 = k_1;
|
||||
atom * new_atom = 0;
|
||||
atom * new_atom = nullptr;
|
||||
atoms const & as = m_var_occs[it->m_var];
|
||||
typename atoms::const_iterator it = as.begin();
|
||||
typename atoms::const_iterator end = as.end();
|
||||
|
@ -2844,7 +2844,7 @@ namespace smt {
|
|||
}
|
||||
SASSERT(!is_b_lower || k_2 <= k_1);
|
||||
SASSERT(is_b_lower || k_2 >= k_1);
|
||||
if (new_atom == 0) {
|
||||
if (new_atom == nullptr) {
|
||||
b->push_justification(ante, coeff, coeffs_enabled());
|
||||
continue;
|
||||
}
|
||||
|
@ -2976,12 +2976,12 @@ namespace smt {
|
|||
literal_vector::const_iterator end = ante.lits().end();
|
||||
for (; it != end; ++it)
|
||||
lits.push_back(~(*it));
|
||||
justification * js = 0;
|
||||
justification * js = nullptr;
|
||||
if (proofs_enabled()) {
|
||||
js = alloc(theory_lemma_justification, get_id(), ctx, lits.size(), lits.c_ptr(),
|
||||
ante.num_params(), ante.params("assign-bounds"));
|
||||
}
|
||||
ctx.mk_clause(lits.size(), lits.c_ptr(), js, CLS_AUX_LEMMA, 0);
|
||||
ctx.mk_clause(lits.size(), lits.c_ptr(), js, CLS_AUX_LEMMA, nullptr);
|
||||
}
|
||||
else {
|
||||
region & r = ctx.get_region();
|
||||
|
@ -3169,9 +3169,9 @@ namespace smt {
|
|||
for (theory_var v = 0; v < num; v++) {
|
||||
bound * l = lower(v);
|
||||
bound * u = upper(v);
|
||||
if (l != 0)
|
||||
if (l != nullptr)
|
||||
update_epsilon(l->get_value(), get_value(v));
|
||||
if (u != 0)
|
||||
if (u != nullptr)
|
||||
update_epsilon(get_value(v), u->get_value());
|
||||
}
|
||||
TRACE("epsilon_bug", tout << "epsilon: " << m_epsilon << "\n";);
|
||||
|
@ -3289,14 +3289,14 @@ namespace smt {
|
|||
template<typename Ext>
|
||||
bool theory_arith<Ext>::get_lower(enode * n, expr_ref & r) {
|
||||
theory_var v = n->get_th_var(get_id());
|
||||
bound* b = (v == null_theory_var) ? 0 : lower(v);
|
||||
bound* b = (v == null_theory_var) ? nullptr : lower(v);
|
||||
return b && to_expr(b->get_value(), is_int(v), r);
|
||||
}
|
||||
|
||||
template<typename Ext>
|
||||
bool theory_arith<Ext>::get_upper(enode * n, expr_ref & r) {
|
||||
theory_var v = n->get_th_var(get_id());
|
||||
bound* b = (v == null_theory_var) ? 0 : upper(v);
|
||||
bound* b = (v == null_theory_var) ? nullptr : upper(v);
|
||||
return b && to_expr(b->get_value(), is_int(v), r);
|
||||
}
|
||||
|
||||
|
@ -3388,7 +3388,7 @@ namespace smt {
|
|||
bound * b = it->get_old_bound();
|
||||
SASSERT(is_base(v) || is_non_base(v));
|
||||
restore_bound(v, b, it->is_upper());
|
||||
if (lazy_pivoting_lvl() > 2 && b == 0 && is_base(v) && is_free(v)) {
|
||||
if (lazy_pivoting_lvl() > 2 && b == nullptr && is_base(v) && is_free(v)) {
|
||||
SASSERT(!has_var_kind(get_var_row(v), BASE));
|
||||
SASSERT(!has_var_kind(get_var_row(v), QUASI_BASE));
|
||||
eliminate<false>(v, false);
|
||||
|
|
|
@ -117,7 +117,7 @@ namespace smt {
|
|||
for (; it != end; ++it) {
|
||||
if (!it->is_dead()) {
|
||||
theory_var v = it->m_var;
|
||||
if (lower(v) != 0 && upper(v) != 0)
|
||||
if (lower(v) != nullptr && upper(v) != nullptr)
|
||||
continue;
|
||||
bad++;
|
||||
if (bad > 2) {
|
||||
|
|
|
@ -50,15 +50,15 @@ namespace smt {
|
|||
bound * l = lower(v);
|
||||
bound * u = upper(v);
|
||||
const inf_numeral & val = get_value(v);
|
||||
if (l != 0 && u != 0) {
|
||||
if (l != nullptr && u != nullptr) {
|
||||
if (val != l->get_value() && val != u->get_value())
|
||||
set_value(v, l->get_value());
|
||||
}
|
||||
else if (l != 0) {
|
||||
else if (l != nullptr) {
|
||||
if (val != l->get_value())
|
||||
set_value(v, l->get_value());
|
||||
}
|
||||
else if (u != 0) {
|
||||
else if (u != nullptr) {
|
||||
if (val != u->get_value())
|
||||
set_value(v, u->get_value());
|
||||
}
|
||||
|
@ -245,12 +245,12 @@ namespace smt {
|
|||
numeral const_coeff(0);
|
||||
|
||||
bound* l = lower(b), *u = upper(b);
|
||||
if (l != 0 && get_value(b) - inf_numeral(1) < l->get_value()) {
|
||||
if (l != nullptr && get_value(b) - inf_numeral(1) < l->get_value()) {
|
||||
SASSERT(l->get_value() <= get_value(b));
|
||||
is_tight = true;
|
||||
const_coeff = l->get_value().get_rational();
|
||||
}
|
||||
else if (u != 0 && get_value(b) + inf_numeral(1) > u->get_value()) {
|
||||
else if (u != nullptr && get_value(b) + inf_numeral(1) > u->get_value()) {
|
||||
SASSERT(get_value(b) <= u->get_value());
|
||||
is_tight = true;
|
||||
const_coeff = u->get_value().get_rational();
|
||||
|
@ -472,7 +472,7 @@ namespace smt {
|
|||
bounds.num_params(), bounds.params("gomory-cut")) {
|
||||
}
|
||||
// Remark: the assignment must be propagated back to arith
|
||||
virtual theory_id get_from_theory() const { return null_theory_id; }
|
||||
theory_id get_from_theory() const override { return null_theory_id; }
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -1074,7 +1074,7 @@ namespace smt {
|
|||
derived_bound * new_bound = alloc(derived_bound, v, inf_numeral(k), lower ? B_LOWER : B_UPPER);
|
||||
t.m_tmp_lit_set.reset();
|
||||
t.m_tmp_eq_set.reset();
|
||||
if (old_bound != 0) {
|
||||
if (old_bound != nullptr) {
|
||||
t.accumulate_justification(*old_bound, *new_bound, numeral(0) /* refine for proof gen */, t.m_tmp_lit_set, t.m_tmp_eq_set);
|
||||
}
|
||||
unsigned_vector::const_iterator it = js.begin();
|
||||
|
@ -1174,8 +1174,8 @@ namespace smt {
|
|||
c2 = rational(c);
|
||||
TRACE("euclidean_solver_new", tout << "new fixed: " << c2 << "\n";);
|
||||
propagated = true;
|
||||
mk_lower(v, c2, 0, m_js);
|
||||
mk_upper(v, c2, 0, m_js);
|
||||
mk_lower(v, c2, nullptr, m_js);
|
||||
mk_upper(v, c2, nullptr, m_js);
|
||||
}
|
||||
else {
|
||||
TRACE("euclidean_solver", tout << "inequality can be tightned, since all coefficients are multiple of: " << g << "\n";);
|
||||
|
@ -1187,7 +1187,7 @@ namespace smt {
|
|||
bound * l = t.lower(v);
|
||||
bound * u = t.upper(v);
|
||||
c2 = rational(c);
|
||||
if (l != 0) {
|
||||
if (l != nullptr) {
|
||||
rational l_old = l->get_value().get_rational().to_rational();
|
||||
rational l_new = g*ceil((l_old - c2)/g) + c2;
|
||||
TRACE("euclidean_solver_new", tout << "new lower: " << l_new << " old: " << l_old << "\n";
|
||||
|
@ -1197,7 +1197,7 @@ namespace smt {
|
|||
mk_lower(v, l_new, l, m_js);
|
||||
}
|
||||
}
|
||||
if (u != 0) {
|
||||
if (u != nullptr) {
|
||||
rational u_old = u->get_value().get_rational().to_rational();
|
||||
rational u_new = g*floor((u_old - c2)/g) + c2;
|
||||
TRACE("euclidean_solver_new", tout << "new upper: " << u_new << " old: " << u_old << "\n";);
|
||||
|
@ -1223,7 +1223,7 @@ namespace smt {
|
|||
continue; // skip equations...
|
||||
if (!t.is_int(v))
|
||||
continue; // skip non integer definitions...
|
||||
if (t.lower(v) == 0 && t.upper(v) == 0)
|
||||
if (t.lower(v) == nullptr && t.upper(v) == nullptr)
|
||||
continue; // there is nothing to be tightned
|
||||
if (tight_bounds(v))
|
||||
propagated = true;
|
||||
|
|
|
@ -141,8 +141,8 @@ namespace smt {
|
|||
\brief Return the number of variables that
|
||||
do not have bounds associated with it.
|
||||
The result is 0, 1, or 2. The value 2 means "2 or more".
|
||||
The second value is the idx of the a variable that does not
|
||||
have bounds associated with it. It is only usefull when the first value is 1.
|
||||
The second value is the idx of the variable that does not
|
||||
have bounds associated with it. It is only useful when the first value is 1.
|
||||
The second value is -1 if such variable does not exist, that is, the first
|
||||
value is 0.
|
||||
|
||||
|
@ -161,14 +161,14 @@ namespace smt {
|
|||
template<typename Ext>
|
||||
std::pair<unsigned, int> theory_arith<Ext>::analyze_monomial(expr * m) const {
|
||||
SASSERT(is_pure_monomial(m));
|
||||
expr * var = 0;
|
||||
expr * var = nullptr;
|
||||
unsigned power = 0;
|
||||
unsigned c = 0;
|
||||
int free_var_idx = -1;
|
||||
int idx = 0;
|
||||
for (unsigned i = 0; i < to_app(m)->get_num_args(); i++) {
|
||||
expr * arg = to_app(m)->get_arg(i);
|
||||
if (var == 0) {
|
||||
if (var == nullptr) {
|
||||
var = arg;
|
||||
power = 1;
|
||||
}
|
||||
|
@ -227,7 +227,7 @@ namespace smt {
|
|||
SASSERT(!m_util.is_numeral(m));
|
||||
if (m_util.is_mul(m)) {
|
||||
unsigned num_vars = 0;
|
||||
expr * var = 0;
|
||||
expr * var = nullptr;
|
||||
for (unsigned i = 0; i < to_app(m)->get_num_args(); i++) {
|
||||
expr * curr = to_app(m)->get_arg(i);
|
||||
if (var != curr) {
|
||||
|
@ -252,12 +252,12 @@ namespace smt {
|
|||
m = get_monomial_body(m);
|
||||
if (m_util.is_mul(m)) {
|
||||
unsigned curr_idx = 0;
|
||||
expr * var = 0;
|
||||
expr * var = nullptr;
|
||||
unsigned power = 0;
|
||||
unsigned j;
|
||||
for (j = 0; j < to_app(m)->get_num_args(); j++) {
|
||||
expr * arg = to_app(m)->get_arg(j);
|
||||
if (var == 0) {
|
||||
if (var == nullptr) {
|
||||
var = arg;
|
||||
power = 1;
|
||||
}
|
||||
|
@ -471,7 +471,7 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
bound * old_lower = lower(v);
|
||||
if (old_lower == 0 || new_lower > old_lower->get_value()) {
|
||||
if (old_lower == nullptr || new_lower > old_lower->get_value()) {
|
||||
TRACE("non_linear", tout << "NEW lower bound for v" << v << " " << new_lower << "\n";
|
||||
display_interval(tout, i); tout << "\n";);
|
||||
mk_derived_nl_bound(v, new_lower, B_LOWER, i.get_lower_dependencies());
|
||||
|
@ -494,7 +494,7 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
bound * old_upper = upper(v);
|
||||
if (old_upper == 0 || new_upper < old_upper->get_value()) {
|
||||
if (old_upper == nullptr || new_upper < old_upper->get_value()) {
|
||||
TRACE("non_linear", tout << "NEW upper bound for v" << v << " " << new_upper << "\n";
|
||||
display_interval(tout, i); tout << "\n";);
|
||||
mk_derived_nl_bound(v, new_upper, B_UPPER, i.get_upper_dependencies());
|
||||
|
@ -711,6 +711,7 @@ namespace smt {
|
|||
if (ctx.is_relevant(get_enode(*it)) && !check_monomial_assignment(*it, computed_epsilon)) {
|
||||
TRACE("non_linear_failed", tout << "check_monomial_assignment failed for:\n" << mk_ismt2_pp(var2expr(*it), get_manager()) << "\n";
|
||||
display_var(tout, *it););
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -787,7 +788,7 @@ namespace smt {
|
|||
TRACE("non_linear", tout << "BRANCHING on v" << v << "\n";);
|
||||
m_stats.m_nl_branching++;
|
||||
SASSERT(is_int(v));
|
||||
expr * bound = 0;
|
||||
expr * bound = nullptr;
|
||||
if (lower(v))
|
||||
bound = m_util.mk_le(var2expr(v), m_util.mk_numeral(lower_bound(v).get_rational().to_rational(), true));
|
||||
else if (upper(v))
|
||||
|
@ -856,7 +857,7 @@ namespace smt {
|
|||
if (!is_fixed(_var))
|
||||
return arg;
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -881,12 +882,12 @@ namespace smt {
|
|||
|
||||
numeral k = get_monomial_fixed_var_product(m);
|
||||
TRACE("non_linear", tout << "new linear monomial... k: " << k << "\n";);
|
||||
expr * x_n = k.is_zero() ? 0 : get_monomial_non_fixed_var(m);
|
||||
expr * x_n = k.is_zero() ? nullptr : get_monomial_non_fixed_var(m);
|
||||
TRACE("non_linear_bug", if (x_n != 0) { tout << "x_n: " << mk_bounded_pp(x_n, get_manager()) << "\nx_n: #" << x_n->get_id() << "\n"; });
|
||||
context & ctx = get_context();
|
||||
derived_bound * new_lower = 0;
|
||||
derived_bound * new_upper = 0;
|
||||
if (x_n != 0) {
|
||||
derived_bound * new_lower = nullptr;
|
||||
derived_bound * new_upper = nullptr;
|
||||
if (x_n != nullptr) {
|
||||
// All but one of the x_i variables are assigned.
|
||||
// Let x_n be the unassigned variable.
|
||||
// Then, we know that x_1*...*x_n = k*x_n, where k is the product of beta(x_1)*...*beta(x_{n-1})
|
||||
|
@ -1266,7 +1267,7 @@ namespace smt {
|
|||
expr * var = ce.second;
|
||||
if (!c.is_one()) {
|
||||
rational c2;
|
||||
expr * m = 0;
|
||||
expr * m = nullptr;
|
||||
if (m_util.is_numeral(var, c2))
|
||||
m = m_util.mk_numeral(c*c2, m_util.is_int(var) && c.is_int() && c2.is_int());
|
||||
else
|
||||
|
@ -1491,7 +1492,7 @@ namespace smt {
|
|||
r.push_back(coeff_expr(kv.first, f));
|
||||
}
|
||||
}
|
||||
expr * s = cross_nested(e, 0);
|
||||
expr * s = cross_nested(e, nullptr);
|
||||
if (!r.empty()) {
|
||||
expr * q = horner(r, var);
|
||||
// TODO: improve here
|
||||
|
@ -1518,7 +1519,7 @@ namespace smt {
|
|||
template<typename Ext>
|
||||
expr * theory_arith<Ext>::cross_nested(sbuffer<coeff_expr> & p, expr * var) {
|
||||
TRACE("non_linear", tout << "p.size: " << p.size() << "\n";);
|
||||
if (var == 0) {
|
||||
if (var == nullptr) {
|
||||
sbuffer<var_num_occs> varinfo;
|
||||
get_polynomial_info(p, varinfo);
|
||||
if (varinfo.empty())
|
||||
|
@ -1555,7 +1556,7 @@ namespace smt {
|
|||
tout << "b: " << b << "\n";
|
||||
tout << "nm: " << nm << "\n";);
|
||||
SASSERT(n != nm);
|
||||
expr * new_expr = 0;
|
||||
expr * new_expr = nullptr;
|
||||
if (nm < n) {
|
||||
std::swap(n, nm);
|
||||
std::swap(a, b);
|
||||
|
@ -1575,7 +1576,7 @@ namespace smt {
|
|||
expr * xm_a2b = m_util.mk_add(m_util.mk_numeral(a2b, m_util.is_int(var)), xm);
|
||||
expr * xm_a2b2 = m_util.mk_mul(xm_a2b, xm_a2b);
|
||||
expr * rhs = m_util.mk_add(xm_a2b2, m_util.mk_numeral(ma2b2, m_util.is_int(var)));
|
||||
expr * rhs2 = 0;
|
||||
expr * rhs2 = nullptr;
|
||||
if (n > m)
|
||||
rhs2 = m_util.mk_mul(power(var, n - m), rhs);
|
||||
else
|
||||
|
@ -1592,7 +1593,7 @@ namespace smt {
|
|||
if (rest.empty())
|
||||
return new_expr;
|
||||
TRACE("non_linear", tout << "rest size: " << rest.size() << ", i1: " << i1 << ", i2: " << i2 << "\n";);
|
||||
expr * h = cross_nested(rest, 0);
|
||||
expr * h = cross_nested(rest, nullptr);
|
||||
expr * r = m_util.mk_add(new_expr, h);
|
||||
m_nl_new_exprs.push_back(r);
|
||||
return r;
|
||||
|
@ -1630,7 +1631,7 @@ namespace smt {
|
|||
tout << "c:\n" << mk_ismt2_pp(cn, get_manager()) << "\n";);
|
||||
interval i = evaluate_as_interval(cn);
|
||||
TRACE("cross_nested", tout << "interval: " << i << "\n";);
|
||||
v_dependency * d = 0;
|
||||
v_dependency * d = nullptr;
|
||||
if (!i.minus_infinity() && (i.get_lower_value().is_pos() || (i.get_lower_value().is_zero() && i.is_lower_open())))
|
||||
d = i.get_lower_dependencies();
|
||||
else if (!i.plus_infinity() && (i.get_upper_value().is_neg() || (i.get_upper_value().is_zero() && i.is_upper_open())))
|
||||
|
@ -1822,7 +1823,7 @@ namespace smt {
|
|||
if (!coeff.is_zero())
|
||||
return gb.mk_monomial(coeff, vars.size(), vars.c_ptr());
|
||||
else
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1833,7 +1834,7 @@ namespace smt {
|
|||
void theory_arith<Ext>::add_row_to_gb(row const & r, grobner & gb) {
|
||||
TRACE("non_linear", tout << "adding row to gb\n"; display_row(tout, r););
|
||||
ptr_buffer<grobner::monomial> monomials;
|
||||
v_dependency * dep = 0;
|
||||
v_dependency * dep = nullptr;
|
||||
m_tmp_var_set.reset();
|
||||
typename vector<row_entry>::const_iterator it = r.begin_entries();
|
||||
typename vector<row_entry>::const_iterator end = r.end_entries();
|
||||
|
@ -1859,7 +1860,7 @@ namespace smt {
|
|||
template<typename Ext>
|
||||
void theory_arith<Ext>::add_monomial_def_to_gb(theory_var v, grobner & gb) {
|
||||
ptr_buffer<grobner::monomial> monomials;
|
||||
v_dependency * dep = 0;
|
||||
v_dependency * dep = nullptr;
|
||||
m_tmp_var_set.reset();
|
||||
expr * m = var2expr(v);
|
||||
SASSERT(is_pure_monomial(m));
|
||||
|
@ -1871,7 +1872,7 @@ namespace smt {
|
|||
dep = m_dep_manager.mk_join(dep, m_dep_manager.mk_join(m_dep_manager.mk_leaf(lower(v)), m_dep_manager.mk_leaf(upper(v))));
|
||||
coeff *= lower_bound(v).get_rational().to_rational();
|
||||
if (!coeff.is_zero())
|
||||
monomials.push_back(gb.mk_monomial(coeff, 0, 0));
|
||||
monomials.push_back(gb.mk_monomial(coeff, 0, nullptr));
|
||||
}
|
||||
else {
|
||||
monomials.push_back(gb.mk_monomial(coeff, 1, &m));
|
||||
|
@ -1903,12 +1904,12 @@ namespace smt {
|
|||
template<typename Ext>
|
||||
interval theory_arith<Ext>::mk_interval_for(grobner::monomial const * m) {
|
||||
interval r(m_dep_manager, rational(m->get_coeff()));
|
||||
expr * var = 0;
|
||||
expr * var = nullptr;
|
||||
unsigned power = 0;
|
||||
unsigned num_vars = m->get_degree();
|
||||
for (unsigned i = 0; i < num_vars; i++) {
|
||||
expr * curr = m->get_var(i);
|
||||
if (var == 0) {
|
||||
if (var == nullptr) {
|
||||
var = curr;
|
||||
power = 1;
|
||||
}
|
||||
|
@ -1921,7 +1922,7 @@ namespace smt {
|
|||
power = 1;
|
||||
}
|
||||
}
|
||||
if (var != 0)
|
||||
if (var != nullptr)
|
||||
mul_bound_of(var, power, r);
|
||||
return r;
|
||||
}
|
||||
|
@ -1956,7 +1957,7 @@ namespace smt {
|
|||
return false;
|
||||
}
|
||||
TRACE("non_linear_bug", tout << "is_inconsistent, r: " << r << "\n";);
|
||||
v_dependency * interval_deps = 0;
|
||||
v_dependency * interval_deps = nullptr;
|
||||
bool conflict = false;
|
||||
if (!r.minus_infinity() && (r.get_lower_value().is_pos() || (r.get_lower_value().is_zero() && r.is_lower_open()))) {
|
||||
interval_deps = r.get_lower_dependencies();
|
||||
|
@ -2001,11 +2002,11 @@ namespace smt {
|
|||
return false;
|
||||
if (!m->get_coeff().is_perfect_square(r))
|
||||
return false;
|
||||
expr * var = 0;
|
||||
expr * var = nullptr;
|
||||
unsigned power = 0;
|
||||
for (unsigned i = 0; i < num_vars; i++) {
|
||||
expr * curr = m->get_var(i);
|
||||
if (var == 0) {
|
||||
if (var == nullptr) {
|
||||
var = curr;
|
||||
power = 1;
|
||||
}
|
||||
|
@ -2049,18 +2050,18 @@ namespace smt {
|
|||
unsigned i1, i2, i12;
|
||||
i1 = i2 = i12 = 0;
|
||||
while (true) {
|
||||
expr * v1 = 0;
|
||||
expr * v2 = 0;
|
||||
expr * v12 = 0;
|
||||
expr * v1 = nullptr;
|
||||
expr * v2 = nullptr;
|
||||
expr * v12 = nullptr;
|
||||
if (i1 < num1)
|
||||
v1 = m1_sq->get_var(i1);
|
||||
if (i2 < num2)
|
||||
v2 = m2_sq->get_var(i2);
|
||||
if (i12 < num12)
|
||||
v12 = m1m2->get_var(i12);
|
||||
if (v1 == 0 && v2 == 0 && v12 == 0)
|
||||
if (v1 == nullptr && v2 == nullptr && v12 == nullptr)
|
||||
return true;
|
||||
if (v12 == 0)
|
||||
if (v12 == nullptr)
|
||||
return false;
|
||||
if (v1 == v12) {
|
||||
SASSERT(m1_sq->get_var(i1+1) == v1);
|
||||
|
@ -2161,7 +2162,7 @@ namespace smt {
|
|||
}
|
||||
if (monomials.size() == num)
|
||||
return false; // didn't find any perfect square.
|
||||
interval ge_zero(m_dep_manager, rational(0), false, true, 0);
|
||||
interval ge_zero(m_dep_manager, rational(0), false, true, nullptr);
|
||||
if (is_inconsistent(ge_zero, monomials.size(), monomials.c_ptr(), eq->get_dependency())) {
|
||||
TRACE("non_linear", tout << "found conflict\n"; gb.display_equation(tout, *eq););
|
||||
return true;
|
||||
|
|
|
@ -504,7 +504,7 @@ namespace smt {
|
|||
pp.add_assumption(eq);
|
||||
}
|
||||
else {
|
||||
if (lower(v) != 0) {
|
||||
if (lower(v) != nullptr) {
|
||||
inf_numeral k_inf = lower_bound(v);
|
||||
rational k = k_inf.get_rational().to_rational();
|
||||
expr_ref ineq(m);
|
||||
|
@ -514,7 +514,7 @@ namespace smt {
|
|||
ineq = m_util.mk_lt(m_util.mk_numeral(k, is_int(v)), n);
|
||||
pp.add_assumption(ineq);
|
||||
}
|
||||
if (upper(v) != 0) {
|
||||
if (upper(v) != nullptr) {
|
||||
inf_numeral k_inf = upper_bound(v);
|
||||
rational k = k_inf.get_rational().to_rational();
|
||||
expr_ref ineq(m);
|
||||
|
@ -526,7 +526,7 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
}
|
||||
pp.display(out, m.mk_true());
|
||||
pp.display_smt2(out, m.mk_true());
|
||||
}
|
||||
|
||||
template<typename Ext>
|
||||
|
|
|
@ -55,19 +55,19 @@ namespace smt {
|
|||
th_trail_stack m_trail_stack;
|
||||
unsigned m_final_check_idx;
|
||||
|
||||
virtual void init(context * ctx);
|
||||
virtual theory_var mk_var(enode * n);
|
||||
virtual bool internalize_atom(app * atom, bool gate_ctx);
|
||||
virtual bool internalize_term(app * term);
|
||||
virtual void apply_sort_cnstr(enode * n, sort * s);
|
||||
virtual void new_eq_eh(theory_var v1, theory_var v2);
|
||||
virtual void new_diseq_eh(theory_var v1, theory_var v2);
|
||||
virtual void relevant_eh(app * n);
|
||||
virtual void push_scope_eh();
|
||||
virtual void pop_scope_eh(unsigned num_scopes);
|
||||
virtual final_check_status final_check_eh();
|
||||
virtual void reset_eh();
|
||||
virtual void init_search_eh() { m_final_check_idx = 0; }
|
||||
void init(context * ctx) override;
|
||||
theory_var mk_var(enode * n) override;
|
||||
bool internalize_atom(app * atom, bool gate_ctx) override;
|
||||
bool internalize_term(app * term) override;
|
||||
void apply_sort_cnstr(enode * n, sort * s) override;
|
||||
void new_eq_eh(theory_var v1, theory_var v2) override;
|
||||
void new_diseq_eh(theory_var v1, theory_var v2) override;
|
||||
void relevant_eh(app * n) override;
|
||||
void push_scope_eh() override;
|
||||
void pop_scope_eh(unsigned num_scopes) override;
|
||||
final_check_status final_check_eh() override;
|
||||
void reset_eh() override;
|
||||
void init_search_eh() override { m_final_check_idx = 0; }
|
||||
|
||||
virtual void set_prop_upward(theory_var v);
|
||||
virtual void set_prop_upward(enode* n);
|
||||
|
@ -96,15 +96,15 @@ namespace smt {
|
|||
static void display_ids(std::ostream & out, unsigned n, enode * const * v);
|
||||
public:
|
||||
theory_array(ast_manager & m, theory_array_params & params);
|
||||
virtual ~theory_array();
|
||||
~theory_array() override;
|
||||
|
||||
virtual theory * mk_fresh(context * new_ctx) { return alloc(theory_array, new_ctx->get_manager(), new_ctx->get_fparams()); }
|
||||
theory * mk_fresh(context * new_ctx) override { return alloc(theory_array, new_ctx->get_manager(), new_ctx->get_fparams()); }
|
||||
|
||||
virtual char const * get_name() const { return "array"; }
|
||||
char const * get_name() const override { return "array"; }
|
||||
|
||||
virtual void display_var(std::ostream & out, theory_var v) const;
|
||||
virtual void display(std::ostream & out) const;
|
||||
virtual void collect_statistics(::statistics & st) const;
|
||||
void display(std::ostream & out) const override;
|
||||
void collect_statistics(::statistics & st) const override;
|
||||
th_trail_stack & get_trail_stack() { return m_trail_stack; }
|
||||
virtual void merge_eh(theory_var v1, theory_var v2, theory_var, theory_var);
|
||||
static void after_merge_eh(theory_var r1, theory_var r2, theory_var v1, theory_var v2) {}
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
app * theory_array_base::mk_select(unsigned num_args, expr * const * args) {
|
||||
app * r = get_manager().mk_app(get_family_id(), OP_SELECT, 0, 0, num_args, args);
|
||||
app * r = get_manager().mk_app(get_family_id(), OP_SELECT, 0, nullptr, num_args, args);
|
||||
TRACE("mk_var_bug", tout << "mk_select: " << r->get_id() << " num_args: " << num_args;
|
||||
for (unsigned i = 0; i < num_args; i++) tout << " " << args[i]->get_id();
|
||||
tout << "\n";);
|
||||
|
@ -49,7 +49,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
app * theory_array_base::mk_store(unsigned num_args, expr * const * args) {
|
||||
return get_manager().mk_app(get_family_id(), OP_STORE, 0, 0, num_args, args);
|
||||
return get_manager().mk_app(get_family_id(), OP_STORE, 0, nullptr, num_args, args);
|
||||
}
|
||||
|
||||
app * theory_array_base::mk_default(expr * a) {
|
||||
|
@ -152,7 +152,7 @@ namespace smt {
|
|||
expr_ref sel1(m), sel2(m);
|
||||
bool init = false;
|
||||
literal conseq = null_literal;
|
||||
expr * conseq_expr = 0;
|
||||
expr * conseq_expr = nullptr;
|
||||
|
||||
for (unsigned i = 0; i < num_args; i++) {
|
||||
enode * idx1 = js[i];
|
||||
|
@ -212,7 +212,7 @@ namespace smt {
|
|||
|
||||
func_decl_ref_vector * theory_array_base::register_sort(sort * s_array) {
|
||||
unsigned dimension = get_dimension(s_array);
|
||||
func_decl_ref_vector * ext_skolems = 0;
|
||||
func_decl_ref_vector * ext_skolems = nullptr;
|
||||
if (!m_sort2skolem.find(s_array, ext_skolems)) {
|
||||
array_util util(get_manager());
|
||||
ast_manager & m = get_manager();
|
||||
|
@ -305,7 +305,7 @@ namespace smt {
|
|||
context & ctx = get_context();
|
||||
ast_manager & m = get_manager();
|
||||
|
||||
func_decl_ref_vector * funcs = 0;
|
||||
func_decl_ref_vector * funcs = nullptr;
|
||||
sort * s = m.get_sort(e1);
|
||||
|
||||
VERIFY(m_sort2skolem.find(s, funcs));
|
||||
|
@ -495,7 +495,7 @@ namespace smt {
|
|||
void theory_array_base::restore_sorts(unsigned old_size) {
|
||||
while (m_sorts_trail.size() > old_size) {
|
||||
sort * s = m_sorts_trail.back();
|
||||
func_decl_ref_vector * funcs = 0;
|
||||
func_decl_ref_vector * funcs = nullptr;
|
||||
if (m_sort2skolem.find(s, funcs)) {
|
||||
m_sort2skolem.remove(s);
|
||||
dealloc(funcs);
|
||||
|
@ -672,9 +672,9 @@ namespace smt {
|
|||
|
||||
theory_array_base::select_set * theory_array_base::get_select_set(enode * n) {
|
||||
enode * r = n->get_root();
|
||||
select_set * set = 0;
|
||||
select_set * set = nullptr;
|
||||
m_selects.find(r, set);
|
||||
if (set == 0) {
|
||||
if (set == nullptr) {
|
||||
set = alloc(select_set);
|
||||
m_selects.insert(r, set);
|
||||
m_selects_domain.push_back(r);
|
||||
|
@ -795,7 +795,7 @@ namespace smt {
|
|||
m_sort(s),
|
||||
m_num_entries(0),
|
||||
m_dim(0),
|
||||
m_else(0),
|
||||
m_else(nullptr),
|
||||
m_unspecified_else(false) {
|
||||
m_dependencies.push_back(model_value_dependency(v));
|
||||
}
|
||||
|
@ -814,7 +814,7 @@ namespace smt {
|
|||
m_sort(s),
|
||||
m_num_entries(0),
|
||||
m_dim(0),
|
||||
m_else(0),
|
||||
m_else(nullptr),
|
||||
m_unspecified_else(false) {
|
||||
m_dependencies.push_back(model_value_dependency(else_value));
|
||||
}
|
||||
|
@ -824,11 +824,11 @@ namespace smt {
|
|||
m_sort(s),
|
||||
m_num_entries(0),
|
||||
m_dim(0),
|
||||
m_else(0),
|
||||
m_else(nullptr),
|
||||
m_unspecified_else(true) {
|
||||
}
|
||||
|
||||
virtual ~array_value_proc() {}
|
||||
~array_value_proc() override {}
|
||||
|
||||
void add_entry(unsigned num_args, enode * const * args, enode * value) {
|
||||
SASSERT(num_args > 0);
|
||||
|
@ -840,11 +840,11 @@ namespace smt {
|
|||
m_dependencies.push_back(model_value_dependency(value));
|
||||
}
|
||||
|
||||
virtual void get_dependencies(buffer<model_value_dependency> & result) {
|
||||
void get_dependencies(buffer<model_value_dependency> & result) override {
|
||||
result.append(m_dependencies.size(), m_dependencies.c_ptr());
|
||||
}
|
||||
|
||||
virtual app * mk_value(model_generator & mg, ptr_vector<expr> & values) {
|
||||
app * mk_value(model_generator & mg, ptr_vector<expr> & values) override {
|
||||
// values must have size = m_num_entries * (m_dim + 1) + ((m_else || m_unspecified_else) ? 0 : 1)
|
||||
// an array value is a lookup table + else_value
|
||||
// each entry has m_dim indexes that map to a value.
|
||||
|
@ -888,14 +888,14 @@ namespace smt {
|
|||
SASSERT(v != null_theory_var);
|
||||
sort * s = get_manager().get_sort(n->get_owner());
|
||||
enode * else_val_n = get_default(v);
|
||||
array_value_proc * result = 0;
|
||||
array_value_proc * result = nullptr;
|
||||
|
||||
if (m_use_unspecified_default) {
|
||||
SASSERT(else_val_n == 0);
|
||||
result = alloc(array_value_proc, get_id(), s);
|
||||
}
|
||||
else {
|
||||
if (else_val_n != 0) {
|
||||
if (else_val_n != nullptr) {
|
||||
SASSERT(get_context().is_relevant(else_val_n));
|
||||
result = alloc(array_value_proc, get_id(), s, else_val_n);
|
||||
}
|
||||
|
@ -905,7 +905,7 @@ namespace smt {
|
|||
// DISABLED. It seems wrong, since different nodes can share the same
|
||||
// else_val according to the mg class.
|
||||
// SASSERT(else_val == 0 || get_context().is_relevant(UNTAG(app*, else_val)));
|
||||
if (else_val == 0) {
|
||||
if (else_val == nullptr) {
|
||||
sort * range = to_sort(s->get_parameter(s->get_num_parameters() - 1).get_ast());
|
||||
// IMPORTANT:
|
||||
// The implementation should not assume a fresh value is created for
|
||||
|
@ -925,9 +925,9 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
SASSERT(result != 0);
|
||||
select_set * sel_set = 0;
|
||||
select_set * sel_set = nullptr;
|
||||
m_selects.find(n->get_root(), sel_set);
|
||||
if (sel_set != 0) {
|
||||
if (sel_set != nullptr) {
|
||||
ptr_buffer<enode> args;
|
||||
select_set::iterator it = sel_set->begin();
|
||||
select_set::iterator end = sel_set->end();
|
||||
|
|
|
@ -123,15 +123,15 @@ namespace smt {
|
|||
//
|
||||
//
|
||||
// --------------------------------------------------
|
||||
virtual bool is_shared(theory_var v) const;
|
||||
bool is_shared(theory_var v) const override;
|
||||
void collect_shared_vars(sbuffer<theory_var> & result);
|
||||
unsigned mk_interface_eqs();
|
||||
|
||||
virtual bool can_propagate();
|
||||
virtual void propagate();
|
||||
virtual void push_scope_eh();
|
||||
virtual void pop_scope_eh(unsigned num_scopes);
|
||||
virtual void reset_eh();
|
||||
bool can_propagate() override;
|
||||
void propagate() override;
|
||||
void push_scope_eh() override;
|
||||
void pop_scope_eh(unsigned num_scopes) override;
|
||||
void reset_eh() override;
|
||||
|
||||
void reset_queues();
|
||||
// -----------------------------------
|
||||
|
@ -177,7 +177,7 @@ namespace smt {
|
|||
void set_default(theory_var v, enode* n);
|
||||
enode* get_default(theory_var v);
|
||||
|
||||
virtual void init_model(model_generator & m);
|
||||
void init_model(model_generator & m) override;
|
||||
bool is_unspecified_default_ok() const;
|
||||
void collect_defaults();
|
||||
void collect_selects();
|
||||
|
@ -185,12 +185,12 @@ namespace smt {
|
|||
void propagate_selects_to_store_parents(enode * r, enode_pair_vector & todo);
|
||||
void propagate_selects();
|
||||
select_set * get_select_set(enode * n);
|
||||
virtual void finalize_model(model_generator & m);
|
||||
virtual model_value_proc * mk_value(enode * n, model_generator & m);
|
||||
void finalize_model(model_generator & m) override;
|
||||
model_value_proc * mk_value(enode * n, model_generator & m) override;
|
||||
|
||||
public:
|
||||
theory_array_base(ast_manager & m);
|
||||
virtual ~theory_array_base() { restore_sorts(0); }
|
||||
~theory_array_base() override { restore_sorts(0); }
|
||||
};
|
||||
|
||||
};
|
||||
|
|
|
@ -746,7 +746,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
app* theory_array_full::mk_epsilon(sort* s) {
|
||||
app* eps = 0;
|
||||
app* eps = nullptr;
|
||||
if (m_sort2epsilon.find(s, eps)) {
|
||||
return eps;
|
||||
}
|
||||
|
|
|
@ -42,29 +42,29 @@ namespace smt {
|
|||
protected:
|
||||
|
||||
//virtual final_check_status final_check_eh();
|
||||
virtual void reset_eh();
|
||||
void reset_eh() override;
|
||||
|
||||
virtual void set_prop_upward(theory_var v);
|
||||
virtual void set_prop_upward(enode* n);
|
||||
virtual void set_prop_upward(theory_var v, var_data* d);
|
||||
virtual unsigned get_lambda_equiv_size(theory_var v, var_data* d);
|
||||
void set_prop_upward(theory_var v) override;
|
||||
void set_prop_upward(enode* n) override;
|
||||
void set_prop_upward(theory_var v, var_data* d) override;
|
||||
unsigned get_lambda_equiv_size(theory_var v, var_data* d) override;
|
||||
|
||||
|
||||
virtual bool internalize_term(app * term);
|
||||
virtual bool internalize_atom(app * atom, bool gate_ctx);
|
||||
virtual void pop_scope_eh(unsigned num_scopes);
|
||||
virtual theory_var mk_var(enode * n);
|
||||
virtual void relevant_eh(app * n);
|
||||
bool internalize_term(app * term) override;
|
||||
bool internalize_atom(app * atom, bool gate_ctx) override;
|
||||
void pop_scope_eh(unsigned num_scopes) override;
|
||||
theory_var mk_var(enode * n) override;
|
||||
void relevant_eh(app * n) override;
|
||||
|
||||
void add_const(theory_var v, enode* c);
|
||||
void add_map(theory_var v, enode* s);
|
||||
void add_parent_map(theory_var v, enode* s);
|
||||
void add_as_array(theory_var v, enode* arr);
|
||||
|
||||
virtual void add_parent_select(theory_var v, enode * s);
|
||||
void add_parent_select(theory_var v, enode * s) override;
|
||||
void add_parent_default(theory_var v);
|
||||
|
||||
virtual final_check_status assert_delayed_axioms();
|
||||
final_check_status assert_delayed_axioms() override;
|
||||
|
||||
bool instantiate_default_const_axiom(enode* cnst);
|
||||
bool instantiate_default_store_axiom(enode* store);
|
||||
|
@ -87,14 +87,14 @@ namespace smt {
|
|||
|
||||
public:
|
||||
theory_array_full(ast_manager & m, theory_array_params & params);
|
||||
virtual ~theory_array_full();
|
||||
~theory_array_full() override;
|
||||
|
||||
virtual theory * mk_fresh(context * new_ctx);
|
||||
theory * mk_fresh(context * new_ctx) override;
|
||||
|
||||
virtual void merge_eh(theory_var v1, theory_var v2, theory_var, theory_var);
|
||||
virtual void display_var(std::ostream & out, theory_var v) const;
|
||||
virtual void collect_statistics(::statistics & st) const;
|
||||
virtual void init(context* ctx) {
|
||||
void merge_eh(theory_var v1, theory_var v2, theory_var, theory_var) override;
|
||||
void display_var(std::ostream & out, theory_var v) const override;
|
||||
void collect_statistics(::statistics & st) const override;
|
||||
void init(context* ctx) override {
|
||||
// the parent class is theory_array.
|
||||
// theory::init(ctx);
|
||||
theory_array::init(ctx);
|
||||
|
|
|
@ -65,7 +65,7 @@ namespace smt {
|
|||
bool_var m_var;
|
||||
public:
|
||||
mk_atom_trail(bool_var v):m_var(v) {}
|
||||
virtual void undo(theory_bv & th) {
|
||||
void undo(theory_bv & th) override {
|
||||
theory_bv::atom * a = th.get_bv2a(m_var);
|
||||
a->~atom();
|
||||
th.erase_bv2a(m_var);
|
||||
|
@ -213,7 +213,7 @@ namespace smt {
|
|||
theory_bv::bit_atom * m_atom;
|
||||
public:
|
||||
add_var_pos_trail(theory_bv::bit_atom * a):m_atom(a) {}
|
||||
virtual void undo(theory_bv & th) {
|
||||
void undo(theory_bv & th) override {
|
||||
SASSERT(m_atom->m_occs);
|
||||
m_atom->m_occs = m_atom->m_occs->m_next;
|
||||
}
|
||||
|
@ -373,7 +373,7 @@ namespace smt {
|
|||
void get_proof(conflict_resolution & cr, literal l, ptr_buffer<proof> & prs, bool & visited) {
|
||||
if (l.var() == true_bool_var)
|
||||
return;
|
||||
proof * pr = 0;
|
||||
proof * pr = nullptr;
|
||||
if (cr.get_context().get_assignment(l) == l_true)
|
||||
pr = cr.get_proof(l);
|
||||
else
|
||||
|
@ -389,12 +389,12 @@ namespace smt {
|
|||
m_th(th), m_var1(v1), m_var2(v2) {
|
||||
}
|
||||
|
||||
virtual void get_antecedents(conflict_resolution & cr) {
|
||||
void get_antecedents(conflict_resolution & cr) override {
|
||||
mark_bits(cr, m_th.m_bits[m_var1]);
|
||||
mark_bits(cr, m_th.m_bits[m_var2]);
|
||||
}
|
||||
|
||||
virtual proof * mk_proof(conflict_resolution & cr) {
|
||||
proof * mk_proof(conflict_resolution & cr) override {
|
||||
ptr_buffer<proof> prs;
|
||||
context & ctx = cr.get_context();
|
||||
bool visited = true;
|
||||
|
@ -408,17 +408,17 @@ namespace smt {
|
|||
get_proof(cr, *it2, prs, visited);
|
||||
}
|
||||
if (!visited)
|
||||
return 0;
|
||||
return nullptr;
|
||||
expr * fact = ctx.mk_eq_atom(m_th.get_enode(m_var1)->get_owner(), m_th.get_enode(m_var2)->get_owner());
|
||||
ast_manager & m = ctx.get_manager();
|
||||
return m.mk_th_lemma(get_from_theory(), fact, prs.size(), prs.c_ptr());
|
||||
}
|
||||
|
||||
virtual theory_id get_from_theory() const {
|
||||
theory_id get_from_theory() const override {
|
||||
return m_th.get_id();
|
||||
}
|
||||
|
||||
virtual char const * get_name() const { return "bv-fixed-eq"; }
|
||||
char const * get_name() const override { return "bv-fixed-eq"; }
|
||||
|
||||
};
|
||||
|
||||
|
@ -1510,13 +1510,13 @@ namespace smt {
|
|||
bit_eq_justification(theory_id th_id, enode * v1, enode * v2, literal c, literal a):
|
||||
m_v1(v1), m_v2(v2), m_th_id(th_id), m_consequent(c), m_antecedent(a) {}
|
||||
|
||||
virtual void get_antecedents(conflict_resolution & cr) {
|
||||
void get_antecedents(conflict_resolution & cr) override {
|
||||
cr.mark_eq(m_v1, m_v2);
|
||||
if (m_antecedent.var() != true_bool_var)
|
||||
cr.mark_literal(m_antecedent);
|
||||
}
|
||||
|
||||
virtual proof * mk_proof(conflict_resolution & cr) {
|
||||
proof * mk_proof(conflict_resolution & cr) override {
|
||||
bool visited = true;
|
||||
ptr_buffer<proof> prs;
|
||||
proof * pr = cr.get_proof(m_v1, m_v2);
|
||||
|
@ -1532,7 +1532,7 @@ namespace smt {
|
|||
visited = false;
|
||||
}
|
||||
if (!visited)
|
||||
return 0;
|
||||
return nullptr;
|
||||
context & ctx = cr.get_context();
|
||||
ast_manager & m = cr.get_manager();
|
||||
expr_ref fact(m);
|
||||
|
@ -1540,11 +1540,11 @@ namespace smt {
|
|||
return m.mk_th_lemma(get_from_theory(), fact, prs.size(), prs.c_ptr());
|
||||
}
|
||||
|
||||
virtual theory_id get_from_theory() const {
|
||||
theory_id get_from_theory() const override {
|
||||
return m_th_id;
|
||||
}
|
||||
|
||||
virtual char const * get_name() const { return "bv-bit-eq"; }
|
||||
char const * get_name() const override { return "bv-bit-eq"; }
|
||||
};
|
||||
|
||||
inline justification * theory_bv::mk_bit_eq_justification(theory_var v1, theory_var v2, literal consequent, literal antecedent) {
|
||||
|
|
|
@ -52,22 +52,22 @@ namespace smt {
|
|||
theory_var m_var;
|
||||
unsigned m_idx;
|
||||
var_pos_occ * m_next;
|
||||
var_pos_occ(theory_var v = null_theory_var, unsigned idx = 0, var_pos_occ * next = 0):m_var(v), m_idx(idx), m_next(next) {}
|
||||
var_pos_occ(theory_var v = null_theory_var, unsigned idx = 0, var_pos_occ * next = nullptr):m_var(v), m_idx(idx), m_next(next) {}
|
||||
};
|
||||
|
||||
struct bit_atom : public atom {
|
||||
var_pos_occ * m_occs;
|
||||
bit_atom():m_occs(0) {}
|
||||
virtual ~bit_atom() {}
|
||||
virtual bool is_bit() const { return true; }
|
||||
bit_atom():m_occs(nullptr) {}
|
||||
~bit_atom() override {}
|
||||
bool is_bit() const override { return true; }
|
||||
};
|
||||
|
||||
struct le_atom : public atom {
|
||||
literal m_var;
|
||||
literal m_def;
|
||||
le_atom(literal v, literal d):m_var(v), m_def(d) {}
|
||||
virtual ~le_atom() {}
|
||||
virtual bool is_bit() const { return false; }
|
||||
~le_atom() override {}
|
||||
bool is_bit() const override { return false; }
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -216,21 +216,21 @@ namespace smt {
|
|||
void assert_bv2int_axiom(app* n);
|
||||
|
||||
protected:
|
||||
virtual void init(context * ctx);
|
||||
virtual theory_var mk_var(enode * n);
|
||||
virtual bool internalize_atom(app * atom, bool gate_ctx);
|
||||
virtual bool internalize_term(app * term);
|
||||
virtual void apply_sort_cnstr(enode * n, sort * s);
|
||||
virtual void new_eq_eh(theory_var v1, theory_var v2);
|
||||
virtual void new_diseq_eh(theory_var v1, theory_var v2);
|
||||
void init(context * ctx) override;
|
||||
theory_var mk_var(enode * n) override;
|
||||
bool internalize_atom(app * atom, bool gate_ctx) override;
|
||||
bool internalize_term(app * term) override;
|
||||
void apply_sort_cnstr(enode * n, sort * s) override;
|
||||
void new_eq_eh(theory_var v1, theory_var v2) override;
|
||||
void new_diseq_eh(theory_var v1, theory_var v2) override;
|
||||
virtual void expand_diseq(theory_var v1, theory_var v2);
|
||||
virtual void assign_eh(bool_var v, bool is_true);
|
||||
virtual void relevant_eh(app * n);
|
||||
virtual void push_scope_eh();
|
||||
virtual void pop_scope_eh(unsigned num_scopes);
|
||||
virtual final_check_status final_check_eh();
|
||||
virtual void reset_eh();
|
||||
virtual bool include_func_interp(func_decl* f);
|
||||
void assign_eh(bool_var v, bool is_true) override;
|
||||
void relevant_eh(app * n) override;
|
||||
void push_scope_eh() override;
|
||||
void pop_scope_eh(unsigned num_scopes) override;
|
||||
final_check_status final_check_eh() override;
|
||||
void reset_eh() override;
|
||||
bool include_func_interp(func_decl* f) override;
|
||||
svector<theory_var> m_merge_aux[2]; //!< auxiliary vector used in merge_zero_one_bits
|
||||
bool merge_zero_one_bits(theory_var r1, theory_var r2);
|
||||
|
||||
|
@ -240,16 +240,16 @@ namespace smt {
|
|||
//
|
||||
// -----------------------------------
|
||||
bv_factory * m_factory;
|
||||
virtual void init_model(model_generator & m);
|
||||
virtual model_value_proc * mk_value(enode * n, model_generator & mg);
|
||||
void init_model(model_generator & m) override;
|
||||
model_value_proc * mk_value(enode * n, model_generator & mg) override;
|
||||
|
||||
public:
|
||||
theory_bv(ast_manager & m, theory_bv_params const & params, bit_blaster_params const & bb_params);
|
||||
virtual ~theory_bv();
|
||||
~theory_bv() override;
|
||||
|
||||
virtual theory * mk_fresh(context * new_ctx);
|
||||
theory * mk_fresh(context * new_ctx) override;
|
||||
|
||||
virtual char const * get_name() const { return "bit-vector"; }
|
||||
char const * get_name() const override { return "bit-vector"; }
|
||||
|
||||
th_trail_stack & get_trail_stack() { return m_trail_stack; }
|
||||
void merge_eh(theory_var, theory_var, theory_var v1, theory_var v2);
|
||||
|
@ -259,8 +259,8 @@ namespace smt {
|
|||
void display_var(std::ostream & out, theory_var v) const;
|
||||
void display_bit_atom(std::ostream & out, bool_var v, bit_atom const * a) const;
|
||||
void display_atoms(std::ostream & out) const;
|
||||
virtual void display(std::ostream & out) const;
|
||||
virtual void collect_statistics(::statistics & st) const;
|
||||
void display(std::ostream & out) const override;
|
||||
void collect_statistics(::statistics & st) const override;
|
||||
|
||||
bool get_fixed_value(app* x, numeral & result) const;
|
||||
|
||||
|
|
|
@ -30,10 +30,10 @@ namespace smt {
|
|||
class dt_eq_justification : public ext_theory_eq_propagation_justification {
|
||||
public:
|
||||
dt_eq_justification(family_id fid, region & r, literal antecedent, enode * lhs, enode * rhs):
|
||||
ext_theory_eq_propagation_justification(fid, r, 1, &antecedent, 0, 0, lhs, rhs) {
|
||||
ext_theory_eq_propagation_justification(fid, r, 1, &antecedent, 0, nullptr, lhs, rhs) {
|
||||
}
|
||||
// Remark: the assignment must be propagated back to the datatype theory.
|
||||
virtual theory_id get_from_theory() const { return null_theory_id; }
|
||||
theory_id get_from_theory() const override { return null_theory_id; }
|
||||
};
|
||||
|
||||
|
||||
|
@ -167,7 +167,7 @@ namespace smt {
|
|||
func_decl * upd = n->get_decl();
|
||||
func_decl * acc = to_func_decl(upd->get_parameter(0).get_ast());
|
||||
func_decl * con = m_util.get_accessor_constructor(acc);
|
||||
func_decl * rec = m_util.get_constructor_recognizer(con);
|
||||
func_decl * rec = m_util.get_constructor_is(con);
|
||||
ptr_vector<func_decl> const & accessors = *m_util.get_constructor_accessors(con);
|
||||
app_ref rec_app(m.mk_app(rec, arg1), m);
|
||||
ctx.internalize(rec_app, false);
|
||||
|
@ -340,12 +340,12 @@ namespace smt {
|
|||
func_decl * c = m_util.get_recognizer_constructor(r);
|
||||
if (is_true) {
|
||||
SASSERT(tv != null_theory_var);
|
||||
if (d->m_constructor != 0 && d->m_constructor->get_decl() == c)
|
||||
if (d->m_constructor != nullptr && d->m_constructor->get_decl() == c)
|
||||
return; // do nothing
|
||||
assert_is_constructor_axiom(arg, c, literal(v));
|
||||
}
|
||||
else {
|
||||
if (d->m_constructor != 0) {
|
||||
if (d->m_constructor != nullptr) {
|
||||
if (d->m_constructor->get_decl() == c) {
|
||||
// conflict
|
||||
sign_recognizer_conflict(d->m_constructor, n);
|
||||
|
@ -400,7 +400,7 @@ namespace smt {
|
|||
if (m_params.m_dt_lazy_splits > 0) {
|
||||
// using lazy case splits...
|
||||
var_data * d = m_var_data[v];
|
||||
if (d->m_constructor == 0) {
|
||||
if (d->m_constructor == nullptr) {
|
||||
mk_split(v);
|
||||
r = FC_CONTINUE;
|
||||
}
|
||||
|
@ -427,7 +427,7 @@ namespace smt {
|
|||
if (res) {
|
||||
context & ctx = get_context();
|
||||
region & r = ctx.get_region();
|
||||
ctx.set_conflict(ctx.mk_justification(ext_theory_conflict_justification(get_id(), r, 0, 0, m_used_eqs.size(), m_used_eqs.c_ptr())));
|
||||
ctx.set_conflict(ctx.mk_justification(ext_theory_conflict_justification(get_id(), r, 0, nullptr, m_used_eqs.size(), m_used_eqs.c_ptr())));
|
||||
TRACE("occurs_check",
|
||||
tout << "occurs_check: true\n";
|
||||
for (enode_pair const& p : m_used_eqs) {
|
||||
|
@ -551,11 +551,11 @@ namespace smt {
|
|||
public:
|
||||
datatype_value_proc(func_decl * d):m_constructor(d) {}
|
||||
void add_dependency(enode * n) { m_dependencies.push_back(model_value_dependency(n)); }
|
||||
virtual ~datatype_value_proc() {}
|
||||
virtual void get_dependencies(buffer<model_value_dependency> & result) {
|
||||
~datatype_value_proc() override {}
|
||||
void get_dependencies(buffer<model_value_dependency> & result) override {
|
||||
result.append(m_dependencies.size(), m_dependencies.c_ptr());
|
||||
}
|
||||
virtual app * mk_value(model_generator & mg, ptr_vector<expr> & values) {
|
||||
app * mk_value(model_generator & mg, ptr_vector<expr> & values) override {
|
||||
SASSERT(values.size() == m_dependencies.size());
|
||||
return mg.get_manager().mk_app(m_constructor, values.size(), values.c_ptr());
|
||||
}
|
||||
|
@ -581,21 +581,21 @@ namespace smt {
|
|||
SASSERT(v1 == static_cast<int>(m_find.find(v1)));
|
||||
var_data * d1 = m_var_data[v1];
|
||||
var_data * d2 = m_var_data[v2];
|
||||
if (d2->m_constructor != 0) {
|
||||
if (d2->m_constructor != nullptr) {
|
||||
context & ctx = get_context();
|
||||
if (d1->m_constructor != 0 && d1->m_constructor->get_decl() != d2->m_constructor->get_decl()) {
|
||||
if (d1->m_constructor != nullptr && d1->m_constructor->get_decl() != d2->m_constructor->get_decl()) {
|
||||
region & r = ctx.get_region();
|
||||
enode_pair p(d1->m_constructor, d2->m_constructor);
|
||||
SASSERT(d1->m_constructor->get_root() == d2->m_constructor->get_root());
|
||||
ctx.set_conflict(ctx.mk_justification(ext_theory_conflict_justification(get_id(), r, 0, 0, 1, &p)));
|
||||
ctx.set_conflict(ctx.mk_justification(ext_theory_conflict_justification(get_id(), r, 0, nullptr, 1, &p)));
|
||||
}
|
||||
if (d1->m_constructor == 0) {
|
||||
if (d1->m_constructor == nullptr) {
|
||||
m_trail_stack.push(set_ptr_trail<theory_datatype, enode>(d1->m_constructor));
|
||||
// check whether there is a recognizer in d1 that conflicts with d2->m_constructor;
|
||||
if (!d1->m_recognizers.empty()) {
|
||||
unsigned c_idx = m_util.get_constructor_idx(d2->m_constructor->get_decl());
|
||||
enode * recognizer = d1->m_recognizers[c_idx];
|
||||
if (recognizer != 0 && ctx.get_assignment(recognizer) == l_false) {
|
||||
if (recognizer != nullptr && ctx.get_assignment(recognizer) == l_false) {
|
||||
sign_recognizer_conflict(d2->m_constructor, recognizer);
|
||||
return;
|
||||
}
|
||||
|
@ -634,7 +634,7 @@ namespace smt {
|
|||
// Otherwise, it will be set when assign_eh is invoked.
|
||||
return;
|
||||
}
|
||||
if (val == l_false && d->m_constructor != 0) {
|
||||
if (val == l_false && d->m_constructor != nullptr) {
|
||||
func_decl * c_decl = m_util.get_recognizer_constructor(recognizer->get_decl());
|
||||
if (d->m_constructor->get_decl() == c_decl) {
|
||||
// conflict
|
||||
|
@ -710,7 +710,7 @@ namespace smt {
|
|||
literal consequent;
|
||||
if (!r) {
|
||||
ptr_vector<func_decl> const & constructors = *m_util.get_datatype_constructors(dt);
|
||||
func_decl * rec = m_util.get_constructor_recognizer(constructors[unassigned_idx]);
|
||||
func_decl * rec = m_util.get_constructor_is(constructors[unassigned_idx]);
|
||||
app * rec_app = get_manager().mk_app(rec, n->get_owner());
|
||||
ctx.internalize(rec_app, false);
|
||||
consequent = literal(ctx.get_bool_var(rec_app));
|
||||
|
@ -747,16 +747,16 @@ namespace smt {
|
|||
unsigned non_rec_idx = m_util.get_constructor_idx(non_rec_c);
|
||||
var_data * d = m_var_data[v];
|
||||
SASSERT(d->m_constructor == 0);
|
||||
func_decl * r = 0;
|
||||
func_decl * r = nullptr;
|
||||
m_stats.m_splits++;
|
||||
|
||||
if (d->m_recognizers.empty()) {
|
||||
r = m_util.get_constructor_recognizer(non_rec_c);
|
||||
r = m_util.get_constructor_is(non_rec_c);
|
||||
}
|
||||
else {
|
||||
enode * recognizer = d->m_recognizers[non_rec_idx];
|
||||
if (recognizer == 0) {
|
||||
r = m_util.get_constructor_recognizer(non_rec_c);
|
||||
if (recognizer == nullptr) {
|
||||
r = m_util.get_constructor_is(non_rec_c);
|
||||
}
|
||||
else if (!ctx.is_relevant(recognizer)) {
|
||||
ctx.mark_as_relevant(recognizer);
|
||||
|
@ -773,10 +773,10 @@ namespace smt {
|
|||
ptr_vector<enode>::const_iterator end = d->m_recognizers.end();
|
||||
for (unsigned idx = 0; it != end; ++it, ++idx) {
|
||||
enode * curr = *it;
|
||||
if (curr == 0) {
|
||||
if (curr == nullptr) {
|
||||
ptr_vector<func_decl> const & constructors = *m_util.get_datatype_constructors(s);
|
||||
// found empty slot...
|
||||
r = m_util.get_constructor_recognizer(constructors[idx]);
|
||||
r = m_util.get_constructor_is(constructors[idx]);
|
||||
break;
|
||||
}
|
||||
else if (!ctx.is_relevant(curr)) {
|
||||
|
@ -787,7 +787,7 @@ namespace smt {
|
|||
return;
|
||||
}
|
||||
}
|
||||
if (r == 0)
|
||||
if (r == nullptr)
|
||||
return; // all recognizers are asserted to false... conflict will be detected...
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace smt {
|
|||
ptr_vector<enode> m_recognizers; //!< recognizers of this equivalence class that are being watched.
|
||||
enode * m_constructor; //!< constructor of this equivalence class, 0 if there is no constructor in the eqc.
|
||||
var_data():
|
||||
m_constructor(0) {
|
||||
m_constructor(nullptr) {
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -84,35 +84,35 @@ namespace smt {
|
|||
void display_var(std::ostream & out, theory_var v) const;
|
||||
|
||||
protected:
|
||||
virtual theory_var mk_var(enode * n);
|
||||
virtual bool internalize_atom(app * atom, bool gate_ctx);
|
||||
virtual bool internalize_term(app * term);
|
||||
virtual void apply_sort_cnstr(enode * n, sort * s);
|
||||
virtual void new_eq_eh(theory_var v1, theory_var v2);
|
||||
virtual bool use_diseqs() const;
|
||||
virtual void new_diseq_eh(theory_var v1, theory_var v2);
|
||||
virtual void assign_eh(bool_var v, bool is_true);
|
||||
virtual void relevant_eh(app * n);
|
||||
virtual void push_scope_eh();
|
||||
virtual void pop_scope_eh(unsigned num_scopes);
|
||||
virtual final_check_status final_check_eh();
|
||||
virtual void reset_eh();
|
||||
virtual void restart_eh() { m_util.reset(); }
|
||||
virtual bool is_shared(theory_var v) const;
|
||||
theory_var mk_var(enode * n) override;
|
||||
bool internalize_atom(app * atom, bool gate_ctx) override;
|
||||
bool internalize_term(app * term) override;
|
||||
void apply_sort_cnstr(enode * n, sort * s) override;
|
||||
void new_eq_eh(theory_var v1, theory_var v2) override;
|
||||
bool use_diseqs() const override;
|
||||
void new_diseq_eh(theory_var v1, theory_var v2) override;
|
||||
void assign_eh(bool_var v, bool is_true) override;
|
||||
void relevant_eh(app * n) override;
|
||||
void push_scope_eh() override;
|
||||
void pop_scope_eh(unsigned num_scopes) override;
|
||||
final_check_status final_check_eh() override;
|
||||
void reset_eh() override;
|
||||
void restart_eh() override { m_util.reset(); }
|
||||
bool is_shared(theory_var v) const override;
|
||||
public:
|
||||
theory_datatype(ast_manager & m, theory_datatype_params & p);
|
||||
virtual ~theory_datatype();
|
||||
virtual theory * mk_fresh(context * new_ctx);
|
||||
virtual void display(std::ostream & out) const;
|
||||
virtual void collect_statistics(::statistics & st) const;
|
||||
virtual void init_model(model_generator & m);
|
||||
virtual model_value_proc * mk_value(enode * n, model_generator & m);
|
||||
~theory_datatype() override;
|
||||
theory * mk_fresh(context * new_ctx) override;
|
||||
void display(std::ostream & out) const override;
|
||||
void collect_statistics(::statistics & st) const override;
|
||||
void init_model(model_generator & m) override;
|
||||
model_value_proc * mk_value(enode * n, model_generator & m) override;
|
||||
th_trail_stack & get_trail_stack() { return m_trail_stack; }
|
||||
virtual void merge_eh(theory_var v1, theory_var v2, theory_var, theory_var);
|
||||
static void after_merge_eh(theory_var r1, theory_var r2, theory_var v1, theory_var v2) {}
|
||||
void unmerge_eh(theory_var v1, theory_var v2);
|
||||
virtual char const * get_name() const { return "datatype"; }
|
||||
virtual bool include_func_interp(func_decl* f);
|
||||
char const * get_name() const override { return "datatype"; }
|
||||
bool include_func_interp(func_decl* f) override;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ namespace smt {
|
|||
return false;
|
||||
}
|
||||
app * mk_zero_for(expr * n);
|
||||
theory_var mk_var(enode * n);
|
||||
theory_var mk_var(enode * n) override;
|
||||
theory_var internalize_term_core(app * n);
|
||||
void found_non_diff_logic_expr(expr * n);
|
||||
bool is_connected(theory_var source, theory_var target) const { return m_matrix[source][target].m_edge_id != null_edge_id; }
|
||||
|
@ -214,38 +214,38 @@ namespace smt {
|
|||
// Internalization
|
||||
//
|
||||
// -----------------------------------
|
||||
virtual bool internalize_atom(app * n, bool gate_ctx);
|
||||
virtual bool internalize_term(app * term);
|
||||
virtual void internalize_eq_eh(app * atom, bool_var v);
|
||||
virtual void apply_sort_cnstr(enode * n, sort * s);
|
||||
bool internalize_atom(app * n, bool gate_ctx) override;
|
||||
bool internalize_term(app * term) override;
|
||||
void internalize_eq_eh(app * atom, bool_var v) override;
|
||||
void apply_sort_cnstr(enode * n, sort * s) override;
|
||||
|
||||
virtual void assign_eh(bool_var v, bool is_true);
|
||||
virtual void new_eq_eh(theory_var v1, theory_var v2);
|
||||
virtual bool use_diseqs() const;
|
||||
virtual void new_diseq_eh(theory_var v1, theory_var v2);
|
||||
void assign_eh(bool_var v, bool is_true) override;
|
||||
void new_eq_eh(theory_var v1, theory_var v2) override;
|
||||
bool use_diseqs() const override;
|
||||
void new_diseq_eh(theory_var v1, theory_var v2) override;
|
||||
|
||||
virtual void conflict_resolution_eh(app * atom, bool_var v);
|
||||
void conflict_resolution_eh(app * atom, bool_var v) override;
|
||||
|
||||
virtual void push_scope_eh();
|
||||
virtual void pop_scope_eh(unsigned num_scopes);
|
||||
void push_scope_eh() override;
|
||||
void pop_scope_eh(unsigned num_scopes) override;
|
||||
|
||||
virtual void restart_eh();
|
||||
virtual void init_search_eh();
|
||||
virtual final_check_status final_check_eh();
|
||||
void restart_eh() override;
|
||||
void init_search_eh() override;
|
||||
final_check_status final_check_eh() override;
|
||||
|
||||
virtual bool can_propagate();
|
||||
virtual void propagate();
|
||||
bool can_propagate() override;
|
||||
void propagate() override;
|
||||
|
||||
virtual void flush_eh();
|
||||
virtual void reset_eh();
|
||||
void flush_eh() override;
|
||||
void reset_eh() override;
|
||||
|
||||
bool dump_lemmas() const { return m_params.m_arith_dump_lemmas; }
|
||||
|
||||
virtual bool validate_eq_in_model(theory_var v1, theory_var v2, bool is_true) const;
|
||||
bool validate_eq_in_model(theory_var v1, theory_var v2, bool is_true) const override;
|
||||
|
||||
virtual void display(std::ostream & out) const;
|
||||
void display(std::ostream & out) const override;
|
||||
virtual void display_atom(std::ostream & out, atom * a) const;
|
||||
virtual void collect_statistics(::statistics & st) const;
|
||||
void collect_statistics(::statistics & st) const override;
|
||||
|
||||
// -----------------------------------
|
||||
//
|
||||
|
@ -258,8 +258,8 @@ namespace smt {
|
|||
void compute_epsilon();
|
||||
void fix_zero();
|
||||
|
||||
virtual void init_model(model_generator & m);
|
||||
virtual model_value_proc * mk_value(enode * n, model_generator & mg);
|
||||
void init_model(model_generator & m) override;
|
||||
model_value_proc * mk_value(enode * n, model_generator & mg) override;
|
||||
|
||||
// -----------------------------------
|
||||
//
|
||||
|
@ -267,9 +267,9 @@ namespace smt {
|
|||
//
|
||||
// -----------------------------------
|
||||
|
||||
virtual inf_eps_rational<inf_rational> maximize(theory_var v, expr_ref& blocker, bool& has_shared);
|
||||
virtual inf_eps_rational<inf_rational> value(theory_var v);
|
||||
virtual theory_var add_objective(app* term);
|
||||
inf_eps_rational<inf_rational> maximize(theory_var v, expr_ref& blocker, bool& has_shared) override;
|
||||
inf_eps_rational<inf_rational> value(theory_var v) override;
|
||||
theory_var add_objective(app* term) override;
|
||||
virtual expr_ref mk_gt(theory_var v, inf_eps const& val);
|
||||
expr_ref mk_ge(filter_model_converter& fm, theory_var v, inf_eps const& val);
|
||||
|
||||
|
@ -280,16 +280,16 @@ namespace smt {
|
|||
// -----------------------------------
|
||||
public:
|
||||
theory_dense_diff_logic(ast_manager & m, theory_arith_params & p);
|
||||
virtual ~theory_dense_diff_logic() { reset_eh(); }
|
||||
~theory_dense_diff_logic() override { reset_eh(); }
|
||||
|
||||
virtual theory * mk_fresh(context * new_ctx);
|
||||
theory * mk_fresh(context * new_ctx) override;
|
||||
|
||||
virtual char const * get_name() const { return "difference-logic"; }
|
||||
char const * get_name() const override { return "difference-logic"; }
|
||||
|
||||
/**
|
||||
\brief See comment in theory::mk_eq_atom
|
||||
*/
|
||||
virtual app * mk_eq_atom(expr * lhs, expr * rhs) { return m_autil.mk_eq(lhs, rhs); }
|
||||
app * mk_eq_atom(expr * lhs, expr * rhs) override { return m_autil.mk_eq(lhs, rhs); }
|
||||
};
|
||||
|
||||
typedef theory_dense_diff_logic<mi_ext> theory_dense_mi;
|
||||
|
|
|
@ -867,7 +867,7 @@ namespace smt {
|
|||
}
|
||||
else {
|
||||
context& ctx = get_context();
|
||||
enode * e = 0;
|
||||
enode * e = nullptr;
|
||||
theory_var v = 0;
|
||||
if (ctx.e_internalized(n)) {
|
||||
e = ctx.get_enode(to_app(n));
|
||||
|
|
|
@ -208,7 +208,7 @@ namespace smt {
|
|||
void new_edge(dl_var src, dl_var dst, unsigned num_edges, edge_id const* edges);
|
||||
|
||||
// Create a new theory variable.
|
||||
virtual theory_var mk_var(enode* n);
|
||||
theory_var mk_var(enode* n) override;
|
||||
|
||||
virtual theory_var mk_var(app* n);
|
||||
|
||||
|
@ -234,85 +234,85 @@ namespace smt {
|
|||
m_agility(0.5),
|
||||
m_is_lia(true),
|
||||
m_non_diff_logic_exprs(false),
|
||||
m_factory(0),
|
||||
m_factory(nullptr),
|
||||
m_nc_functor(*this),
|
||||
m_S(m.limit()),
|
||||
m_num_simplex_edges(0) {
|
||||
}
|
||||
|
||||
virtual ~theory_diff_logic() {
|
||||
~theory_diff_logic() override {
|
||||
reset_eh();
|
||||
}
|
||||
|
||||
virtual theory * mk_fresh(context * new_ctx);
|
||||
theory * mk_fresh(context * new_ctx) override;
|
||||
|
||||
virtual char const * get_name() const { return "difference-logic"; }
|
||||
char const * get_name() const override { return "difference-logic"; }
|
||||
|
||||
/**
|
||||
\brief See comment in theory::mk_eq_atom
|
||||
*/
|
||||
virtual app * mk_eq_atom(expr * lhs, expr * rhs) { return m_util.mk_eq(lhs, rhs); }
|
||||
app * mk_eq_atom(expr * lhs, expr * rhs) override { return m_util.mk_eq(lhs, rhs); }
|
||||
|
||||
virtual void init(context * ctx);
|
||||
void init(context * ctx) override;
|
||||
|
||||
virtual bool internalize_atom(app * atom, bool gate_ctx);
|
||||
bool internalize_atom(app * atom, bool gate_ctx) override;
|
||||
|
||||
virtual bool internalize_term(app * term);
|
||||
bool internalize_term(app * term) override;
|
||||
|
||||
virtual void internalize_eq_eh(app * atom, bool_var v);
|
||||
void internalize_eq_eh(app * atom, bool_var v) override;
|
||||
|
||||
virtual void assign_eh(bool_var v, bool is_true);
|
||||
void assign_eh(bool_var v, bool is_true) override;
|
||||
|
||||
virtual void new_eq_eh(theory_var v1, theory_var v2);
|
||||
void new_eq_eh(theory_var v1, theory_var v2) override;
|
||||
|
||||
virtual bool use_diseqs() const { return true; }
|
||||
bool use_diseqs() const override { return true; }
|
||||
|
||||
virtual void new_diseq_eh(theory_var v1, theory_var v2);
|
||||
void new_diseq_eh(theory_var v1, theory_var v2) override;
|
||||
|
||||
virtual void push_scope_eh();
|
||||
void push_scope_eh() override;
|
||||
|
||||
virtual void pop_scope_eh(unsigned num_scopes);
|
||||
void pop_scope_eh(unsigned num_scopes) override;
|
||||
|
||||
virtual void restart_eh() {
|
||||
void restart_eh() override {
|
||||
m_arith_eq_adapter.restart_eh();
|
||||
}
|
||||
|
||||
virtual void relevant_eh(app* e) {}
|
||||
void relevant_eh(app* e) override {}
|
||||
|
||||
virtual void init_search_eh() {
|
||||
void init_search_eh() override {
|
||||
m_arith_eq_adapter.init_search_eh();
|
||||
}
|
||||
|
||||
virtual final_check_status final_check_eh();
|
||||
final_check_status final_check_eh() override;
|
||||
|
||||
virtual bool is_shared(theory_var v) const {
|
||||
bool is_shared(theory_var v) const override {
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual bool can_propagate() {
|
||||
bool can_propagate() override {
|
||||
return m_asserted_qhead != m_asserted_atoms.size();
|
||||
}
|
||||
|
||||
virtual void propagate();
|
||||
void propagate() override;
|
||||
|
||||
virtual justification * why_is_diseq(theory_var v1, theory_var v2) {
|
||||
justification * why_is_diseq(theory_var v1, theory_var v2) override {
|
||||
NOT_IMPLEMENTED_YET();
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// virtual void flush_eh();
|
||||
|
||||
virtual void reset_eh();
|
||||
void reset_eh() override;
|
||||
|
||||
virtual void init_model(model_generator & m);
|
||||
void init_model(model_generator & m) override;
|
||||
|
||||
virtual model_value_proc * mk_value(enode * n, model_generator & mg);
|
||||
model_value_proc * mk_value(enode * n, model_generator & mg) override;
|
||||
|
||||
virtual bool validate_eq_in_model(theory_var v1, theory_var v2, bool is_true) const;
|
||||
bool validate_eq_in_model(theory_var v1, theory_var v2, bool is_true) const override;
|
||||
|
||||
virtual void display(std::ostream & out) const;
|
||||
void display(std::ostream & out) const override;
|
||||
|
||||
virtual void collect_statistics(::statistics & st) const;
|
||||
void collect_statistics(::statistics & st) const override;
|
||||
|
||||
|
||||
// -----------------------------------
|
||||
|
@ -321,9 +321,9 @@ namespace smt {
|
|||
//
|
||||
// -----------------------------------
|
||||
|
||||
virtual inf_eps maximize(theory_var v, expr_ref& blocker, bool& has_shared);
|
||||
virtual inf_eps value(theory_var v);
|
||||
virtual theory_var add_objective(app* term);
|
||||
inf_eps maximize(theory_var v, expr_ref& blocker, bool& has_shared) override;
|
||||
inf_eps value(theory_var v) override;
|
||||
theory_var add_objective(app* term) override;
|
||||
expr_ref mk_ge(filter_model_converter& fm, theory_var v, inf_eps const& val);
|
||||
|
||||
bool internalize_objective(expr * n, rational const& m, rational& r, objective_term & objective);
|
||||
|
|
|
@ -298,7 +298,7 @@ void theory_diff_logic<Ext>::internalize_eq_eh(app * atom, bool_var v) {
|
|||
template<typename Ext>
|
||||
void theory_diff_logic<Ext>::assign_eh(bool_var v, bool is_true) {
|
||||
m_stats.m_num_assertions++;
|
||||
atom * a = 0;
|
||||
atom * a = nullptr;
|
||||
VERIFY (m_bool_var2atom.find(v, a));
|
||||
SASSERT(a);
|
||||
SASSERT(get_context().get_assignment(v) != l_undef);
|
||||
|
@ -602,7 +602,7 @@ void theory_diff_logic<Ext>::new_edge(dl_var src, dl_var dst, unsigned num_edges
|
|||
ctx.mark_as_relevant(le.get());
|
||||
literal lit(ctx.get_literal(le));
|
||||
bool_var bv = lit.var();
|
||||
atom* a = 0;
|
||||
atom* a = nullptr;
|
||||
m_bool_var2atom.find(bv, a);
|
||||
SASSERT(a);
|
||||
|
||||
|
@ -619,7 +619,7 @@ void theory_diff_logic<Ext>::new_edge(dl_var src, dl_var dst, unsigned num_edges
|
|||
tout << "\n";
|
||||
);
|
||||
|
||||
justification * js = 0;
|
||||
justification * js = nullptr;
|
||||
if (get_manager().proofs_enabled()) {
|
||||
vector<parameter> params;
|
||||
params.push_back(parameter(symbol("farkas")));
|
||||
|
@ -628,7 +628,7 @@ void theory_diff_logic<Ext>::new_edge(dl_var src, dl_var dst, unsigned num_edges
|
|||
lits.size(), lits.c_ptr(),
|
||||
params.size(), params.c_ptr());
|
||||
}
|
||||
ctx.mk_clause(lits.size(), lits.c_ptr(), js, CLS_AUX_LEMMA, 0);
|
||||
ctx.mk_clause(lits.size(), lits.c_ptr(), js, CLS_AUX_LEMMA, nullptr);
|
||||
if (dump_lemmas()) {
|
||||
symbol logic(m_is_lia ? "QF_LIA" : "QF_LRA");
|
||||
ctx.display_lemma_as_smt_problem(lits.size(), lits.c_ptr(), false_literal, logic);
|
||||
|
@ -692,7 +692,7 @@ void theory_diff_logic<Ext>::set_neg_cycle_conflict() {
|
|||
ctx.mk_justification(
|
||||
ext_theory_conflict_justification(
|
||||
get_id(), ctx.get_region(),
|
||||
lits.size(), lits.c_ptr(), 0, 0, params.size(), params.c_ptr())));
|
||||
lits.size(), lits.c_ptr(), 0, nullptr, params.size(), params.c_ptr())));
|
||||
|
||||
}
|
||||
|
||||
|
@ -774,7 +774,7 @@ theory_var theory_diff_logic<Ext>::mk_term(app* n) {
|
|||
template<typename Ext>
|
||||
theory_var theory_diff_logic<Ext>::mk_num(app* n, rational const& r) {
|
||||
theory_var v = null_theory_var;
|
||||
enode* e = 0;
|
||||
enode* e = nullptr;
|
||||
context& ctx = get_context();
|
||||
if (r.is_zero()) {
|
||||
v = get_zero();
|
||||
|
@ -813,7 +813,7 @@ theory_var theory_diff_logic<Ext>::mk_var(enode* n) {
|
|||
template<typename Ext>
|
||||
theory_var theory_diff_logic<Ext>::mk_var(app* n) {
|
||||
context & ctx = get_context();
|
||||
enode* e = 0;
|
||||
enode* e = nullptr;
|
||||
theory_var v = null_theory_var;
|
||||
if (ctx.e_internalized(n)) {
|
||||
e = ctx.get_enode(n);
|
||||
|
|
|
@ -51,7 +51,7 @@ namespace smt {
|
|||
m_util(u)
|
||||
{}
|
||||
|
||||
virtual app * mk_value_core(unsigned const & val, sort * s) {
|
||||
app * mk_value_core(unsigned const & val, sort * s) override {
|
||||
return m_util.mk_numeral(val, s);
|
||||
}
|
||||
};
|
||||
|
@ -74,11 +74,11 @@ namespace smt {
|
|||
|
||||
dl_value_proc(theory_dl& th, smt::enode* n) : m_th(th), m_node(n) {}
|
||||
|
||||
virtual void get_dependencies(buffer<smt::model_value_dependency> & result) {}
|
||||
void get_dependencies(buffer<smt::model_value_dependency> & result) override {}
|
||||
|
||||
virtual app * mk_value(smt::model_generator & mg, ptr_vector<expr> & ) {
|
||||
app * mk_value(smt::model_generator & mg, ptr_vector<expr> & ) override {
|
||||
smt::context& ctx = m_th.get_context();
|
||||
app* result = 0;
|
||||
app* result = nullptr;
|
||||
expr* n = m_node->get_owner();
|
||||
sort* s = m_th.m().get_sort(n);
|
||||
func_decl* r, *v;
|
||||
|
@ -111,9 +111,9 @@ namespace smt {
|
|||
}
|
||||
|
||||
|
||||
virtual char const * get_name() const { return "datalog"; }
|
||||
char const * get_name() const override { return "datalog"; }
|
||||
|
||||
virtual bool internalize_atom(app * atom, bool gate_ctx) {
|
||||
bool internalize_atom(app * atom, bool gate_ctx) override {
|
||||
TRACE("theory_dl", tout << mk_pp(atom, m()) << "\n";);
|
||||
context& ctx = get_context();
|
||||
if (ctx.b_internalized(atom)) {
|
||||
|
@ -136,7 +136,7 @@ namespace smt {
|
|||
return false;
|
||||
}
|
||||
|
||||
virtual bool internalize_term(app * term) {
|
||||
bool internalize_term(app * term) override {
|
||||
TRACE("theory_dl", tout << mk_pp(term, m()) << "\n";);
|
||||
if (u().is_finite_sort(term)) {
|
||||
return mk_rep(term);
|
||||
|
@ -146,27 +146,27 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
|
||||
virtual void new_eq_eh(theory_var v1, theory_var v2) {
|
||||
void new_eq_eh(theory_var v1, theory_var v2) override {
|
||||
|
||||
}
|
||||
|
||||
virtual void new_diseq_eh(theory_var v1, theory_var v2) {
|
||||
void new_diseq_eh(theory_var v1, theory_var v2) override {
|
||||
|
||||
}
|
||||
|
||||
virtual theory * mk_fresh(context * new_ctx) {
|
||||
theory * mk_fresh(context * new_ctx) override {
|
||||
return alloc(theory_dl, new_ctx->get_manager());
|
||||
}
|
||||
|
||||
virtual void init_model(smt::model_generator & m) {
|
||||
void init_model(smt::model_generator & m) override {
|
||||
m.register_factory(alloc(dl_factory, m_util, m.get_model()));
|
||||
}
|
||||
|
||||
virtual smt::model_value_proc * mk_value(smt::enode * n, smt::model_generator&) {
|
||||
smt::model_value_proc * mk_value(smt::enode * n, smt::model_generator&) override {
|
||||
return alloc(dl_value_proc, *this, n);
|
||||
}
|
||||
|
||||
virtual void apply_sort_cnstr(enode * n, sort * s) {
|
||||
void apply_sort_cnstr(enode * n, sort * s) override {
|
||||
app* term = n->get_owner();
|
||||
if (u().is_finite_sort(term)) {
|
||||
mk_rep(term);
|
||||
|
@ -174,7 +174,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
|
||||
virtual void relevant_eh(app * n) {
|
||||
void relevant_eh(app * n) override {
|
||||
if (u().is_finite_sort(n)) {
|
||||
sort* s = m().get_sort(n);
|
||||
func_decl* r, *v;
|
||||
|
@ -194,7 +194,7 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
|
||||
virtual void display(std::ostream & out) const {
|
||||
void display(std::ostream & out) const override {
|
||||
}
|
||||
|
||||
|
||||
|
@ -204,8 +204,8 @@ namespace smt {
|
|||
if(!m_reps.find(s, r) || !m_vals.find(s,v)) {
|
||||
SASSERT(!m_reps.contains(s));
|
||||
sort* bv = b().mk_sort(64);
|
||||
r = m().mk_func_decl(m_util.get_family_id(), datalog::OP_DL_REP, 0, 0, 1, &s, bv);
|
||||
v = m().mk_func_decl(m_util.get_family_id(), datalog::OP_DL_ABS, 0, 0, 1, &bv, s);
|
||||
r = m().mk_func_decl(m_util.get_family_id(), datalog::OP_DL_REP, 0, nullptr, 1, &s, bv);
|
||||
v = m().mk_func_decl(m_util.get_family_id(), datalog::OP_DL_ABS, 0, nullptr, 1, &bv, s);
|
||||
m_reps.insert(s, r);
|
||||
m_vals.insert(s, v);
|
||||
add_trail(r);
|
||||
|
@ -218,7 +218,7 @@ namespace smt {
|
|||
bool mk_rep(app* n) {
|
||||
context & ctx = get_context();
|
||||
unsigned num_args = n->get_num_args();
|
||||
enode * e = 0;
|
||||
enode * e = nullptr;
|
||||
for (unsigned i = 0; i < num_args; i++) {
|
||||
ctx.internalize(n->get_arg(i), false);
|
||||
}
|
||||
|
|
|
@ -33,25 +33,25 @@ namespace smt {
|
|||
void found_theory_expr();
|
||||
|
||||
protected:
|
||||
virtual bool internalize_atom(app * atom, bool gate_ctx);
|
||||
virtual bool internalize_term(app * term);
|
||||
virtual void new_eq_eh(theory_var v1, theory_var v2);
|
||||
virtual bool use_diseqs() const;
|
||||
virtual void new_diseq_eh(theory_var v1, theory_var v2);
|
||||
virtual void reset_eh();
|
||||
virtual final_check_status final_check_eh();
|
||||
virtual bool build_models() const {
|
||||
bool internalize_atom(app * atom, bool gate_ctx) override;
|
||||
bool internalize_term(app * term) override;
|
||||
void new_eq_eh(theory_var v1, theory_var v2) override;
|
||||
bool use_diseqs() const override;
|
||||
void new_diseq_eh(theory_var v1, theory_var v2) override;
|
||||
void reset_eh() override;
|
||||
final_check_status final_check_eh() override;
|
||||
bool build_models() const override {
|
||||
return false;
|
||||
}
|
||||
virtual void display(std::ostream& out) const {}
|
||||
void display(std::ostream& out) const override {}
|
||||
|
||||
public:
|
||||
theory_dummy(family_id fid, char const * name);
|
||||
virtual ~theory_dummy() {}
|
||||
~theory_dummy() override {}
|
||||
|
||||
virtual theory * mk_fresh(context * new_ctx) { return alloc(theory_dummy, get_family_id(), m_name); }
|
||||
theory * mk_fresh(context * new_ctx) override { return alloc(theory_dummy, get_family_id(), m_name); }
|
||||
|
||||
virtual char const * get_name() const;
|
||||
char const * get_name() const override;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
@ -32,13 +32,13 @@ namespace smt {
|
|||
public:
|
||||
fpa2bv_conversion_trail_elem(ast_manager & m, obj_map<expr, expr*> & map, expr * e) :
|
||||
m(m), m_map(map), key(e, m) { }
|
||||
virtual ~fpa2bv_conversion_trail_elem() { }
|
||||
virtual void undo(theory_fpa & th) {
|
||||
~fpa2bv_conversion_trail_elem() override { }
|
||||
void undo(theory_fpa & th) override {
|
||||
expr * val = m_map.find(key);
|
||||
m_map.remove(key);
|
||||
m.dec_ref(key);
|
||||
m.dec_ref(val);
|
||||
key = 0;
|
||||
key = nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -208,7 +208,7 @@ namespace smt {
|
|||
for (unsigned i = 0; i < values.size(); i++)
|
||||
tout << "value[" << i << "] = " << mk_ismt2_pp(values[i], m) << std::endl;);
|
||||
|
||||
app * result = 0;
|
||||
app * result = nullptr;
|
||||
unsigned bv_sz;
|
||||
|
||||
rational val(0);
|
||||
|
@ -256,7 +256,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
func_decl_ref wrap_fd(m);
|
||||
wrap_fd = m.mk_func_decl(get_family_id(), OP_FPA_BVWRAP, 0, 0, 1, &es, bv_srt);
|
||||
wrap_fd = m.mk_func_decl(get_family_id(), OP_FPA_BVWRAP, 0, nullptr, 1, &es, bv_srt);
|
||||
res = m.mk_app(wrap_fd, e);
|
||||
}
|
||||
|
||||
|
@ -705,7 +705,7 @@ namespace smt {
|
|||
m_trail_stack.pop_scope(m_trail_stack.get_num_scopes());
|
||||
if (m_factory) {
|
||||
dealloc(m_factory);
|
||||
m_factory = 0;
|
||||
m_factory = nullptr;
|
||||
}
|
||||
ast_manager & m = get_manager();
|
||||
dec_ref_map_key_values(m, m_conversions);
|
||||
|
@ -743,7 +743,7 @@ namespace smt {
|
|||
return alloc(expr_wrapper_proc, owner);
|
||||
}
|
||||
|
||||
model_value_proc * res = 0;
|
||||
model_value_proc * res = nullptr;
|
||||
|
||||
app_ref wrapped(m);
|
||||
wrapped = wrap(owner);
|
||||
|
|
|
@ -43,16 +43,16 @@ namespace smt {
|
|||
value_factory(m, fid),
|
||||
m_util(m) {}
|
||||
|
||||
virtual ~fpa_value_factory() {}
|
||||
~fpa_value_factory() override {}
|
||||
|
||||
virtual expr * get_some_value(sort * s) {
|
||||
expr * get_some_value(sort * s) override {
|
||||
mpf_manager & mpfm = m_util.fm();
|
||||
scoped_mpf q(mpfm);
|
||||
mpfm.set(q, m_util.get_ebits(s), m_util.get_sbits(s), 0);
|
||||
return m_util.mk_value(q);
|
||||
}
|
||||
|
||||
virtual bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2) {
|
||||
bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2) override {
|
||||
mpf_manager & mpfm = m_util.fm();
|
||||
scoped_mpf q(mpfm);
|
||||
mpfm.set(q, m_util.get_ebits(s), m_util.get_sbits(s), 0);
|
||||
|
@ -62,8 +62,8 @@ namespace smt {
|
|||
return true;
|
||||
}
|
||||
|
||||
virtual expr * get_fresh_value(sort * s) { NOT_IMPLEMENTED_YET(); }
|
||||
virtual void register_value(expr * n) { /* Ignore */ }
|
||||
expr * get_fresh_value(sort * s) override { NOT_IMPLEMENTED_YET(); }
|
||||
void register_value(expr * n) override { /* Ignore */ }
|
||||
|
||||
app * mk_value(mpf const & x) {
|
||||
return m_util.mk_value(x);
|
||||
|
@ -81,8 +81,8 @@ namespace smt {
|
|||
fpa2bv_converter(m),
|
||||
m_th(*th) {}
|
||||
virtual ~fpa2bv_converter_wrapped() {}
|
||||
virtual void mk_const(func_decl * f, expr_ref & result);
|
||||
virtual void mk_rm_const(func_decl * f, expr_ref & result);
|
||||
void mk_const(func_decl * f, expr_ref & result) override;
|
||||
void mk_rm_const(func_decl * f, expr_ref & result) override;
|
||||
};
|
||||
|
||||
class fpa_value_proc : public model_value_proc {
|
||||
|
@ -100,15 +100,15 @@ namespace smt {
|
|||
m_th(*th), m(th->get_manager()), m_fu(th->m_fpa_util), m_bu(th->m_bv_util),
|
||||
m_ebits(ebits), m_sbits(sbits) {}
|
||||
|
||||
virtual ~fpa_value_proc() {}
|
||||
~fpa_value_proc() override {}
|
||||
|
||||
void add_dependency(enode * e) { m_deps.push_back(model_value_dependency(e)); }
|
||||
|
||||
virtual void get_dependencies(buffer<model_value_dependency> & result) {
|
||||
void get_dependencies(buffer<model_value_dependency> & result) override {
|
||||
result.append(m_deps);
|
||||
}
|
||||
|
||||
virtual app * mk_value(model_generator & mg, ptr_vector<expr> & values);
|
||||
app * mk_value(model_generator & mg, ptr_vector<expr> & values) override;
|
||||
};
|
||||
|
||||
class fpa_rm_value_proc : public model_value_proc {
|
||||
|
@ -124,12 +124,12 @@ namespace smt {
|
|||
|
||||
void add_dependency(enode * e) { m_deps.push_back(model_value_dependency(e)); }
|
||||
|
||||
virtual void get_dependencies(buffer<model_value_dependency> & result) {
|
||||
void get_dependencies(buffer<model_value_dependency> & result) override {
|
||||
result.append(m_deps);
|
||||
}
|
||||
|
||||
virtual ~fpa_rm_value_proc() {}
|
||||
virtual app * mk_value(model_generator & mg, ptr_vector<expr> & values);
|
||||
~fpa_rm_value_proc() override {}
|
||||
app * mk_value(model_generator & mg, ptr_vector<expr> & values) override;
|
||||
};
|
||||
|
||||
protected:
|
||||
|
@ -145,32 +145,32 @@ namespace smt {
|
|||
bool m_is_initialized;
|
||||
obj_hashtable<func_decl> m_is_added_to_model;
|
||||
|
||||
virtual final_check_status final_check_eh();
|
||||
virtual bool internalize_atom(app * atom, bool gate_ctx);
|
||||
virtual bool internalize_term(app * term);
|
||||
virtual void apply_sort_cnstr(enode * n, sort * s);
|
||||
virtual void new_eq_eh(theory_var, theory_var);
|
||||
virtual void new_diseq_eh(theory_var, theory_var);
|
||||
virtual void push_scope_eh();
|
||||
virtual void pop_scope_eh(unsigned num_scopes);
|
||||
virtual void reset_eh();
|
||||
virtual theory* mk_fresh(context* new_ctx);
|
||||
virtual char const * get_name() const { return "fpa"; }
|
||||
final_check_status final_check_eh() override;
|
||||
bool internalize_atom(app * atom, bool gate_ctx) override;
|
||||
bool internalize_term(app * term) override;
|
||||
void apply_sort_cnstr(enode * n, sort * s) override;
|
||||
void new_eq_eh(theory_var, theory_var) override;
|
||||
void new_diseq_eh(theory_var, theory_var) override;
|
||||
void push_scope_eh() override;
|
||||
void pop_scope_eh(unsigned num_scopes) override;
|
||||
void reset_eh() override;
|
||||
theory* mk_fresh(context* new_ctx) override;
|
||||
char const * get_name() const override { return "fpa"; }
|
||||
|
||||
virtual model_value_proc * mk_value(enode * n, model_generator & mg);
|
||||
model_value_proc * mk_value(enode * n, model_generator & mg) override;
|
||||
|
||||
void assign_eh(bool_var v, bool is_true);
|
||||
virtual void relevant_eh(app * n);
|
||||
virtual void init_model(model_generator & m);
|
||||
virtual void finalize_model(model_generator & mg);
|
||||
void assign_eh(bool_var v, bool is_true) override;
|
||||
void relevant_eh(app * n) override;
|
||||
void init_model(model_generator & m) override;
|
||||
void finalize_model(model_generator & mg) override;
|
||||
|
||||
public:
|
||||
theory_fpa(ast_manager & m);
|
||||
virtual ~theory_fpa();
|
||||
~theory_fpa() override;
|
||||
|
||||
virtual void init(context * ctx);
|
||||
void init(context * ctx) override;
|
||||
|
||||
virtual void display(std::ostream & out) const;
|
||||
void display(std::ostream & out) const override;
|
||||
|
||||
protected:
|
||||
expr_ref mk_side_conditions();
|
||||
|
|
|
@ -137,7 +137,7 @@ namespace smt {
|
|||
imp& m_imp;
|
||||
public:
|
||||
resource_limit(imp& i): m_imp(i) { }
|
||||
virtual bool get_cancel_flag() { return m_imp.m.canceled(); }
|
||||
bool get_cancel_flag() override { return m_imp.m.canceled(); }
|
||||
};
|
||||
|
||||
|
||||
|
@ -658,12 +658,12 @@ namespace smt {
|
|||
m_internalize_head(0),
|
||||
m_delay_constraints(false),
|
||||
m_delayed_terms(m),
|
||||
m_not_handled(0),
|
||||
m_not_handled(nullptr),
|
||||
m_asserted_qhead(0),
|
||||
m_assume_eq_head(0),
|
||||
m_num_conflicts(0),
|
||||
m_model_eqs(DEFAULT_HASHTABLE_INITIAL_CAPACITY, var_value_hash(*this), var_value_eq(*this)),
|
||||
m_solver(0),
|
||||
m_solver(nullptr),
|
||||
m_resource_limit(*this) {
|
||||
}
|
||||
|
||||
|
@ -689,7 +689,7 @@ namespace smt {
|
|||
SASSERT(!ctx().b_internalized(atom));
|
||||
bool_var bv = ctx().mk_bool_var(atom);
|
||||
ctx().set_var_theory(bv, get_id());
|
||||
expr* n1 = 0, *n2 = 0;
|
||||
expr* n1 = nullptr, *n2 = nullptr;
|
||||
rational r;
|
||||
lra_lp::bound_kind k;
|
||||
theory_var v = null_theory_var;
|
||||
|
@ -721,7 +721,7 @@ namespace smt {
|
|||
SASSERT(!ctx().b_internalized(atom));
|
||||
bool_var bv = ctx().mk_bool_var(atom);
|
||||
ctx().set_var_theory(bv, get_id());
|
||||
expr* n1 = 0, *n2 = 0;
|
||||
expr* n1 = nullptr, *n2 = nullptr;
|
||||
rational r;
|
||||
lra_lp::bound_kind k;
|
||||
theory_var v = null_theory_var;
|
||||
|
@ -771,7 +771,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
void internalize_eq_eh(app * atom, bool_var) {
|
||||
expr* lhs = 0, *rhs = 0;
|
||||
expr* lhs = nullptr, *rhs = nullptr;
|
||||
VERIFY(m.is_eq(atom, lhs, rhs));
|
||||
enode * n1 = get_enode(lhs);
|
||||
enode * n2 = get_enode(rhs);
|
||||
|
@ -862,7 +862,7 @@ namespace smt {
|
|||
|
||||
void relevant_eh(app* n) {
|
||||
TRACE("arith", tout << mk_pp(n, m) << "\n";);
|
||||
expr* n1 = 0, *n2 = 0;
|
||||
expr* n1 = nullptr, *n2 = nullptr;
|
||||
if (a.is_mod(n, n1, n2))
|
||||
mk_idiv_mod_axioms(n1, n2);
|
||||
else if (a.is_rem(n, n1, n2))
|
||||
|
@ -898,7 +898,7 @@ namespace smt {
|
|||
// to_int (to_real x) = x
|
||||
// to_real(to_int(x)) <= x < to_real(to_int(x)) + 1
|
||||
void mk_to_int_axiom(app* n) {
|
||||
expr* x = 0, *y = 0;
|
||||
expr* x = nullptr, *y = nullptr;
|
||||
VERIFY (a.is_to_int(n, x));
|
||||
if (a.is_to_real(x, y)) {
|
||||
mk_axiom(th.mk_eq(y, n, false));
|
||||
|
@ -914,7 +914,7 @@ namespace smt {
|
|||
|
||||
// is_int(x) <=> to_real(to_int(x)) = x
|
||||
void mk_is_int_axiom(app* n) {
|
||||
expr* x = 0;
|
||||
expr* x = nullptr;
|
||||
VERIFY(a.is_is_int(n, x));
|
||||
literal eq = th.mk_eq(a.mk_to_real(a.mk_to_int(x)), x, false);
|
||||
literal is_int = ctx().get_literal(n);
|
||||
|
@ -1180,7 +1180,7 @@ namespace smt {
|
|||
if (assume_eqs()) {
|
||||
return FC_CONTINUE;
|
||||
}
|
||||
if (m_not_handled != 0) {
|
||||
if (m_not_handled != nullptr) {
|
||||
return FC_GIVEUP;
|
||||
}
|
||||
return FC_DONE;
|
||||
|
@ -1358,11 +1358,11 @@ namespace smt {
|
|||
imp & m_imp;
|
||||
local_bound_propagator(imp& i) : lp_bound_propagator(*i.m_solver), m_imp(i) {}
|
||||
|
||||
bool bound_is_interesting(unsigned j, lp::lconstraint_kind kind, const rational & v) {
|
||||
bool bound_is_interesting(unsigned j, lp::lconstraint_kind kind, const rational & v) override {
|
||||
return m_imp.bound_is_interesting(j, kind, v);
|
||||
}
|
||||
|
||||
virtual void consume(rational const& v, unsigned j) {
|
||||
void consume(rational const& v, unsigned j) override {
|
||||
m_imp.set_evidence(j);
|
||||
}
|
||||
};
|
||||
|
@ -1439,12 +1439,12 @@ namespace smt {
|
|||
m_core2.push_back(~m_core[i]);
|
||||
}
|
||||
m_core2.push_back(lit);
|
||||
justification * js = 0;
|
||||
justification * js = nullptr;
|
||||
if (proofs_enabled()) {
|
||||
js = alloc(theory_lemma_justification, get_id(), ctx(), m_core2.size(), m_core2.c_ptr(),
|
||||
m_params.size(), m_params.c_ptr());
|
||||
}
|
||||
ctx().mk_clause(m_core2.size(), m_core2.c_ptr(), js, CLS_AUX_LEMMA, 0);
|
||||
ctx().mk_clause(m_core2.size(), m_core2.c_ptr(), js, CLS_AUX_LEMMA, nullptr);
|
||||
}
|
||||
else {
|
||||
ctx().assign(
|
||||
|
@ -1499,7 +1499,7 @@ namespace smt {
|
|||
rational const& k1 = b.get_value();
|
||||
lp_bounds & bounds = m_bounds[v];
|
||||
|
||||
lra_lp::bound* end = 0;
|
||||
lra_lp::bound* end = nullptr;
|
||||
lra_lp::bound* lo_inf = end, *lo_sup = end;
|
||||
lra_lp::bound* hi_inf = end, *hi_sup = end;
|
||||
|
||||
|
@ -1764,7 +1764,7 @@ namespace smt {
|
|||
bool find_glb = (is_true == (k == lra_lp::lower_t));
|
||||
if (find_glb) {
|
||||
rational glb;
|
||||
lra_lp::bound* lb = 0;
|
||||
lra_lp::bound* lb = nullptr;
|
||||
for (unsigned i = 0; i < bounds.size(); ++i) {
|
||||
lra_lp::bound* b2 = bounds[i];
|
||||
if (b2 == &b) continue;
|
||||
|
@ -1780,7 +1780,7 @@ namespace smt {
|
|||
}
|
||||
else {
|
||||
rational lub;
|
||||
lra_lp::bound* ub = 0;
|
||||
lra_lp::bound* ub = nullptr;
|
||||
for (unsigned i = 0; i < bounds.size(); ++i) {
|
||||
lra_lp::bound* b2 = bounds[i];
|
||||
if (b2 == &b) continue;
|
||||
|
@ -1916,7 +1916,7 @@ namespace smt {
|
|||
lp::var_index vi = m_theory_var2var_index[v];
|
||||
SASSERT(m_solver->is_term(vi));
|
||||
lp::lar_term const& term = m_solver->get_term(vi);
|
||||
for (auto const coeff : term.m_coeffs) {
|
||||
for (auto const& coeff : term.m_coeffs) {
|
||||
lp::var_index wi = coeff.first;
|
||||
lp::constraint_index ci;
|
||||
rational value;
|
||||
|
@ -2111,7 +2111,7 @@ namespace smt {
|
|||
justification* js =
|
||||
ctx().mk_justification(
|
||||
ext_theory_eq_propagation_justification(
|
||||
get_id(), ctx().get_region(), m_core.size(), m_core.c_ptr(), m_eqs.size(), m_eqs.c_ptr(), x, y, 0, 0));
|
||||
get_id(), ctx().get_region(), m_core.size(), m_core.c_ptr(), m_eqs.size(), m_eqs.c_ptr(), x, y, 0, nullptr));
|
||||
|
||||
TRACE("arith",
|
||||
for (unsigned i = 0; i < m_core.size(); ++i) {
|
||||
|
@ -2236,12 +2236,12 @@ namespace smt {
|
|||
}
|
||||
|
||||
justification * why_is_diseq(theory_var v1, theory_var v2) {
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void reset_eh() {
|
||||
m_arith_eq_adapter.reset_eh();
|
||||
m_solver = 0;
|
||||
m_solver = nullptr;
|
||||
m_not_handled = nullptr;
|
||||
del_bounds(0);
|
||||
m_unassigned_bounds.reset();
|
||||
|
|
|
@ -29,66 +29,66 @@ namespace smt {
|
|||
|
||||
public:
|
||||
theory_lra(ast_manager& m, theory_arith_params& ap);
|
||||
virtual ~theory_lra();
|
||||
virtual theory* mk_fresh(context* new_ctx);
|
||||
virtual char const* get_name() const { return "lra"; }
|
||||
~theory_lra() override;
|
||||
theory* mk_fresh(context* new_ctx) override;
|
||||
char const* get_name() const override { return "lra"; }
|
||||
|
||||
virtual void init(context * ctx);
|
||||
void init(context * ctx) override;
|
||||
|
||||
virtual bool internalize_atom(app * atom, bool gate_ctx);
|
||||
bool internalize_atom(app * atom, bool gate_ctx) override;
|
||||
|
||||
virtual bool internalize_term(app * term);
|
||||
bool internalize_term(app * term) override;
|
||||
|
||||
virtual void internalize_eq_eh(app * atom, bool_var v);
|
||||
void internalize_eq_eh(app * atom, bool_var v) override;
|
||||
|
||||
virtual void assign_eh(bool_var v, bool is_true);
|
||||
void assign_eh(bool_var v, bool is_true) override;
|
||||
|
||||
virtual void new_eq_eh(theory_var v1, theory_var v2);
|
||||
void new_eq_eh(theory_var v1, theory_var v2) override;
|
||||
|
||||
virtual bool use_diseqs() const;
|
||||
bool use_diseqs() const override;
|
||||
|
||||
virtual void new_diseq_eh(theory_var v1, theory_var v2);
|
||||
void new_diseq_eh(theory_var v1, theory_var v2) override;
|
||||
|
||||
virtual void push_scope_eh();
|
||||
void push_scope_eh() override;
|
||||
|
||||
virtual void pop_scope_eh(unsigned num_scopes);
|
||||
void pop_scope_eh(unsigned num_scopes) override;
|
||||
|
||||
virtual void restart_eh();
|
||||
void restart_eh() override;
|
||||
|
||||
virtual void relevant_eh(app* e);
|
||||
void relevant_eh(app* e) override;
|
||||
|
||||
virtual void init_search_eh();
|
||||
void init_search_eh() override;
|
||||
|
||||
virtual final_check_status final_check_eh();
|
||||
final_check_status final_check_eh() override;
|
||||
|
||||
virtual bool is_shared(theory_var v) const;
|
||||
bool is_shared(theory_var v) const override;
|
||||
|
||||
virtual bool can_propagate();
|
||||
bool can_propagate() override;
|
||||
|
||||
virtual void propagate();
|
||||
void propagate() override;
|
||||
|
||||
virtual justification * why_is_diseq(theory_var v1, theory_var v2);
|
||||
justification * why_is_diseq(theory_var v1, theory_var v2) override;
|
||||
|
||||
// virtual void flush_eh();
|
||||
|
||||
virtual void reset_eh();
|
||||
void reset_eh() override;
|
||||
|
||||
virtual void init_model(model_generator & m);
|
||||
void init_model(model_generator & m) override;
|
||||
|
||||
virtual model_value_proc * mk_value(enode * n, model_generator & mg);
|
||||
model_value_proc * mk_value(enode * n, model_generator & mg) override;
|
||||
|
||||
virtual bool get_value(enode* n, expr_ref& r);
|
||||
bool get_value(enode* n, expr_ref& r) override;
|
||||
|
||||
virtual bool validate_eq_in_model(theory_var v1, theory_var v2, bool is_true) const;
|
||||
bool validate_eq_in_model(theory_var v1, theory_var v2, bool is_true) const override;
|
||||
|
||||
virtual void display(std::ostream & out) const;
|
||||
void display(std::ostream & out) const override;
|
||||
|
||||
virtual void collect_statistics(::statistics & st) const;
|
||||
void collect_statistics(::statistics & st) const override;
|
||||
|
||||
// optimization
|
||||
virtual inf_eps value(theory_var);
|
||||
virtual inf_eps maximize(theory_var v, expr_ref& blocker, bool& has_shared);
|
||||
virtual theory_var add_objective(app* term);
|
||||
inf_eps value(theory_var) override;
|
||||
inf_eps maximize(theory_var v, expr_ref& blocker, bool& has_shared) override;
|
||||
theory_var add_objective(app* term) override;
|
||||
virtual expr_ref mk_ge(filter_model_converter& fm, theory_var v, inf_rational const& val);
|
||||
|
||||
|
||||
|
|
|
@ -254,7 +254,7 @@ namespace smt {
|
|||
unsigned v;
|
||||
public:
|
||||
remove_var(theory_pb& pb, unsigned v): pb(pb), v(v) {}
|
||||
virtual void undo(context& ctx) {
|
||||
void undo(context& ctx) override {
|
||||
pb.m_vars.remove(v);
|
||||
pb.m_simplex.unset_lower(v);
|
||||
pb.m_simplex.unset_upper(v);
|
||||
|
@ -282,7 +282,7 @@ namespace smt {
|
|||
m_last_bound_valid(last_bound_valid),
|
||||
m_last_explain(last_explain) {}
|
||||
|
||||
virtual void undo(context& ctx) {
|
||||
void undo(context& ctx) override {
|
||||
if (m_is_lower) {
|
||||
if (m_last_bound_valid) {
|
||||
pb.m_simplex.set_lower(m_v, m_last_bound);
|
||||
|
@ -403,12 +403,12 @@ namespace smt {
|
|||
}
|
||||
|
||||
m_stats.m_num_conflicts++;
|
||||
justification* js = 0;
|
||||
justification* js = nullptr;
|
||||
if (proofs_enabled()) {
|
||||
js = alloc(theory_lemma_justification, get_id(), ctx, lits.size(), lits.c_ptr());
|
||||
}
|
||||
TRACE("pb", tout << lits << "\n";);
|
||||
ctx.mk_clause(lits.size(), lits.c_ptr(), js, CLS_AUX_LEMMA, 0);
|
||||
ctx.mk_clause(lits.size(), lits.c_ptr(), js, CLS_AUX_LEMMA, nullptr);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -697,7 +697,7 @@ namespace smt {
|
|||
void theory_pb::watch_literal(literal lit, ineq* c) {
|
||||
init_watch(lit.var());
|
||||
ptr_vector<ineq>* ineqs = m_var_infos[lit.var()].m_lit_watch[lit.sign()];
|
||||
if (ineqs == 0) {
|
||||
if (ineqs == nullptr) {
|
||||
ineqs = alloc(ptr_vector<ineq>);
|
||||
m_var_infos[lit.var()].m_lit_watch[lit.sign()] = ineqs;
|
||||
}
|
||||
|
@ -707,7 +707,7 @@ namespace smt {
|
|||
void theory_pb::watch_var(bool_var v, ineq* c) {
|
||||
init_watch(v);
|
||||
ptr_vector<ineq>* ineqs = m_var_infos[v].m_var_watch;
|
||||
if (ineqs == 0) {
|
||||
if (ineqs == nullptr) {
|
||||
ineqs = alloc(ptr_vector<ineq>);
|
||||
m_var_infos[v].m_var_watch = ineqs;
|
||||
}
|
||||
|
@ -770,12 +770,12 @@ namespace smt {
|
|||
}
|
||||
|
||||
void theory_pb::assign_eh(bool_var v, bool is_true) {
|
||||
ptr_vector<ineq>* ineqs = 0;
|
||||
ptr_vector<ineq>* ineqs = nullptr;
|
||||
literal nlit(v, is_true);
|
||||
init_watch(v);
|
||||
TRACE("pb", tout << "assign: " << ~nlit << "\n";);
|
||||
ineqs = m_var_infos[v].m_lit_watch[nlit.sign()];
|
||||
if (ineqs != 0) {
|
||||
if (ineqs != nullptr) {
|
||||
if (m_enable_simplex) {
|
||||
mpq_inf num(mpq(is_true?1:0),mpq(0));
|
||||
if (!update_bound(v, ~nlit, is_true, num)) {
|
||||
|
@ -796,14 +796,14 @@ namespace smt {
|
|||
}
|
||||
}
|
||||
ineqs = m_var_infos[v].m_var_watch;
|
||||
if (ineqs != 0) {
|
||||
if (ineqs != nullptr) {
|
||||
for (unsigned i = 0; i < ineqs->size(); ++i) {
|
||||
ineq* c = (*ineqs)[i];
|
||||
assign_watch(v, is_true, *c);
|
||||
}
|
||||
}
|
||||
ineq* c = m_var_infos[v].m_ineq;
|
||||
if (c != 0) {
|
||||
if (c != nullptr) {
|
||||
if (m_enable_simplex) {
|
||||
row_info const& info = m_ineq_row_info.find(v);
|
||||
unsynch_mpq_manager mgr;
|
||||
|
@ -889,7 +889,7 @@ namespace smt {
|
|||
ineq& c;
|
||||
public:
|
||||
rewatch_vars(theory_pb& p, ineq& c): pb(p), c(c) {}
|
||||
virtual void undo(context& ctx) {
|
||||
void undo(context& ctx) override {
|
||||
for (unsigned i = 0; i < c.size(); ++i) {
|
||||
pb.watch_var(c.lit(i).var(), &c);
|
||||
}
|
||||
|
@ -900,7 +900,7 @@ namespace smt {
|
|||
ineq& c;
|
||||
public:
|
||||
negate_ineq(ineq& c): c(c) {}
|
||||
virtual void undo(context& ctx) {
|
||||
void undo(context& ctx) override {
|
||||
c.negate();
|
||||
}
|
||||
};
|
||||
|
@ -1197,7 +1197,7 @@ namespace smt {
|
|||
|
||||
void mk_clause(unsigned n, literal const* ls) {
|
||||
literal_vector tmp(n, ls);
|
||||
ctx.mk_clause(n, tmp.c_ptr(), th.justify(tmp), CLS_AUX, 0);
|
||||
ctx.mk_clause(n, tmp.c_ptr(), th.justify(tmp), CLS_AUX, nullptr);
|
||||
}
|
||||
|
||||
literal mk_false() { return false_literal; }
|
||||
|
@ -1319,7 +1319,7 @@ namespace smt {
|
|||
bool_var v = m_ineqs_trail.back();
|
||||
ineq* c = m_var_infos[v].m_ineq;
|
||||
clear_watch(*c);
|
||||
m_var_infos[v].m_ineq = 0;
|
||||
m_var_infos[v].m_ineq = nullptr;
|
||||
m_ineqs_trail.pop_back();
|
||||
if (m_enable_simplex) {
|
||||
row_info r_info;
|
||||
|
@ -1357,7 +1357,7 @@ namespace smt {
|
|||
public:
|
||||
unwatch_ge(theory_pb& p, ineq& c): pb(p), c(c) {}
|
||||
|
||||
virtual void undo(context& ctx) {
|
||||
void undo(context& ctx) override {
|
||||
for (unsigned i = 0; i < c.watch_size(); ++i) {
|
||||
pb.unwatch_literal(c.lit(i), &c);
|
||||
}
|
||||
|
@ -1449,7 +1449,7 @@ namespace smt {
|
|||
tout << "\n";
|
||||
display(tout, c, true););
|
||||
|
||||
justification* js = 0;
|
||||
justification* js = nullptr;
|
||||
|
||||
if (m_conflict_frequency == 0 || (m_conflict_frequency -1 == (c.m_num_propagations % m_conflict_frequency))) {
|
||||
resolve_conflict(c);
|
||||
|
@ -1458,7 +1458,7 @@ namespace smt {
|
|||
js = alloc(theory_lemma_justification, get_id(), ctx, lits.size(), lits.c_ptr());
|
||||
}
|
||||
TRACE("pb", tout << lits << "\n";);
|
||||
ctx.mk_clause(lits.size(), lits.c_ptr(), js, CLS_AUX_LEMMA, 0);
|
||||
ctx.mk_clause(lits.size(), lits.c_ptr(), js, CLS_AUX_LEMMA, nullptr);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1702,18 +1702,18 @@ namespace smt {
|
|||
break;
|
||||
case b_justification::JUSTIFICATION: {
|
||||
justification* j = js.get_justification();
|
||||
pb_justification* pbj = 0;
|
||||
pb_justification* pbj = nullptr;
|
||||
|
||||
if (!conseq.sign() && j->get_from_theory() == get_id()) {
|
||||
pbj = dynamic_cast<pb_justification*>(j);
|
||||
}
|
||||
if (pbj && pbj->get_ineq().is_eq()) {
|
||||
// only resolve >= that are positive consequences.
|
||||
pbj = 0;
|
||||
pbj = nullptr;
|
||||
}
|
||||
if (pbj && pbj->get_ineq().lit() == conseq) {
|
||||
// can't resolve against literal representing inequality.
|
||||
pbj = 0;
|
||||
pbj = nullptr;
|
||||
}
|
||||
if (pbj) {
|
||||
// weaken the lemma and resolve.
|
||||
|
@ -1765,7 +1765,7 @@ namespace smt {
|
|||
m_ineq_literals[i].neg();
|
||||
}
|
||||
TRACE("pb", tout << m_ineq_literals << "\n";);
|
||||
ctx.mk_clause(m_ineq_literals.size(), m_ineq_literals.c_ptr(), justify(m_ineq_literals), CLS_AUX_LEMMA, 0);
|
||||
ctx.mk_clause(m_ineq_literals.size(), m_ineq_literals.c_ptr(), justify(m_ineq_literals), CLS_AUX_LEMMA, nullptr);
|
||||
break;
|
||||
default: {
|
||||
app_ref tmp = m_lemma.to_expr(false, ctx, get_manager());
|
||||
|
@ -1785,7 +1785,7 @@ namespace smt {
|
|||
|
||||
justification* theory_pb::justify(literal l1, literal l2) {
|
||||
literal lits[2] = { l1, l2 };
|
||||
justification* js = 0;
|
||||
justification* js = nullptr;
|
||||
if (proofs_enabled()) {
|
||||
js = get_context().mk_justification(theory_axiom_justification(get_id(), get_context().get_region(), 2, lits));
|
||||
}
|
||||
|
@ -1793,7 +1793,7 @@ namespace smt {
|
|||
}
|
||||
|
||||
justification* theory_pb::justify(literal_vector const& lits) {
|
||||
justification* js = 0;
|
||||
justification* js = nullptr;
|
||||
if (proofs_enabled()) {
|
||||
js = get_context().mk_justification(theory_axiom_justification(get_id(), get_context().get_region(), lits.size(), lits.c_ptr()));
|
||||
}
|
||||
|
@ -2008,11 +2008,11 @@ namespace smt {
|
|||
m_dependencies.push_back(model_value_dependency(n));
|
||||
}
|
||||
|
||||
virtual void get_dependencies(buffer<model_value_dependency> & result) {
|
||||
void get_dependencies(buffer<model_value_dependency> & result) override {
|
||||
result.append(m_dependencies.size(), m_dependencies.c_ptr());
|
||||
}
|
||||
|
||||
virtual app * mk_value(model_generator & mg, ptr_vector<expr> & values) {
|
||||
app * mk_value(model_generator & mg, ptr_vector<expr> & values) override {
|
||||
ast_manager& m = mg.get_manager();
|
||||
SASSERT(values.size() == m_dependencies.size());
|
||||
SASSERT(values.size() == m_app->get_num_args());
|
||||
|
@ -2038,9 +2038,9 @@ namespace smt {
|
|||
return (sum >= k)?m.mk_true():m.mk_false();
|
||||
default:
|
||||
UNREACHABLE();
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -2049,18 +2049,18 @@ namespace smt {
|
|||
pb_factory(ast_manager& m, family_id fid):
|
||||
value_factory(m, fid) {}
|
||||
|
||||
virtual expr * get_some_value(sort * s) {
|
||||
expr * get_some_value(sort * s) override {
|
||||
return m_manager.mk_true();
|
||||
}
|
||||
virtual bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2) {
|
||||
bool get_some_values(sort * s, expr_ref & v1, expr_ref & v2) override {
|
||||
v1 = m_manager.mk_true();
|
||||
v2 = m_manager.mk_false();
|
||||
return true;
|
||||
}
|
||||
virtual expr * get_fresh_value(sort * s) {
|
||||
return 0;
|
||||
expr * get_fresh_value(sort * s) override {
|
||||
return nullptr;
|
||||
}
|
||||
virtual void register_value(expr * n) { }
|
||||
void register_value(expr * n) override { }
|
||||
};
|
||||
|
||||
void theory_pb::init_model(model_generator & m) {
|
||||
|
|
|
@ -198,10 +198,10 @@ namespace smt {
|
|||
watch_list* m_var_watch;
|
||||
ineq* m_ineq;
|
||||
|
||||
var_info(): m_var_watch(0), m_ineq(0)
|
||||
var_info(): m_var_watch(nullptr), m_ineq(nullptr)
|
||||
{
|
||||
m_lit_watch[0] = 0;
|
||||
m_lit_watch[1] = 0;
|
||||
m_lit_watch[0] = nullptr;
|
||||
m_lit_watch[1] = nullptr;
|
||||
}
|
||||
|
||||
void reset() {
|
||||
|
@ -261,7 +261,7 @@ namespace smt {
|
|||
|
||||
std::ostream& display(std::ostream& out, ineq const& c, bool values = false) const;
|
||||
std::ostream& display(std::ostream& out, arg_t const& c, bool values = false) const;
|
||||
virtual void display(std::ostream& out) const;
|
||||
void display(std::ostream& out) const override;
|
||||
void display_watch(std::ostream& out, bool_var v, bool sign) const;
|
||||
void display_resolved_lemma(std::ostream& out) const;
|
||||
|
||||
|
@ -317,26 +317,26 @@ namespace smt {
|
|||
public:
|
||||
theory_pb(ast_manager& m, theory_pb_params& p);
|
||||
|
||||
virtual ~theory_pb();
|
||||
~theory_pb() override;
|
||||
|
||||
virtual theory * mk_fresh(context * new_ctx);
|
||||
virtual bool internalize_atom(app * atom, bool gate_ctx);
|
||||
virtual bool internalize_term(app * term) { UNREACHABLE(); return false; }
|
||||
virtual void new_eq_eh(theory_var v1, theory_var v2);
|
||||
virtual void new_diseq_eh(theory_var v1, theory_var v2) { }
|
||||
virtual bool use_diseqs() const { return false; }
|
||||
virtual bool build_models() const { return false; }
|
||||
virtual final_check_status final_check_eh();
|
||||
virtual void reset_eh();
|
||||
virtual void assign_eh(bool_var v, bool is_true);
|
||||
virtual void init_search_eh();
|
||||
virtual void push_scope_eh();
|
||||
virtual void pop_scope_eh(unsigned num_scopes);
|
||||
virtual void restart_eh();
|
||||
virtual void collect_statistics(::statistics & st) const;
|
||||
virtual model_value_proc * mk_value(enode * n, model_generator & mg);
|
||||
virtual void init_model(model_generator & m);
|
||||
virtual bool include_func_interp(func_decl* f) { return false; }
|
||||
theory * mk_fresh(context * new_ctx) override;
|
||||
bool internalize_atom(app * atom, bool gate_ctx) override;
|
||||
bool internalize_term(app * term) override { UNREACHABLE(); return false; }
|
||||
void new_eq_eh(theory_var v1, theory_var v2) override;
|
||||
void new_diseq_eh(theory_var v1, theory_var v2) override { }
|
||||
bool use_diseqs() const override { return false; }
|
||||
bool build_models() const override { return false; }
|
||||
final_check_status final_check_eh() override;
|
||||
void reset_eh() override;
|
||||
void assign_eh(bool_var v, bool is_true) override;
|
||||
void init_search_eh() override;
|
||||
void push_scope_eh() override;
|
||||
void pop_scope_eh(unsigned num_scopes) override;
|
||||
void restart_eh() override;
|
||||
void collect_statistics(::statistics & st) const override;
|
||||
model_value_proc * mk_value(enode * n, model_generator & mg) override;
|
||||
void init_model(model_generator & m) override;
|
||||
bool include_func_interp(func_decl* f) override { return false; }
|
||||
|
||||
static literal assert_ge(context& ctx, unsigned k, unsigned n, literal const* xs);
|
||||
};
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -37,7 +37,7 @@ namespace smt {
|
|||
enode* n1, *n2;
|
||||
literal lit;
|
||||
assumption(enode* n1, enode* n2): n1(n1), n2(n2), lit(null_literal) {}
|
||||
assumption(literal lit): n1(0), n2(0), lit(lit) {}
|
||||
assumption(literal lit): n1(nullptr), n2(nullptr), lit(lit) {}
|
||||
};
|
||||
typedef scoped_dependency_manager<assumption> dependency_manager;
|
||||
typedef dependency_manager::dependency dependency;
|
||||
|
@ -224,8 +224,8 @@ namespace smt {
|
|||
expr_ref m_e;
|
||||
public:
|
||||
replay_length_coherence(ast_manager& m, expr* e) : m_e(e, m) {}
|
||||
virtual ~replay_length_coherence() {}
|
||||
virtual void operator()(theory_seq& th) {
|
||||
~replay_length_coherence() override {}
|
||||
void operator()(theory_seq& th) override {
|
||||
th.check_length_coherence(m_e);
|
||||
m_e.reset();
|
||||
}
|
||||
|
@ -235,8 +235,8 @@ namespace smt {
|
|||
expr_ref m_e;
|
||||
public:
|
||||
replay_fixed_length(ast_manager& m, expr* e) : m_e(e, m) {}
|
||||
virtual ~replay_fixed_length() {}
|
||||
virtual void operator()(theory_seq& th) {
|
||||
~replay_fixed_length() override {}
|
||||
void operator()(theory_seq& th) override {
|
||||
th.fixed_length(m_e);
|
||||
m_e.reset();
|
||||
}
|
||||
|
@ -246,8 +246,8 @@ namespace smt {
|
|||
expr_ref m_e;
|
||||
public:
|
||||
replay_axiom(ast_manager& m, expr* e) : m_e(e, m) {}
|
||||
virtual ~replay_axiom() {}
|
||||
virtual void operator()(theory_seq& th) {
|
||||
~replay_axiom() override {}
|
||||
void operator()(theory_seq& th) override {
|
||||
th.enque_axiom(m_e);
|
||||
m_e.reset();
|
||||
}
|
||||
|
@ -257,7 +257,7 @@ namespace smt {
|
|||
apply* m_apply;
|
||||
public:
|
||||
push_replay(apply* app): m_apply(app) {}
|
||||
virtual void undo(theory_seq& th) {
|
||||
void undo(theory_seq& th) override {
|
||||
th.m_replay.push_back(m_apply);
|
||||
}
|
||||
};
|
||||
|
@ -266,7 +266,7 @@ namespace smt {
|
|||
unsigned k;
|
||||
public:
|
||||
pop_branch(unsigned k): k(k) {}
|
||||
virtual void undo(theory_seq& th) {
|
||||
void undo(theory_seq& th) override {
|
||||
th.m_branch_start.erase(k);
|
||||
}
|
||||
};
|
||||
|
@ -340,29 +340,29 @@ namespace smt {
|
|||
|
||||
obj_hashtable<expr> m_fixed; // string variables that are fixed length.
|
||||
|
||||
virtual void init(context* ctx);
|
||||
virtual final_check_status final_check_eh();
|
||||
virtual bool internalize_atom(app* atom, bool);
|
||||
virtual bool internalize_term(app*);
|
||||
virtual void internalize_eq_eh(app * atom, bool_var v);
|
||||
virtual void new_eq_eh(theory_var, theory_var);
|
||||
virtual void new_diseq_eh(theory_var, theory_var);
|
||||
virtual void assign_eh(bool_var v, bool is_true);
|
||||
virtual bool can_propagate();
|
||||
virtual void propagate();
|
||||
virtual void push_scope_eh();
|
||||
virtual void pop_scope_eh(unsigned num_scopes);
|
||||
virtual void restart_eh();
|
||||
virtual void relevant_eh(app* n);
|
||||
virtual theory* mk_fresh(context* new_ctx) { return alloc(theory_seq, new_ctx->get_manager()); }
|
||||
virtual char const * get_name() const { return "seq"; }
|
||||
virtual theory_var mk_var(enode* n);
|
||||
virtual void apply_sort_cnstr(enode* n, sort* s);
|
||||
virtual void display(std::ostream & out) const;
|
||||
virtual void collect_statistics(::statistics & st) const;
|
||||
virtual model_value_proc * mk_value(enode * n, model_generator & mg);
|
||||
virtual void init_model(model_generator & mg);
|
||||
virtual void init_search_eh();
|
||||
void init(context* ctx) override;
|
||||
final_check_status final_check_eh() override;
|
||||
bool internalize_atom(app* atom, bool) override;
|
||||
bool internalize_term(app*) override;
|
||||
void internalize_eq_eh(app * atom, bool_var v) override;
|
||||
void new_eq_eh(theory_var, theory_var) override;
|
||||
void new_diseq_eh(theory_var, theory_var) override;
|
||||
void assign_eh(bool_var v, bool is_true) override;
|
||||
bool can_propagate() override;
|
||||
void propagate() override;
|
||||
void push_scope_eh() override;
|
||||
void pop_scope_eh(unsigned num_scopes) override;
|
||||
void restart_eh() override;
|
||||
void relevant_eh(app* n) override;
|
||||
theory* mk_fresh(context* new_ctx) override { return alloc(theory_seq, new_ctx->get_manager()); }
|
||||
char const * get_name() const override { return "seq"; }
|
||||
theory_var mk_var(enode* n) override;
|
||||
void apply_sort_cnstr(enode* n, sort* s) override;
|
||||
void display(std::ostream & out) const override;
|
||||
void collect_statistics(::statistics & st) const override;
|
||||
model_value_proc * mk_value(enode * n, model_generator & mg) override;
|
||||
void init_model(model_generator & mg) override;
|
||||
void init_search_eh() override;
|
||||
|
||||
void init_model(expr_ref_vector const& es);
|
||||
// final check
|
||||
|
@ -410,6 +410,8 @@ namespace smt {
|
|||
expr_ref mk_empty(sort* s) { return expr_ref(m_util.str.mk_empty(s), m); }
|
||||
expr_ref mk_concat(unsigned n, expr*const* es) { return expr_ref(m_util.str.mk_concat(n, es), m); }
|
||||
expr_ref mk_concat(expr_ref_vector const& es, sort* s) { if (es.empty()) return mk_empty(s); return mk_concat(es.size(), es.c_ptr()); }
|
||||
expr_ref mk_concat(expr_ref_vector const& es) { SASSERT(!es.empty()); return mk_concat(es.size(), es.c_ptr()); }
|
||||
expr_ref mk_concat(ptr_vector<expr> const& es) { SASSERT(!es.empty()); return mk_concat(es.size(), es.c_ptr()); }
|
||||
expr_ref mk_concat(expr* e1, expr* e2) { return expr_ref(m_util.str.mk_concat(e1, e2), m); }
|
||||
expr_ref mk_concat(expr* e1, expr* e2, expr* e3) { return expr_ref(m_util.str.mk_concat(e1, e2, e3), m); }
|
||||
bool solve_nqs(unsigned i);
|
||||
|
@ -432,11 +434,13 @@ namespace smt {
|
|||
|
||||
// asserting consequences
|
||||
bool linearize(dependency* dep, enode_pair_vector& eqs, literal_vector& lits) const;
|
||||
void propagate_lit(dependency* dep, literal lit) { propagate_lit(dep, 0, 0, lit); }
|
||||
void propagate_lit(dependency* dep, literal lit) { propagate_lit(dep, 0, nullptr, lit); }
|
||||
void propagate_lit(dependency* dep, unsigned n, literal const* lits, literal lit);
|
||||
void propagate_eq(dependency* dep, enode* n1, enode* n2);
|
||||
void propagate_eq(literal lit, expr* e1, expr* e2, bool add_to_eqs);
|
||||
void propagate_eq(dependency* dep, literal_vector const& lits, expr* e1, expr* e2, bool add_to_eqs);
|
||||
void propagate_eq(dependency* dep, literal_vector const& lits, expr* e1, expr* e2, bool add_to_eqs = true);
|
||||
void propagate_eq(dependency* dep, expr* e1, expr* e2, bool add_to_eqs = true);
|
||||
void propagate_eq(dependency* dep, literal lit, expr* e1, expr* e2, bool add_to_eqs = true);
|
||||
void set_conflict(dependency* dep, literal_vector const& lits = literal_vector());
|
||||
|
||||
u_map<unsigned> m_branch_start;
|
||||
|
@ -503,8 +507,10 @@ namespace smt {
|
|||
void add_elim_string_axiom(expr* n);
|
||||
void add_at_axiom(expr* n);
|
||||
void add_in_re_axiom(expr* n);
|
||||
bool add_stoi_axiom(expr* n);
|
||||
bool add_itos_axiom(expr* n);
|
||||
void add_itos_axiom(expr* n);
|
||||
void add_stoi_axiom(expr* n);
|
||||
bool add_stoi_val_axiom(expr* n);
|
||||
bool add_itos_val_axiom(expr* n);
|
||||
literal is_digit(expr* ch);
|
||||
expr_ref digit2int(expr* ch);
|
||||
void add_itos_length_axiom(expr* n);
|
||||
|
@ -527,7 +533,7 @@ namespace smt {
|
|||
bool get_length(expr* s, rational& val) const;
|
||||
|
||||
void mk_decompose(expr* e, expr_ref& head, expr_ref& tail);
|
||||
expr_ref mk_skolem(symbol const& s, expr* e1, expr* e2 = 0, expr* e3 = 0, sort* range = 0);
|
||||
expr_ref mk_skolem(symbol const& s, expr* e1, expr* e2 = nullptr, expr* e3 = nullptr, sort* range = nullptr);
|
||||
bool is_skolem(symbol const& s, expr* e) const;
|
||||
|
||||
void set_incomplete(app* term);
|
||||
|
@ -580,7 +586,7 @@ namespace smt {
|
|||
void display_nc(std::ostream& out, nc const& nc) const;
|
||||
public:
|
||||
theory_seq(ast_manager& m);
|
||||
virtual ~theory_seq();
|
||||
~theory_seq() override;
|
||||
|
||||
// model building
|
||||
app* mk_value(app* a);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue