mirror of
https://github.com/Z3Prover/z3
synced 2025-06-03 12:51:22 +00:00
adding instrumentation to debug #1233
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
14714f2803
commit
33e8113c9e
6 changed files with 94 additions and 127 deletions
|
@ -149,30 +149,27 @@ namespace pdr {
|
||||||
}
|
}
|
||||||
|
|
||||||
datalog::rule const& pred_transformer::find_rule(model_core const& model) const {
|
datalog::rule const& pred_transformer::find_rule(model_core const& model) const {
|
||||||
obj_map<expr, datalog::rule const*>::iterator it = m_tag2rule.begin(), end = m_tag2rule.end();
|
|
||||||
TRACE("pdr_verbose",
|
TRACE("pdr_verbose",
|
||||||
datalog::rule_manager& rm = ctx.get_context().get_rule_manager();
|
datalog::rule_manager& rm = ctx.get_context().get_rule_manager();
|
||||||
for (; it != end; ++it) {
|
for (auto const& kv : m_tag2rule) {
|
||||||
expr* pred = it->m_key;
|
expr* pred = kv.m_key;
|
||||||
tout << mk_pp(pred, m) << ":\n";
|
tout << mk_pp(pred, m) << ":\n";
|
||||||
if (it->m_value) rm.display_smt2(*it->m_value, tout) << "\n";
|
if (kv.m_value) rm.display_smt2(*kv.m_value, tout) << "\n";
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
it = m_tag2rule.begin();
|
|
||||||
if (m_tag2rule.size() == 1) {
|
if (m_tag2rule.size() == 1) {
|
||||||
return *it->m_value;
|
return *m_tag2rule.begin()->m_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
expr_ref vl(m);
|
expr_ref vl(m);
|
||||||
for (; it != end; ++it) {
|
for (auto const& kv : m_tag2rule) {
|
||||||
expr* pred = it->m_key;
|
expr* pred = kv.m_key;
|
||||||
if (model.eval(to_app(pred)->get_decl(), vl) && m.is_true(vl)) {
|
if (model.eval(to_app(pred)->get_decl(), vl) && m.is_true(vl)) {
|
||||||
return *it->m_value;
|
return *kv.m_value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UNREACHABLE();
|
throw default_exception("could not find rule");
|
||||||
return *((datalog::rule*)0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void pred_transformer::find_predecessors(datalog::rule const& r, ptr_vector<func_decl>& preds) const {
|
void pred_transformer::find_predecessors(datalog::rule const& r, ptr_vector<func_decl>& preds) const {
|
||||||
|
@ -201,7 +198,7 @@ namespace pdr {
|
||||||
|
|
||||||
void pred_transformer::simplify_formulas(tactic& tac, expr_ref_vector& v) {
|
void pred_transformer::simplify_formulas(tactic& tac, expr_ref_vector& v) {
|
||||||
goal_ref g(alloc(goal, m, false, false, false));
|
goal_ref g(alloc(goal, m, false, false, false));
|
||||||
for (unsigned j = 0; j < v.size(); ++j) g->assert_expr(v[j].get());
|
for (expr* e : v) g->assert_expr(e);
|
||||||
model_converter_ref mc;
|
model_converter_ref mc;
|
||||||
proof_converter_ref pc;
|
proof_converter_ref pc;
|
||||||
expr_dependency_ref core(m);
|
expr_dependency_ref core(m);
|
||||||
|
@ -216,9 +213,8 @@ namespace pdr {
|
||||||
void pred_transformer::simplify_formulas() {
|
void pred_transformer::simplify_formulas() {
|
||||||
tactic_ref us = mk_unit_subsumption_tactic(m);
|
tactic_ref us = mk_unit_subsumption_tactic(m);
|
||||||
simplify_formulas(*us, m_invariants);
|
simplify_formulas(*us, m_invariants);
|
||||||
for (unsigned i = 0; i < m_levels.size(); ++i) {
|
for (auto & fmls : m_levels)
|
||||||
simplify_formulas(*us, m_levels[i]);
|
simplify_formulas(*us, fmls);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
expr_ref pred_transformer::get_formulas(unsigned level, bool add_axioms) {
|
expr_ref pred_transformer::get_formulas(unsigned level, bool add_axioms) {
|
||||||
|
|
|
@ -257,10 +257,8 @@ namespace smt {
|
||||||
literal_vector & antecedents = m_tmp_literal_vector;
|
literal_vector & antecedents = m_tmp_literal_vector;
|
||||||
antecedents.reset();
|
antecedents.reset();
|
||||||
justification2literals(js, antecedents);
|
justification2literals(js, antecedents);
|
||||||
literal_vector::iterator it = antecedents.begin();
|
for (literal lit : antecedents)
|
||||||
literal_vector::iterator end = antecedents.end();
|
r = std::max(r, m_ctx.get_assign_level(lit));
|
||||||
for(; it != end; ++it)
|
|
||||||
r = std::max(r, m_ctx.get_assign_level(*it));
|
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,6 +333,7 @@ namespace smt {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lvl == m_conflict_lvl) {
|
if (lvl == m_conflict_lvl) {
|
||||||
|
TRACE("conflict", m_ctx.display_literal(tout << "marking:", antecedent) << "\n";);
|
||||||
num_marks++;
|
num_marks++;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -486,6 +485,20 @@ namespace smt {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool conflict_resolution::resolve(b_justification conflict, literal not_l) {
|
bool conflict_resolution::resolve(b_justification conflict, literal not_l) {
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
// for debugging #1233
|
||||||
|
if (not_l == to_literal(22267)) {
|
||||||
|
std::cout << not_l << "\n";
|
||||||
|
enable_trace("conflict");
|
||||||
|
enable_trace("conflict_verbose");
|
||||||
|
TRACE("conflict",
|
||||||
|
unsigned idx = 0;
|
||||||
|
for (literal lit : m_assigned_literals) {
|
||||||
|
m_ctx.display_literal(tout << (idx++) << ":", lit); tout << "\n";
|
||||||
|
});
|
||||||
|
}
|
||||||
|
#endif
|
||||||
b_justification js;
|
b_justification js;
|
||||||
literal consequent;
|
literal consequent;
|
||||||
|
|
||||||
|
@ -514,7 +527,7 @@ namespace smt {
|
||||||
get_manager().trace_stream() << "\n";
|
get_manager().trace_stream() << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("conflict", tout << "processing consequent: "; m_ctx.display_literal_verbose(tout, consequent); tout << "\n";
|
TRACE("conflict", tout << "processing consequent: " << idx << " "; m_ctx.display_literal_verbose(tout, consequent); tout << "\n";
|
||||||
tout << "num_marks: " << num_marks << ", js kind: " << js.get_kind() << " level: " << m_ctx.get_assign_level(consequent) << "\n";
|
tout << "num_marks: " << num_marks << ", js kind: " << js.get_kind() << " level: " << m_ctx.get_assign_level(consequent) << "\n";
|
||||||
);
|
);
|
||||||
SASSERT(js != null_b_justification);
|
SASSERT(js != null_b_justification);
|
||||||
|
@ -566,8 +579,10 @@ namespace smt {
|
||||||
if (m_ctx.is_marked(l.var()))
|
if (m_ctx.is_marked(l.var()))
|
||||||
break;
|
break;
|
||||||
CTRACE("conflict", m_ctx.get_assign_level(l) != m_conflict_lvl && m_ctx.get_assign_level(l) != m_ctx.get_base_level(),
|
CTRACE("conflict", m_ctx.get_assign_level(l) != m_conflict_lvl && m_ctx.get_assign_level(l) != m_ctx.get_base_level(),
|
||||||
tout << "assign_level(l): " << m_ctx.get_assign_level(l) << ", conflict_lvl: " << m_conflict_lvl << ", l: "; m_ctx.display_literal_verbose(tout, l);
|
tout << "assign_level(l): " << m_ctx.get_assign_level(l) << ", conflict_lvl: ";
|
||||||
tout << "\n";);
|
tout << m_conflict_lvl << ", l: "; m_ctx.display_literal_verbose(tout, l);
|
||||||
|
tout << "\n";
|
||||||
|
tout << "num marks: " << num_marks << "\n";);
|
||||||
SASSERT(m_ctx.get_assign_level(l) == m_conflict_lvl ||
|
SASSERT(m_ctx.get_assign_level(l) == m_conflict_lvl ||
|
||||||
// it may also be an (out-of-order) asserted literal
|
// it may also be an (out-of-order) asserted literal
|
||||||
m_ctx.get_assign_level(l) == m_ctx.get_base_level());
|
m_ctx.get_assign_level(l) == m_ctx.get_base_level());
|
||||||
|
@ -606,10 +621,8 @@ namespace smt {
|
||||||
*/
|
*/
|
||||||
level_approx_set conflict_resolution::get_lemma_approx_level_set() {
|
level_approx_set conflict_resolution::get_lemma_approx_level_set() {
|
||||||
level_approx_set result;
|
level_approx_set result;
|
||||||
literal_vector::const_iterator it = m_lemma.begin();
|
for (literal l : m_lemma)
|
||||||
literal_vector::const_iterator end = m_lemma.end();
|
result.insert(m_ctx.get_assign_level(l));
|
||||||
for(; it != end; ++it)
|
|
||||||
result.insert(m_ctx.get_assign_level(*it));
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -660,10 +673,8 @@ namespace smt {
|
||||||
// The method unmark_justifications must be invoked to reset these caches.
|
// The method unmark_justifications must be invoked to reset these caches.
|
||||||
// Remark: The method reset_unmark_and_justifications invokes unmark_justifications.
|
// Remark: The method reset_unmark_and_justifications invokes unmark_justifications.
|
||||||
justification2literals_core(js, antecedents);
|
justification2literals_core(js, antecedents);
|
||||||
literal_vector::iterator it = antecedents.begin();
|
for (literal l : antecedents)
|
||||||
literal_vector::iterator end = antecedents.end();
|
if (!process_antecedent_for_minimization(l))
|
||||||
for(; it != end; ++it)
|
|
||||||
if (!process_antecedent_for_minimization(*it))
|
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1063,10 +1074,8 @@ namespace smt {
|
||||||
m_eq2proof.reset();
|
m_eq2proof.reset();
|
||||||
m_lit2proof.reset();
|
m_lit2proof.reset();
|
||||||
m_js2proof.reset();
|
m_js2proof.reset();
|
||||||
literal_vector::iterator it = m_lemma.begin();
|
for (literal lit : m_lemma)
|
||||||
literal_vector::iterator end = m_lemma.end();
|
m_ctx.set_mark(lit.var());
|
||||||
for (; it != end; ++it)
|
|
||||||
m_ctx.set_mark((*it).var());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool conflict_resolution::visit_b_justification(literal l, b_justification js) {
|
bool conflict_resolution::visit_b_justification(literal l, b_justification js) {
|
||||||
|
@ -1246,12 +1255,9 @@ namespace smt {
|
||||||
SASSERT(conflict.get_kind() != b_justification::BIN_CLAUSE);
|
SASSERT(conflict.get_kind() != b_justification::BIN_CLAUSE);
|
||||||
SASSERT(conflict.get_kind() != b_justification::AXIOM);
|
SASSERT(conflict.get_kind() != b_justification::AXIOM);
|
||||||
SASSERT(not_l == null_literal || conflict.get_kind() == b_justification::JUSTIFICATION);
|
SASSERT(not_l == null_literal || conflict.get_kind() == b_justification::JUSTIFICATION);
|
||||||
TRACE("mk_conflict_proof", tout << "lemma literals: ";
|
TRACE("mk_conflict_proof", tout << "lemma literals:";
|
||||||
literal_vector::iterator it = m_lemma.begin();
|
for (literal lit : m_lemma) {
|
||||||
literal_vector::iterator end = m_lemma.end();
|
m_ctx.display_literal(tout << " ", lit);
|
||||||
for (; it != end; ++it) {
|
|
||||||
m_ctx.display_literal(tout, *it);
|
|
||||||
tout << " ";
|
|
||||||
}
|
}
|
||||||
tout << "\n";);
|
tout << "\n";);
|
||||||
init_mk_proof();
|
init_mk_proof();
|
||||||
|
@ -1328,12 +1334,10 @@ namespace smt {
|
||||||
pr = m_manager.mk_unit_resolution(2, prs);
|
pr = m_manager.mk_unit_resolution(2, prs);
|
||||||
}
|
}
|
||||||
expr_ref_buffer lits(m_manager);
|
expr_ref_buffer lits(m_manager);
|
||||||
literal_vector::iterator it = m_lemma.begin();
|
for (literal lit : m_lemma) {
|
||||||
literal_vector::iterator end = m_lemma.end();
|
m_ctx.unset_mark(lit.var());
|
||||||
for (; it != end; ++it) {
|
|
||||||
m_ctx.unset_mark((*it).var());
|
|
||||||
expr_ref l_expr(m_manager);
|
expr_ref l_expr(m_manager);
|
||||||
m_ctx.literal2expr(*it, l_expr);
|
m_ctx.literal2expr(lit, l_expr);
|
||||||
lits.push_back(l_expr);
|
lits.push_back(l_expr);
|
||||||
}
|
}
|
||||||
expr * fact = 0;
|
expr * fact = 0;
|
||||||
|
@ -1369,10 +1373,8 @@ namespace smt {
|
||||||
literal_vector & antecedents = m_tmp_literal_vector;
|
literal_vector & antecedents = m_tmp_literal_vector;
|
||||||
antecedents.reset();
|
antecedents.reset();
|
||||||
justification2literals_core(js, antecedents);
|
justification2literals_core(js, antecedents);
|
||||||
literal_vector::iterator it = antecedents.begin();
|
for (literal lit : antecedents)
|
||||||
literal_vector::iterator end = antecedents.end();
|
process_antecedent_for_unsat_core(lit);
|
||||||
for(; it != end; ++it)
|
|
||||||
process_antecedent_for_unsat_core(*it);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void conflict_resolution::mk_unsat_core(b_justification conflict, literal not_l) {
|
void conflict_resolution::mk_unsat_core(b_justification conflict, literal not_l) {
|
||||||
|
|
|
@ -1615,11 +1615,9 @@ namespace smt {
|
||||||
\brief Return set of assigned literals as expressions.
|
\brief Return set of assigned literals as expressions.
|
||||||
*/
|
*/
|
||||||
void context::get_assignments(expr_ref_vector& assignments) {
|
void context::get_assignments(expr_ref_vector& assignments) {
|
||||||
literal_vector::const_iterator it = m_assigned_literals.begin();
|
for (literal lit : m_assigned_literals) {
|
||||||
literal_vector::const_iterator end = m_assigned_literals.end();
|
|
||||||
for (; it != end; ++it) {
|
|
||||||
expr_ref e(m_manager);
|
expr_ref e(m_manager);
|
||||||
literal2expr(*it, e);
|
literal2expr(lit, e);
|
||||||
assignments.push_back(e);
|
assignments.push_back(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1694,10 +1692,8 @@ namespace smt {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool context::propagate_theories() {
|
bool context::propagate_theories() {
|
||||||
ptr_vector<theory>::iterator it = m_theory_set.begin();
|
for (theory * t : m_theory_set) {
|
||||||
ptr_vector<theory>::iterator end = m_theory_set.end();
|
t->propagate();
|
||||||
for (; it != end; ++it) {
|
|
||||||
(*it)->propagate();
|
|
||||||
if (inconsistent())
|
if (inconsistent())
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1733,10 +1729,8 @@ namespace smt {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool context::can_theories_propagate() const {
|
bool context::can_theories_propagate() const {
|
||||||
ptr_vector<theory>::const_iterator it = m_theory_set.begin();
|
for (theory* t : m_theory_set) {
|
||||||
ptr_vector<theory>::const_iterator end = m_theory_set.end();
|
if (t->can_propagate()) {
|
||||||
for (; it != end; ++it) {
|
|
||||||
if ((*it)->can_propagate()) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1821,7 +1815,7 @@ namespace smt {
|
||||||
}
|
}
|
||||||
|
|
||||||
void context::rescale_bool_var_activity() {
|
void context::rescale_bool_var_activity() {
|
||||||
TRACE("case_split", tout << "rescale\n";);
|
TRACE("case_split", tout << "rescale\n";);
|
||||||
svector<double>::iterator it = m_activity.begin();
|
svector<double>::iterator it = m_activity.begin();
|
||||||
svector<double>::iterator end = m_activity.end();
|
svector<double>::iterator end = m_activity.end();
|
||||||
for (; it != end; ++it)
|
for (; it != end; ++it)
|
||||||
|
@ -1968,10 +1962,8 @@ namespace smt {
|
||||||
m_case_split_queue->push_scope();
|
m_case_split_queue->push_scope();
|
||||||
m_asserted_formulas.push_scope();
|
m_asserted_formulas.push_scope();
|
||||||
|
|
||||||
ptr_vector<theory>::iterator it = m_theory_set.begin();
|
for (theory* t : m_theory_set)
|
||||||
ptr_vector<theory>::iterator end = m_theory_set.end();
|
t->push_scope_eh();
|
||||||
for (; it != end; ++it)
|
|
||||||
(*it)->push_scope_eh();
|
|
||||||
CASSERT("context", check_invariant());
|
CASSERT("context", check_invariant());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2146,10 +2138,7 @@ namespace smt {
|
||||||
}
|
}
|
||||||
for (unsigned i = new_scope_lvl; i <= lim; i++) {
|
for (unsigned i = new_scope_lvl; i <= lim; i++) {
|
||||||
clause_vector & v = m_clauses_to_reinit[i];
|
clause_vector & v = m_clauses_to_reinit[i];
|
||||||
clause_vector::iterator it = v.begin();
|
for (clause* cls : v) {
|
||||||
clause_vector::iterator end = v.end();
|
|
||||||
for (; it != end; ++it) {
|
|
||||||
clause * cls = *it;
|
|
||||||
cache_generation(cls, new_scope_lvl);
|
cache_generation(cls, new_scope_lvl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2246,10 +2235,7 @@ namespace smt {
|
||||||
}
|
}
|
||||||
for (unsigned i = m_scope_lvl+1; i <= lim; i++) {
|
for (unsigned i = m_scope_lvl+1; i <= lim; i++) {
|
||||||
clause_vector & v = m_clauses_to_reinit[i];
|
clause_vector & v = m_clauses_to_reinit[i];
|
||||||
clause_vector::iterator it = v.begin();
|
for (clause* cls : v) {
|
||||||
clause_vector::iterator end = v.end();
|
|
||||||
for (; it != end; ++it) {
|
|
||||||
clause * cls = *it;
|
|
||||||
if (cls->deleted()) {
|
if (cls->deleted()) {
|
||||||
cls->release_atoms(m_manager);
|
cls->release_atoms(m_manager);
|
||||||
cls->m_reinit = false;
|
cls->m_reinit = false;
|
||||||
|
@ -2922,10 +2908,8 @@ namespace smt {
|
||||||
TRACE("flush", tout << "m_scope_lvl: " << m_scope_lvl << "\n";);
|
TRACE("flush", tout << "m_scope_lvl: " << m_scope_lvl << "\n";);
|
||||||
m_relevancy_propagator = 0;
|
m_relevancy_propagator = 0;
|
||||||
m_model_generator->reset();
|
m_model_generator->reset();
|
||||||
ptr_vector<theory>::iterator it = m_theory_set.begin();
|
for (theory* t : m_theory_set)
|
||||||
ptr_vector<theory>::iterator end = m_theory_set.end();
|
t->flush_eh();
|
||||||
for (; it != end; ++it)
|
|
||||||
(*it)->flush_eh();
|
|
||||||
undo_trail_stack(0);
|
undo_trail_stack(0);
|
||||||
m_qmanager = 0;
|
m_qmanager = 0;
|
||||||
del_clauses(m_aux_clauses, 0);
|
del_clauses(m_aux_clauses, 0);
|
||||||
|
@ -3183,10 +3167,8 @@ namespace smt {
|
||||||
}
|
}
|
||||||
|
|
||||||
void context::reset_assumptions() {
|
void context::reset_assumptions() {
|
||||||
literal_vector::iterator it = m_assumptions.begin();
|
for (literal lit : m_assumptions)
|
||||||
literal_vector::iterator end = m_assumptions.end();
|
get_bdata(lit.var()).m_assumption = false;
|
||||||
for (; it != end; ++it)
|
|
||||||
get_bdata(it->var()).m_assumption = false;
|
|
||||||
m_assumptions.reset();
|
m_assumptions.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1235,24 +1235,24 @@ namespace smt {
|
||||||
|
|
||||||
void display_asserted_formulas(std::ostream & out) const;
|
void display_asserted_formulas(std::ostream & out) const;
|
||||||
|
|
||||||
void display_literal(std::ostream & out, literal l) const;
|
std::ostream& display_literal(std::ostream & out, literal l) const;
|
||||||
|
|
||||||
void display_detailed_literal(std::ostream & out, literal l) const { l.display(out, m_manager, m_bool_var2expr.c_ptr()); }
|
void display_detailed_literal(std::ostream & out, literal l) const { l.display(out, m_manager, m_bool_var2expr.c_ptr()); }
|
||||||
|
|
||||||
void display_literal_info(std::ostream & out, literal l) const;
|
void display_literal_info(std::ostream & out, literal l) const;
|
||||||
|
|
||||||
void display_literals(std::ostream & out, unsigned num_lits, literal const * lits) const;
|
std::ostream& display_literals(std::ostream & out, unsigned num_lits, literal const * lits) const;
|
||||||
|
|
||||||
void display_literals(std::ostream & out, literal_vector const& lits) const {
|
std::ostream& display_literals(std::ostream & out, literal_vector const& lits) const {
|
||||||
display_literals(out, lits.size(), lits.c_ptr());
|
return display_literals(out, lits.size(), lits.c_ptr());
|
||||||
}
|
}
|
||||||
|
|
||||||
void display_literal_verbose(std::ostream & out, literal lit) const;
|
std::ostream& display_literal_verbose(std::ostream & out, literal lit) const;
|
||||||
|
|
||||||
void display_literals_verbose(std::ostream & out, unsigned num_lits, literal const * lits) const;
|
std::ostream& display_literals_verbose(std::ostream & out, unsigned num_lits, literal const * lits) const;
|
||||||
|
|
||||||
void display_literals_verbose(std::ostream & out, literal_vector const& lits) const {
|
std::ostream& display_literals_verbose(std::ostream & out, literal_vector const& lits) const {
|
||||||
display_literals_verbose(out, lits.size(), lits.c_ptr());
|
return display_literals_verbose(out, lits.size(), lits.c_ptr());
|
||||||
}
|
}
|
||||||
|
|
||||||
void display_watch_list(std::ostream & out, literal l) const;
|
void display_watch_list(std::ostream & out, literal l) const;
|
||||||
|
|
|
@ -71,11 +71,9 @@ namespace smt {
|
||||||
case NUM_CONFLICTS: r = "max-conflicts-reached"; break;
|
case NUM_CONFLICTS: r = "max-conflicts-reached"; break;
|
||||||
case THEORY: {
|
case THEORY: {
|
||||||
r = "(incomplete (theory";
|
r = "(incomplete (theory";
|
||||||
ptr_vector<theory>::const_iterator it = m_incomplete_theories.begin();
|
for (theory* t : m_incomplete_theories) {
|
||||||
ptr_vector<theory>::const_iterator end = m_incomplete_theories.end();
|
|
||||||
for (; it != end; ++it) {
|
|
||||||
r += " ";
|
r += " ";
|
||||||
r += (*it)->get_name();
|
r += t->get_name();
|
||||||
}
|
}
|
||||||
r += "))";
|
r += "))";
|
||||||
break;
|
break;
|
||||||
|
@ -91,20 +89,20 @@ namespace smt {
|
||||||
m_asserted_formulas.display_ll(out, get_pp_visited());
|
m_asserted_formulas.display_ll(out, get_pp_visited());
|
||||||
}
|
}
|
||||||
|
|
||||||
void context::display_literal(std::ostream & out, literal l) const {
|
std::ostream& context::display_literal(std::ostream & out, literal l) const {
|
||||||
l.display_compact(out, m_bool_var2expr.c_ptr());
|
l.display_compact(out, m_bool_var2expr.c_ptr()); return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
void context::display_literals(std::ostream & out, unsigned num_lits, literal const * lits) const {
|
std::ostream& context::display_literals(std::ostream & out, unsigned num_lits, literal const * lits) const {
|
||||||
display_compact(out, num_lits, lits, m_bool_var2expr.c_ptr());
|
display_compact(out, num_lits, lits, m_bool_var2expr.c_ptr()); return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
void context::display_literal_verbose(std::ostream & out, literal lit) const {
|
std::ostream& context::display_literal_verbose(std::ostream & out, literal lit) const {
|
||||||
display_literals_verbose(out, 1, &lit);
|
return display_literals_verbose(out, 1, &lit);
|
||||||
}
|
}
|
||||||
|
|
||||||
void context::display_literals_verbose(std::ostream & out, unsigned num_lits, literal const * lits) const {
|
std::ostream& context::display_literals_verbose(std::ostream & out, unsigned num_lits, literal const * lits) const {
|
||||||
display_verbose(out, m_manager, num_lits, lits, m_bool_var2expr.c_ptr(), "\n");
|
display_verbose(out, m_manager, num_lits, lits, m_bool_var2expr.c_ptr(), "\n"); return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
void context::display_literal_info(std::ostream & out, literal l) const {
|
void context::display_literal_info(std::ostream & out, literal l) const {
|
||||||
|
@ -136,10 +134,8 @@ namespace smt {
|
||||||
}
|
}
|
||||||
|
|
||||||
void context::display_enode_defs(std::ostream & out) const {
|
void context::display_enode_defs(std::ostream & out) const {
|
||||||
ptr_vector<enode>::const_iterator it = m_enodes.begin();
|
for (enode * x : m_enodes) {
|
||||||
ptr_vector<enode>::const_iterator end = m_enodes.end();
|
expr * n = x->get_owner();
|
||||||
for (; it != end; ++it) {
|
|
||||||
expr * n = (*it)->get_owner();
|
|
||||||
ast_def_ll_pp(out, m_manager, n, get_pp_visited(), true, false);
|
ast_def_ll_pp(out, m_manager, n, get_pp_visited(), true, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -169,10 +165,8 @@ namespace smt {
|
||||||
}
|
}
|
||||||
|
|
||||||
void context::display_clauses(std::ostream & out, ptr_vector<clause> const & v) const {
|
void context::display_clauses(std::ostream & out, ptr_vector<clause> const & v) const {
|
||||||
ptr_vector<clause>::const_iterator it = v.begin();
|
for (clause* cp : v) {
|
||||||
ptr_vector<clause>::const_iterator end = v.end();
|
display_clause(out, cp);
|
||||||
for (; it != end; ++it) {
|
|
||||||
display_clause(out, *it);
|
|
||||||
out << "\n";
|
out << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -207,12 +201,10 @@ namespace smt {
|
||||||
void context::display_assignment(std::ostream & out) const {
|
void context::display_assignment(std::ostream & out) const {
|
||||||
if (!m_assigned_literals.empty()) {
|
if (!m_assigned_literals.empty()) {
|
||||||
out << "current assignment:\n";
|
out << "current assignment:\n";
|
||||||
literal_vector::const_iterator it = m_assigned_literals.begin();
|
for (literal lit : m_assigned_literals) {
|
||||||
literal_vector::const_iterator end = m_assigned_literals.end();
|
display_literal(out, lit);
|
||||||
for (; it != end; ++it) {
|
|
||||||
display_literal(out, *it);
|
|
||||||
out << ": ";
|
out << ": ";
|
||||||
display_verbose(out, m_manager, 1, &*it, m_bool_var2expr.c_ptr());
|
display_verbose(out, m_manager, 1, &lit, m_bool_var2expr.c_ptr());
|
||||||
out << "\n";
|
out << "\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -223,11 +215,9 @@ namespace smt {
|
||||||
pp.set_benchmark_name("lemma");
|
pp.set_benchmark_name("lemma");
|
||||||
pp.set_status("unknown");
|
pp.set_status("unknown");
|
||||||
pp.set_logic(logic);
|
pp.set_logic(logic);
|
||||||
literal_vector::const_iterator it = m_assigned_literals.begin();
|
for (literal lit : m_assigned_literals) {
|
||||||
literal_vector::const_iterator end = m_assigned_literals.end();
|
|
||||||
for (; it != end; ++it) {
|
|
||||||
expr_ref n(m_manager);
|
expr_ref n(m_manager);
|
||||||
literal2expr(*it, n);
|
literal2expr(lit, n);
|
||||||
pp.add_assumption(n);
|
pp.add_assumption(n);
|
||||||
}
|
}
|
||||||
pp.display_smt2(out, m_manager.mk_true());
|
pp.display_smt2(out, m_manager.mk_true());
|
||||||
|
@ -235,11 +225,9 @@ namespace smt {
|
||||||
|
|
||||||
void context::display_eqc(std::ostream & out) const {
|
void context::display_eqc(std::ostream & out) const {
|
||||||
bool first = true;
|
bool first = true;
|
||||||
ptr_vector<enode>::const_iterator it = m_enodes.begin();
|
for (enode * x : m_enodes) {
|
||||||
ptr_vector<enode>::const_iterator end = m_enodes.end();
|
expr * n = x->get_owner();
|
||||||
for (; it != end; ++it) {
|
expr * r = x->get_root()->get_owner();
|
||||||
expr * n = (*it)->get_owner();
|
|
||||||
expr * r = (*it)->get_root()->get_owner();
|
|
||||||
if (n != r) {
|
if (n != r) {
|
||||||
if (first) {
|
if (first) {
|
||||||
out << "equivalence classes:\n";
|
out << "equivalence classes:\n";
|
||||||
|
@ -610,7 +598,7 @@ namespace smt {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case b_justification::JUSTIFICATION: {
|
case b_justification::JUSTIFICATION: {
|
||||||
out << "justification ";
|
out << "justification " << j.get_justification()->get_from_theory() << ": ";
|
||||||
literal_vector lits;
|
literal_vector lits;
|
||||||
const_cast<conflict_resolution&>(*m_conflict_resolution).justification2literals(j.get_justification(), lits);
|
const_cast<conflict_resolution&>(*m_conflict_resolution).justification2literals(j.get_justification(), lits);
|
||||||
display_literals(out, lits.size(), lits.c_ptr());
|
display_literals(out, lits.size(), lits.c_ptr());
|
||||||
|
|
|
@ -143,7 +143,6 @@ public:
|
||||||
}
|
}
|
||||||
out << ")\n";
|
out << ")\n";
|
||||||
m_base->display(out, num_assumptions, assumptions);
|
m_base->display(out, num_assumptions, assumptions);
|
||||||
bool first = true;
|
|
||||||
out << "(check-sat";
|
out << "(check-sat";
|
||||||
for (unsigned i = 0; i < num_assumptions; ++i) {
|
for (unsigned i = 0; i < num_assumptions; ++i) {
|
||||||
out << " " << mk_pp(assumptions[i], m);
|
out << " " << mk_pp(assumptions[i], m);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue