mirror of
https://github.com/Z3Prover/z3
synced 2025-08-26 04:56:03 +00:00
Centralize and document TRACE tags using X-macros (#7657)
* Introduce X-macro-based trace tag definition - Created trace_tags.def to centralize TRACE tag definitions - Each tag includes a symbolic name and description - Set up enum class TraceTag for type-safe usage in TRACE macros * Add script to generate Markdown documentation from trace_tags.def - Python script parses trace_tags.def and outputs trace_tags.md * Refactor TRACE_NEW to prepend TraceTag and pass enum to is_trace_enabled * trace: improve trace tag handling system with hierarchical tagging - Introduce hierarchical tag-class structure: enabling a tag class activates all child tags - Unify TRACE, STRACE, SCTRACE, and CTRACE under enum TraceTag - Implement initial version of trace_tag.def using X(tag, tag_class, description) (class names and descriptions to be refined in a future update) * trace: replace all string-based TRACE tags with enum TraceTag - Migrated all TRACE, STRACE, SCTRACE, and CTRACE macros to use enum TraceTag values instead of raw string literals * trace : add cstring header * trace : Add Markdown documentation generation from trace_tags.def via mk_api_doc.py * trace : rename macro parameter 'class' to 'tag_class' and remove Unicode comment in trace_tags.h. * trace : Add TODO comment for future implementation of tag_class activation * trace : Disable code related to tag_class until implementation is ready (#7663).
This commit is contained in:
parent
d766292dab
commit
0a93ff515d
583 changed files with 8698 additions and 7299 deletions
|
@ -104,7 +104,7 @@ namespace arith {
|
|||
if (a.is_zero(q)) {
|
||||
return;
|
||||
}
|
||||
TRACE("arith", tout << expr_ref(p, m) << " " << expr_ref(q, m) << "\n";);
|
||||
TRACE(arith, tout << expr_ref(p, m) << " " << expr_ref(q, m) << "\n";);
|
||||
// if q is zero, then idiv and mod are uninterpreted functions.
|
||||
expr_ref div(a.mk_idiv(p, q), m);
|
||||
expr_ref mod(a.mk_mod(p, q), m);
|
||||
|
@ -551,7 +551,7 @@ namespace arith {
|
|||
force_push();
|
||||
expr* e1 = var2expr(v1);
|
||||
expr* e2 = var2expr(v2);
|
||||
TRACE("arith", tout << "new eq: v" << v1 << " v" << v2 << "\n";);
|
||||
TRACE(arith, tout << "new eq: v" << v1 << " v" << v2 << "\n";);
|
||||
if (e1->get_id() > e2->get_id())
|
||||
std::swap(e1, e2);
|
||||
|
||||
|
@ -572,7 +572,7 @@ namespace arith {
|
|||
}
|
||||
|
||||
void solver::new_diseq_eh(euf::th_eq const& e) {
|
||||
TRACE("artih", tout << mk_bounded_pp(e.eq(), m) << "\n");
|
||||
TRACE(artih, tout << mk_bounded_pp(e.eq(), m) << "\n");
|
||||
ensure_column(e.v1());
|
||||
ensure_column(e.v2());
|
||||
m_delayed_eqs.push_back(std::make_pair(e, false));
|
||||
|
@ -637,7 +637,7 @@ namespace arith {
|
|||
add_def_constraint_and_equality(vi, lp::GE, rational::zero());
|
||||
add_def_constraint_and_equality(vi, lp::LT, abs(r));
|
||||
SASSERT(!is_infeasible());
|
||||
TRACE("arith", tout << term << "\n" << lp().constraints(););
|
||||
TRACE(arith, tout << term << "\n" << lp().constraints(););
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -676,14 +676,14 @@ namespace arith {
|
|||
|
||||
if (a.is_numeral(q, r2) && r2.is_pos()) {
|
||||
if (!a.is_bounded(n)) {
|
||||
TRACE("arith", tout << "unbounded " << expr_ref(n, m) << "\n";);
|
||||
TRACE(arith, tout << "unbounded " << expr_ref(n, m) << "\n";);
|
||||
continue;
|
||||
}
|
||||
theory_var v = internalize_def(n);
|
||||
lp::impq val_v = get_ivalue(v);
|
||||
if (val_v.y.is_zero() && val_v.x == div(r1.x, r2)) continue;
|
||||
|
||||
TRACE("arith", tout << get_value(v) << " != " << r1 << " div " << r2 << "\n";);
|
||||
TRACE(arith, tout << get_value(v) << " != " << r1 << " div " << r2 << "\n";);
|
||||
rational div_r = div(r1.x, r2);
|
||||
// p <= q * div(r1, q) + q - 1 => div(p, q) <= div(r1, r2)
|
||||
// p >= q * div(r1, q) => div(r1, q) <= div(p, q)
|
||||
|
@ -709,7 +709,7 @@ namespace arith {
|
|||
|
||||
all_divs_valid = false;
|
||||
|
||||
TRACE("arith", tout << r1 << " div " << r2 << "\n";);
|
||||
TRACE(arith, tout << r1 << " div " << r2 << "\n";);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -255,8 +255,8 @@ namespace arith {
|
|||
cancel_eh<reslimit> eh(m.limit());
|
||||
scoped_timer timer(1000, &eh);
|
||||
bool result = l_true != vs->check_sat();
|
||||
CTRACE("arith", !result, vs->display(tout));
|
||||
CTRACE("arith", !result, s().display(tout));
|
||||
CTRACE(arith, !result, vs->display(tout));
|
||||
CTRACE(arith, !result, s().display(tout));
|
||||
SASSERT(result);
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -81,13 +81,13 @@ namespace arith {
|
|||
|
||||
void solver::found_unsupported(expr* n) {
|
||||
ctx.push(value_trail<expr*>(m_not_handled));
|
||||
TRACE("arith", tout << "unsupported " << mk_pp(n, m) << "\n";);
|
||||
TRACE(arith, tout << "unsupported " << mk_pp(n, m) << "\n";);
|
||||
m_not_handled = n;
|
||||
}
|
||||
|
||||
void solver::found_underspecified(expr* n) {
|
||||
if (a.is_underspecified(n)) {
|
||||
TRACE("arith", tout << "Unhandled: " << mk_pp(n, m) << "\n";);
|
||||
TRACE(arith, tout << "Unhandled: " << mk_pp(n, m) << "\n";);
|
||||
ctx.push(push_back_vector(m_underspecified));
|
||||
m_underspecified.push_back(to_app(n));
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ namespace arith {
|
|||
var = lp().add_var(v, is_int);
|
||||
add_def_constraint_and_equality(var, lp::GE, rational(c));
|
||||
add_def_constraint_and_equality(var, lp::LE, rational(c));
|
||||
TRACE("arith", tout << "add " << cnst << ", var = " << var << "\n";);
|
||||
TRACE(arith, tout << "add " << cnst << ", var = " << var << "\n";);
|
||||
return var;
|
||||
}
|
||||
|
||||
|
@ -321,7 +321,7 @@ namespace arith {
|
|||
}
|
||||
|
||||
bool solver::internalize_atom(expr* atom) {
|
||||
TRACE("arith", tout << mk_pp(atom, m) << "\n";);
|
||||
TRACE(arith, tout << mk_pp(atom, m) << "\n";);
|
||||
expr* n1, *n2;
|
||||
rational r;
|
||||
lp_api::bound_kind k;
|
||||
|
@ -378,7 +378,7 @@ namespace arith {
|
|||
return true;
|
||||
}
|
||||
else {
|
||||
TRACE("arith", tout << "Could not internalize " << mk_pp(atom, m) << "\n";);
|
||||
TRACE(arith, tout << "Could not internalize " << mk_pp(atom, m) << "\n";);
|
||||
found_unsupported(atom);
|
||||
return true;
|
||||
}
|
||||
|
@ -394,7 +394,7 @@ namespace arith {
|
|||
updt_unassigned_bounds(v, +1);
|
||||
m_bounds_trail.push_back(v);
|
||||
m_bool_var2bound.insert(bv, b);
|
||||
TRACE("arith_verbose", tout << "Internalized " << lit << ": " << mk_pp(atom, m) << " " << *b << "\n";);
|
||||
TRACE(arith_verbose, tout << "Internalized " << lit << ": " << mk_pp(atom, m) << " " << *b << "\n";);
|
||||
m_new_bounds.push_back(b);
|
||||
//add_use_lists(b);
|
||||
return true;
|
||||
|
@ -407,7 +407,7 @@ namespace arith {
|
|||
}
|
||||
|
||||
theory_var solver::internalize_def(expr* term, scoped_internalize_state& st) {
|
||||
TRACE("arith", tout << expr_ref(term, m) << "\n";);
|
||||
TRACE(arith, tout << expr_ref(term, m) << "\n";);
|
||||
if (ctx.get_enode(term))
|
||||
return mk_evar(term);
|
||||
|
||||
|
@ -432,7 +432,7 @@ namespace arith {
|
|||
|
||||
void solver::internalize_args(app* t, bool force) {
|
||||
SASSERT(!m.is_bool(t));
|
||||
TRACE("arith", tout << mk_pp(t, m) << " " << force << " " << reflect(t) << "\n";);
|
||||
TRACE(arith, tout << mk_pp(t, m) << " " << force << " " << reflect(t) << "\n";);
|
||||
if (!force && !reflect(t))
|
||||
return;
|
||||
for (expr* arg : *t)
|
||||
|
@ -497,7 +497,7 @@ namespace arith {
|
|||
theory_var v = mk_evar(n);
|
||||
vars.push_back(register_theory_var_in_lar_solver(v));
|
||||
}
|
||||
TRACE("arith", tout << "v" << v << " := " << mk_pp(t, m) << "\n" << vars << "\n";);
|
||||
TRACE(arith, tout << "v" << v << " := " << mk_pp(t, m) << "\n" << vars << "\n";);
|
||||
m_solver->register_existing_terms();
|
||||
ensure_nla();
|
||||
m_nla->add_monic(register_theory_var_in_lar_solver(v), vars.size(), vars.data());
|
||||
|
@ -507,7 +507,7 @@ namespace arith {
|
|||
|
||||
theory_var solver::internalize_linearized_def(expr* term, scoped_internalize_state& st) {
|
||||
theory_var v = mk_evar(term);
|
||||
TRACE("arith", tout << mk_bounded_pp(term, m) << " v" << v << "\n";);
|
||||
TRACE(arith, tout << mk_bounded_pp(term, m) << " v" << v << "\n";);
|
||||
|
||||
if (is_unit_var(st) && v == st.vars()[0])
|
||||
return st.vars()[0];
|
||||
|
@ -524,7 +524,7 @@ namespace arith {
|
|||
else {
|
||||
vi = lp().add_term(m_left_side, v);
|
||||
SASSERT(lp().column_has_term(vi));
|
||||
TRACE("arith_verbose",
|
||||
TRACE(arith_verbose,
|
||||
tout << "v" << v << " := " << mk_pp(term, m)
|
||||
<< " slack: " << vi << " scopes: " << m_scopes.size() << "\n";
|
||||
lp().print_term(lp().get_term(vi), tout) << "\n";);
|
||||
|
@ -566,7 +566,7 @@ namespace arith {
|
|||
|
||||
|
||||
enode* solver::mk_enode(expr* e) {
|
||||
TRACE("arith", tout << expr_ref(e, m) << "\n";);
|
||||
TRACE(arith, tout << expr_ref(e, m) << "\n";);
|
||||
enode* n = ctx.get_enode(e);
|
||||
if (n)
|
||||
return n;
|
||||
|
@ -588,7 +588,7 @@ namespace arith {
|
|||
if (e->is_attached_to(get_id()))
|
||||
return e->get_th_var(get_id());
|
||||
theory_var v = mk_var(e);
|
||||
TRACE("arith_verbose", tout << "v" << v << " " << mk_pp(n, m) << "\n";);
|
||||
TRACE(arith_verbose, tout << "v" << v << " " << mk_pp(n, m) << "\n";);
|
||||
SASSERT(m_bounds.size() <= static_cast<unsigned>(v) || m_bounds[v].empty());
|
||||
reserve_bounds(v);
|
||||
ctx.attach_th_var(e, this, v);
|
||||
|
|
|
@ -92,7 +92,7 @@ namespace arith {
|
|||
while (m_asserted_qhead < m_asserted.size() && !s().inconsistent() && m.inc()) {
|
||||
literal lit = m_asserted[m_asserted_qhead];
|
||||
api_bound* b = nullptr;
|
||||
CTRACE("arith", !m_bool_var2bound.contains(lit.var()), tout << "not found " << lit << "\n";);
|
||||
CTRACE(arith, !m_bool_var2bound.contains(lit.var()), tout << "not found " << lit << "\n";);
|
||||
if (m_bool_var2bound.find(lit.var(), b))
|
||||
assert_bound(lit.sign() == b->get_lit().sign(), *b);
|
||||
++m_asserted_qhead;
|
||||
|
@ -150,7 +150,7 @@ namespace arith {
|
|||
bool v_is_int = b.is_int();
|
||||
literal lit2 = sat::null_literal;
|
||||
bool find_glb = (same_polarity == (k == lp_api::lower_t));
|
||||
TRACE("arith", tout << lit1 << " v" << v << " val " << val << " find_glb: " << find_glb << " is_true: " << is_true << " k: " << k << " is_lower: " << (k == lp_api::lower_t) << "\n";);
|
||||
TRACE(arith, tout << lit1 << " v" << v << " val " << val << " find_glb: " << find_glb << " is_true: " << is_true << " k: " << k << " is_lower: " << (k == lp_api::lower_t) << "\n";);
|
||||
if (find_glb) {
|
||||
rational glb;
|
||||
api_bound* lb = nullptr;
|
||||
|
@ -197,7 +197,7 @@ namespace arith {
|
|||
++m_stats.m_bound_propagations2;
|
||||
reset_evidence();
|
||||
m_core.push_back(lit1);
|
||||
TRACE("arith", tout << lit2 << " <- " << m_core << "\n";);
|
||||
TRACE(arith, tout << lit2 << " <- " << m_core << "\n";);
|
||||
arith_proof_hint* ph = nullptr;
|
||||
if (ctx.use_drat()) {
|
||||
m_arith_hint.set_type(ctx, hint_type::farkas_h);
|
||||
|
@ -239,7 +239,7 @@ namespace arith {
|
|||
if (m_unassigned_bounds[v] == 0 && !should_refine_bounds())
|
||||
return;
|
||||
|
||||
TRACE("arith", tout << "lp bound v" << v << " " << be.kind() << " " << be.m_bound << "\n";);
|
||||
TRACE(arith, tout << "lp bound v" << v << " " << be.kind() << " " << be.m_bound << "\n";);
|
||||
|
||||
lp_bounds const& bounds = m_bounds[v];
|
||||
bool first = true;
|
||||
|
@ -250,7 +250,7 @@ namespace arith {
|
|||
literal lit = is_bound_implied(be.kind(), be.m_bound, *b);
|
||||
if (lit == sat::null_literal)
|
||||
continue;
|
||||
TRACE("arith", tout << "lp bound " << lit << " bound: " << *b << " first: " << first << "\n";);
|
||||
TRACE(arith, tout << "lp bound " << lit << " bound: " << *b << " first: " << first << "\n";);
|
||||
|
||||
lp().settings().stats().m_num_of_implied_bounds++;
|
||||
if (first) {
|
||||
|
@ -259,9 +259,9 @@ namespace arith {
|
|||
m_explanation.clear();
|
||||
lp().explain_implied_bound(be, m_bp);
|
||||
}
|
||||
CTRACE("arith", m_unassigned_bounds[v] == 0, tout << "missed bound\n";);
|
||||
CTRACE(arith, m_unassigned_bounds[v] == 0, tout << "missed bound\n";);
|
||||
updt_unassigned_bounds(v, -1);
|
||||
TRACE("arith", for (auto lit : m_core) tout << lit << ": " << s().value(lit) << "\n";);
|
||||
TRACE(arith, for (auto lit : m_core) tout << lit << ": " << s().value(lit) << "\n";);
|
||||
DEBUG_CODE(for (auto lit : m_core) { VERIFY(s().value(lit) == l_true); });
|
||||
++m_stats.m_bound_propagations1;
|
||||
assign(lit, m_core, m_eqs, explain(hint_type::bound_h, lit));
|
||||
|
@ -273,27 +273,27 @@ namespace arith {
|
|||
|
||||
literal solver::is_bound_implied(lp::lconstraint_kind k, rational const& value, api_bound const& b) const {
|
||||
if ((k == lp::LE || k == lp::LT) && b.get_bound_kind() == lp_api::upper_t && value <= b.get_value()) {
|
||||
TRACE("arith", tout << "v <= value <= b.get_value() => v <= b.get_value() \n";);
|
||||
TRACE(arith, tout << "v <= value <= b.get_value() => v <= b.get_value() \n";);
|
||||
return b.get_lit();
|
||||
}
|
||||
if ((k == lp::GE || k == lp::GT) && b.get_bound_kind() == lp_api::lower_t && b.get_value() <= value) {
|
||||
TRACE("arith", tout << "b.get_value() <= value <= v => b.get_value() <= v \n";);
|
||||
TRACE(arith, tout << "b.get_value() <= value <= v => b.get_value() <= v \n";);
|
||||
return b.get_lit();
|
||||
}
|
||||
if (k == lp::LE && b.get_bound_kind() == lp_api::lower_t && value < b.get_value()) {
|
||||
TRACE("arith", tout << "v <= value < b.get_value() => v < b.get_value()\n";);
|
||||
TRACE(arith, tout << "v <= value < b.get_value() => v < b.get_value()\n";);
|
||||
return ~b.get_lit();
|
||||
}
|
||||
if (k == lp::LT && b.get_bound_kind() == lp_api::lower_t && value <= b.get_value()) {
|
||||
TRACE("arith", tout << "v < value <= b.get_value() => v < b.get_value()\n";);
|
||||
TRACE(arith, tout << "v < value <= b.get_value() => v < b.get_value()\n";);
|
||||
return ~b.get_lit();
|
||||
}
|
||||
if (k == lp::GE && b.get_bound_kind() == lp_api::upper_t && b.get_value() < value) {
|
||||
TRACE("arith", tout << "b.get_value() < value <= v => b.get_value() < v\n";);
|
||||
TRACE(arith, tout << "b.get_value() < value <= v => b.get_value() < v\n";);
|
||||
return ~b.get_lit();
|
||||
}
|
||||
if (k == lp::GT && b.get_bound_kind() == lp_api::upper_t && b.get_value() <= value) {
|
||||
TRACE("arith", tout << "b.get_value() <= value < v => b.get_value() < v\n";);
|
||||
TRACE(arith, tout << "b.get_value() <= value < v => b.get_value() < v\n";);
|
||||
return ~b.get_lit();
|
||||
}
|
||||
return sat::null_literal;
|
||||
|
@ -306,7 +306,7 @@ namespace arith {
|
|||
}
|
||||
|
||||
void solver::add_equality(lpvar j, rational const& k, lp::explanation const& exp) {
|
||||
TRACE("arith", tout << "equality " << j << " " << k << "\n");
|
||||
TRACE(arith, tout << "equality " << j << " " << k << "\n");
|
||||
theory_var v;
|
||||
if (k == 1)
|
||||
v = m_one_var;
|
||||
|
@ -407,7 +407,7 @@ namespace arith {
|
|||
void solver::assert_bound(bool is_true, api_bound& b) {
|
||||
lp::constraint_index ci = b.get_constraint(is_true);
|
||||
lp().activate(ci);
|
||||
TRACE("arith", tout << b << " " << is_infeasible() << "\n";);
|
||||
TRACE(arith, tout << b << " " << is_infeasible() << "\n";);
|
||||
if (is_infeasible())
|
||||
return;
|
||||
lp::lconstraint_kind k = bound2constraint_kind(b.is_int(), b.get_bound_kind(), is_true);
|
||||
|
@ -445,7 +445,7 @@ namespace arith {
|
|||
}
|
||||
constraint_bound& b = vec[tv];
|
||||
if (b.first == UINT_MAX || (is_lower ? b.second < v : b.second > v)) {
|
||||
TRACE("arith", tout << "tighter bound " << tv << "\n";);
|
||||
TRACE(arith, tout << "tighter bound " << tv << "\n";);
|
||||
m_history.push_back(vec[tv]);
|
||||
ctx.push(history_trail<constraint_bound>(vec, tv, m_history));
|
||||
b.first = ci;
|
||||
|
@ -468,7 +468,7 @@ namespace arith {
|
|||
}
|
||||
|
||||
void solver::flush_bound_axioms() {
|
||||
CTRACE("arith", !m_new_bounds.empty(), tout << "flush bound axioms\n";);
|
||||
CTRACE(arith, !m_new_bounds.empty(), tout << "flush bound axioms\n";);
|
||||
|
||||
while (!m_new_bounds.empty()) {
|
||||
lp_bounds atoms;
|
||||
|
@ -483,7 +483,7 @@ namespace arith {
|
|||
--i;
|
||||
}
|
||||
}
|
||||
CTRACE("arith_verbose", !atoms.empty(),
|
||||
CTRACE(arith_verbose, !atoms.empty(),
|
||||
for (unsigned i = 0; i < atoms.size(); ++i) {
|
||||
atoms[i]->display(tout); tout << "\n";
|
||||
});
|
||||
|
@ -611,7 +611,7 @@ namespace arith {
|
|||
if (!found_bad && value == get_phase(n->bool_var()))
|
||||
continue;
|
||||
|
||||
TRACE("arith", ctx.display_validation_failure(tout << *b << "\n", mdl, n));
|
||||
TRACE(arith, ctx.display_validation_failure(tout << *b << "\n", mdl, n));
|
||||
IF_VERBOSE(0, ctx.display_validation_failure(verbose_stream() << *b << "\n", mdl, n));
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
@ -633,7 +633,7 @@ namespace arith {
|
|||
}
|
||||
else if (v != euf::null_theory_var) {
|
||||
rational r = get_value(v);
|
||||
TRACE("arith", tout << mk_pp(o, m) << " v" << v << " := " << r << "\n";);
|
||||
TRACE(arith, tout << mk_pp(o, m) << " v" << v << " := " << r << "\n";);
|
||||
SASSERT("integer variables should have integer values: " && (ctx.get_config().m_arith_ignore_int || !a.is_int(o) || r.is_int() || m_not_handled != nullptr || m.limit().is_canceled()));
|
||||
if (a.is_int(o) && !r.is_int())
|
||||
r = floor(r);
|
||||
|
@ -687,7 +687,7 @@ namespace arith {
|
|||
}
|
||||
|
||||
void solver::push_core() {
|
||||
TRACE("arith_verbose", tout << "push\n";);
|
||||
TRACE(arith_verbose, tout << "push\n";);
|
||||
m_scopes.push_back(scope());
|
||||
scope& sc = m_scopes.back();
|
||||
sc.m_bounds_lim = m_bounds_trail.size();
|
||||
|
@ -700,7 +700,7 @@ namespace arith {
|
|||
}
|
||||
|
||||
void solver::pop_core(unsigned num_scopes) {
|
||||
TRACE("arith", tout << "pop " << num_scopes << "\n";);
|
||||
TRACE(arith, tout << "pop " << num_scopes << "\n";);
|
||||
unsigned old_size = m_scopes.size() - num_scopes;
|
||||
del_bounds(m_scopes[old_size].m_bounds_lim);
|
||||
m_asserted.shrink(m_scopes[old_size].m_asserted_lim);
|
||||
|
@ -710,7 +710,7 @@ namespace arith {
|
|||
m_new_bounds.reset();
|
||||
if (m_nla)
|
||||
m_nla->pop(num_scopes);
|
||||
TRACE("arith_verbose", tout << "num scopes: " << num_scopes << " new scope level: " << m_scopes.size() << "\n";);
|
||||
TRACE(arith_verbose, tout << "num scopes: " << num_scopes << " new scope level: " << m_scopes.size() << "\n";);
|
||||
th_euf_solver::pop_core(num_scopes);
|
||||
}
|
||||
|
||||
|
@ -731,7 +731,7 @@ namespace arith {
|
|||
u_dependency* ci1 = nullptr, *ci2 = nullptr, *ci3 = nullptr, *ci4 = nullptr;
|
||||
theory_var v1 = lp().local_to_external(vi1);
|
||||
theory_var v2 = lp().local_to_external(vi2);
|
||||
TRACE("arith", tout << "fixed: " << mk_pp(var2expr(v1), m) << " " << mk_pp(var2expr(v2), m) << "\n";);
|
||||
TRACE(arith, tout << "fixed: " << mk_pp(var2expr(v1), m) << " " << mk_pp(var2expr(v2), m) << "\n";);
|
||||
// we expect lp() to ensure that none of these returns happen.
|
||||
|
||||
if (is_equal(v1, v2))
|
||||
|
@ -773,7 +773,7 @@ namespace arith {
|
|||
if (lp().column_has_term(vi)) {
|
||||
theory_var v = lp().local_to_external(vi);
|
||||
rational val;
|
||||
TRACE("arith", tout << lp().get_variable_name(vi) << " " << v << "\n";);
|
||||
TRACE(arith, tout << lp().get_variable_name(vi) << " " << v << "\n";);
|
||||
if (v != euf::null_theory_var && a.is_numeral(var2expr(v), val) && bound == val) {
|
||||
dep = nullptr;
|
||||
return bound == val;
|
||||
|
@ -804,7 +804,7 @@ namespace arith {
|
|||
}
|
||||
|
||||
void solver::updt_unassigned_bounds(theory_var v, int inc) {
|
||||
TRACE("arith_verbose", tout << "v" << v << " " << m_unassigned_bounds[v] << " += " << inc << "\n";);
|
||||
TRACE(arith_verbose, tout << "v" << v << " " << m_unassigned_bounds[v] << " += " << inc << "\n";);
|
||||
ctx.push(vector_value_trail<unsigned, false>(m_unassigned_bounds, v));
|
||||
m_unassigned_bounds[v] += inc;
|
||||
}
|
||||
|
@ -831,7 +831,7 @@ namespace arith {
|
|||
|
||||
void solver::init_model() {
|
||||
if (m.inc() && m_solver.get() && get_num_vars() > 0) {
|
||||
TRACE("arith", display(tout << "update variable values\n"););
|
||||
TRACE(arith, display(tout << "update variable values\n"););
|
||||
ctx.push(value_trail<bool>(m_model_is_initialized));
|
||||
m_model_is_initialized = true;
|
||||
lp().init_model();
|
||||
|
@ -888,7 +888,7 @@ namespace arith {
|
|||
void solver::random_update() {
|
||||
if (m_nla)
|
||||
return;
|
||||
TRACE("arith", tout << s().scope_lvl() << "\n"; tout.flush(););
|
||||
TRACE(arith, tout << s().scope_lvl() << "\n"; tout.flush(););
|
||||
m_tmp_var_set.reset();
|
||||
m_model_eqs.reset();
|
||||
svector<lpvar> vars;
|
||||
|
@ -925,7 +925,7 @@ namespace arith {
|
|||
if (delayed_assume_eqs())
|
||||
return true;
|
||||
|
||||
TRACE("arith", display(tout););
|
||||
TRACE(arith, display(tout););
|
||||
random_update();
|
||||
m_model_eqs.reset();
|
||||
theory_var sz = static_cast<theory_var>(get_num_vars());
|
||||
|
@ -941,7 +941,7 @@ namespace arith {
|
|||
if (!is_registered_var(v))
|
||||
continue;
|
||||
theory_var other = m_model_eqs.insert_if_not_there(v);
|
||||
TRACE("arith", tout << "insert: v" << v << " := " << get_value(v) << " found: v" << other << "\n";);
|
||||
TRACE(arith, tout << "insert: v" << v << " := " << get_value(v) << " found: v" << other << "\n";);
|
||||
if (!is_equal(other, v))
|
||||
m_assume_eq_candidates.push_back({ v, other });
|
||||
}
|
||||
|
@ -964,7 +964,7 @@ namespace arith {
|
|||
enode* n1 = var2enode(v1);
|
||||
enode* n2 = var2enode(v2);
|
||||
m_assume_eq_head++;
|
||||
CTRACE("arith",
|
||||
CTRACE(arith,
|
||||
is_eq(v1, v2) && n1->get_root() != n2->get_root(),
|
||||
tout << "assuming eq: v" << v1 << " = v" << v2 << "\n";);
|
||||
if (!is_eq(v1, v2))
|
||||
|
@ -1013,7 +1013,7 @@ namespace arith {
|
|||
get_infeasibility_explanation_and_set_conflict();
|
||||
return sat::check_result::CR_CONTINUE;
|
||||
case l_undef:
|
||||
TRACE("arith", tout << "check feasible is undef\n";);
|
||||
TRACE(arith, tout << "check feasible is undef\n";);
|
||||
return sat::check_result::CR_CONTINUE;
|
||||
case l_true:
|
||||
break;
|
||||
|
@ -1025,7 +1025,7 @@ namespace arith {
|
|||
auto st = sat::check_result::CR_DONE;
|
||||
bool int_undef = false;
|
||||
|
||||
TRACE("arith", ctx.display(tout););
|
||||
TRACE(arith, ctx.display(tout););
|
||||
|
||||
switch (check_lia()) {
|
||||
case l_true:
|
||||
|
@ -1033,7 +1033,7 @@ namespace arith {
|
|||
case l_false:
|
||||
return sat::check_result::CR_CONTINUE;
|
||||
case l_undef:
|
||||
TRACE("arith", tout << "check-lia giveup\n";);
|
||||
TRACE(arith, tout << "check-lia giveup\n";);
|
||||
int_undef = true;
|
||||
st = sat::check_result::CR_CONTINUE;
|
||||
break;
|
||||
|
@ -1049,7 +1049,7 @@ namespace arith {
|
|||
case l_false:
|
||||
return sat::check_result::CR_CONTINUE;
|
||||
case l_undef:
|
||||
TRACE("arith", tout << "check-nra giveup\n";);
|
||||
TRACE(arith, tout << "check-nra giveup\n";);
|
||||
st = sat::check_result::CR_GIVEUP;
|
||||
break;
|
||||
}
|
||||
|
@ -1068,7 +1068,7 @@ namespace arith {
|
|||
if (ctx.get_config().m_arith_ignore_int && int_undef)
|
||||
return sat::check_result::CR_GIVEUP;
|
||||
if (m_not_handled != nullptr) {
|
||||
TRACE("arith", tout << "unhandled operator " << mk_pp(m_not_handled, m) << "\n";);
|
||||
TRACE(arith, tout << "unhandled operator " << mk_pp(m_not_handled, m) << "\n";);
|
||||
return sat::check_result::CR_GIVEUP;
|
||||
}
|
||||
return st;
|
||||
|
@ -1083,8 +1083,8 @@ namespace arith {
|
|||
}
|
||||
else {
|
||||
m_todo_terms.push_back(std::make_pair(t, rational::one()));
|
||||
TRACE("nl_value", tout << "v" << v << " " << t << "\n";);
|
||||
TRACE("nl_value", tout << "v" << v << " := w" << t << "\n";
|
||||
TRACE(nl_value, tout << "v" << v << " " << t << "\n";);
|
||||
TRACE(nl_value, tout << "v" << v << " := w" << t << "\n";
|
||||
lp().print_term(lp().get_term(t), tout) << "\n";);
|
||||
|
||||
m_nla->am().set(r, 0);
|
||||
|
@ -1093,7 +1093,7 @@ namespace arith {
|
|||
t = m_todo_terms.back().first;
|
||||
m_todo_terms.pop_back();
|
||||
lp::lar_term const& term = lp().get_term(t);
|
||||
TRACE("nl_value", lp().print_term(term, tout) << "\n";);
|
||||
TRACE(nl_value, lp().print_term(term, tout) << "\n";);
|
||||
scoped_anum r1(m_nla->am());
|
||||
rational c1(0);
|
||||
m_nla->am().set(r1, c1.to_mpq());
|
||||
|
@ -1116,10 +1116,10 @@ namespace arith {
|
|||
}
|
||||
|
||||
lbool solver::make_feasible() {
|
||||
TRACE("pcs", tout << lp().constraints(););
|
||||
TRACE(pcs, tout << lp().constraints(););
|
||||
auto status = lp().find_feasible_solution();
|
||||
TRACE("arith_verbose", display(tout););
|
||||
TRACE("arith", tout << status << "\n");
|
||||
TRACE(arith_verbose, display(tout););
|
||||
TRACE(arith, tout << status << "\n");
|
||||
switch (status) {
|
||||
case lp::lp_status::INFEASIBLE:
|
||||
return l_false;
|
||||
|
@ -1130,7 +1130,7 @@ namespace arith {
|
|||
return l_true;
|
||||
case lp::lp_status::TIME_EXHAUSTED:
|
||||
default:
|
||||
TRACE("arith", tout << "status treated as inconclusive: " << status << "\n";);
|
||||
TRACE(arith, tout << "status treated as inconclusive: " << status << "\n";);
|
||||
return l_undef;
|
||||
}
|
||||
}
|
||||
|
@ -1147,7 +1147,7 @@ namespace arith {
|
|||
new_eq_eh(e);
|
||||
else if (is_eq(e.v1(), e.v2())) {
|
||||
mk_diseq_axiom(e.v1(), e.v2());
|
||||
TRACE("arith", tout << mk_bounded_pp(e.eq(), m) << " " << use_nra_model() << "\n");
|
||||
TRACE(arith, tout << mk_bounded_pp(e.eq(), m) << " " << use_nra_model() << "\n");
|
||||
found_diseq = true;
|
||||
break;
|
||||
}
|
||||
|
@ -1156,7 +1156,7 @@ namespace arith {
|
|||
}
|
||||
|
||||
lbool solver::check_lia() {
|
||||
TRACE("arith", );
|
||||
TRACE(arith, );
|
||||
if (!m.inc())
|
||||
return l_undef;
|
||||
lbool lia_check = l_undef;
|
||||
|
@ -1173,7 +1173,7 @@ namespace arith {
|
|||
break;
|
||||
|
||||
case lp::lia_move::branch: {
|
||||
TRACE("arith", tout << "branch\n";);
|
||||
TRACE(arith, tout << "branch\n";);
|
||||
app_ref b(m);
|
||||
bool u = m_lia->is_upper();
|
||||
auto const& k = m_lia->offset();
|
||||
|
@ -1191,7 +1191,7 @@ namespace arith {
|
|||
break;
|
||||
}
|
||||
case lp::lia_move::cut: {
|
||||
TRACE("arith", tout << "cut\n";);
|
||||
TRACE(arith, tout << "cut\n";);
|
||||
++m_stats.m_cuts;
|
||||
// m_explanation implies term <= k
|
||||
reset_evidence();
|
||||
|
@ -1207,16 +1207,16 @@ namespace arith {
|
|||
break;
|
||||
}
|
||||
case lp::lia_move::conflict:
|
||||
TRACE("arith", tout << "conflict\n";);
|
||||
TRACE(arith, tout << "conflict\n";);
|
||||
// ex contains unsat core
|
||||
set_conflict(hint_type::cut_h);
|
||||
return l_false;
|
||||
case lp::lia_move::undef:
|
||||
TRACE("arith", tout << "lia undef\n";);
|
||||
TRACE(arith, tout << "lia undef\n";);
|
||||
lia_check = l_undef;
|
||||
break;
|
||||
case lp::lia_move::continue_with_check:
|
||||
TRACE("arith", tout << "continue-with-check\n");
|
||||
TRACE(arith, tout << "continue-with-check\n");
|
||||
lia_check = l_false;
|
||||
break;
|
||||
default:
|
||||
|
@ -1256,7 +1256,7 @@ namespace arith {
|
|||
for (auto ev : m_explanation)
|
||||
set_evidence(ev.ci());
|
||||
|
||||
TRACE("arith_conflict",
|
||||
TRACE(arith_conflict,
|
||||
tout << "Lemma - " << (is_conflict ? "conflict" : "propagation") << "\n";
|
||||
for (literal c : m_core) tout << c << ": " << literal2expr(c) << " := " << s().value(c) << "\n";
|
||||
for (auto p : m_eqs) tout << ctx.bpp(p.first) << " == " << ctx.bpp(p.second) << "\n";);
|
||||
|
@ -1367,11 +1367,11 @@ namespace arith {
|
|||
rational g = gcd_reduce(coeffs);
|
||||
if (!g.is_one()) {
|
||||
if (lower_bound) {
|
||||
TRACE("arith", tout << "lower: " << offset << " / " << g << " = " << offset / g << " >= " << ceil(offset / g) << "\n";);
|
||||
TRACE(arith, tout << "lower: " << offset << " / " << g << " = " << offset / g << " >= " << ceil(offset / g) << "\n";);
|
||||
offset = ceil(offset / g);
|
||||
}
|
||||
else {
|
||||
TRACE("arith", tout << "upper: " << offset << " / " << g << " = " << offset / g << " <= " << floor(offset / g) << "\n";);
|
||||
TRACE(arith, tout << "upper: " << offset << " / " << g << " = " << offset / g << " <= " << floor(offset / g) << "\n";);
|
||||
offset = floor(offset / g);
|
||||
}
|
||||
}
|
||||
|
@ -1382,7 +1382,7 @@ namespace arith {
|
|||
for (auto& kv : coeffs) kv.m_value.neg();
|
||||
}
|
||||
|
||||
// CTRACE("arith", is_int,
|
||||
// CTRACE(arith, is_int,
|
||||
// lp().print_term(term, tout << "term: ") << "\n";
|
||||
// tout << "offset: " << offset << " gcd: " << g << "\n";);
|
||||
|
||||
|
@ -1393,7 +1393,7 @@ namespace arith {
|
|||
else
|
||||
atom = a.mk_le(t, a.mk_numeral(offset, is_int));
|
||||
|
||||
TRACE("arith", tout << t << ": " << atom << "\n";
|
||||
TRACE(arith, tout << t << ": " << atom << "\n";
|
||||
lp().print_term(term, tout << "bound atom: ") << (lower_bound ? " >= " : " <= ") << k << "\n";);
|
||||
mk_literal(atom);
|
||||
return atom;
|
||||
|
@ -1404,7 +1404,7 @@ namespace arith {
|
|||
}
|
||||
|
||||
void solver::term2coeffs(lp::lar_term const& term, u_map<rational>& coeffs, rational const& coeff) {
|
||||
TRACE("arith", lp().print_term(term, tout) << "\n";);
|
||||
TRACE(arith, lp().print_term(term, tout) << "\n";);
|
||||
for (lp::lar_term::ival ti : term) {
|
||||
theory_var w;
|
||||
auto tv = ti.j();
|
||||
|
@ -1417,7 +1417,7 @@ namespace arith {
|
|||
else {
|
||||
w = lp().local_to_external(tv);
|
||||
SASSERT(w >= 0);
|
||||
TRACE("arith", tout << tv << ": " << w << "\n";);
|
||||
TRACE(arith, tout << tv << ": " << w << "\n";);
|
||||
}
|
||||
rational c0(0);
|
||||
coeffs.find(w, c0);
|
||||
|
@ -1493,17 +1493,17 @@ namespace arith {
|
|||
else
|
||||
lit = ctx.expr2literal(mk_bound(ineq.term(), ineq.rs(), is_lower));
|
||||
|
||||
TRACE("arith", tout << "is_lower: " << is_lower << " sign " << sign << " " << ctx.literal2expr(lit) << "\n";);
|
||||
TRACE(arith, tout << "is_lower: " << is_lower << " sign " << sign << " " << ctx.literal2expr(lit) << "\n";);
|
||||
return sign ? ~lit : lit;
|
||||
}
|
||||
|
||||
|
||||
lbool solver::check_nla() {
|
||||
if (!m.inc()) {
|
||||
TRACE("arith", tout << "canceled\n";);
|
||||
TRACE(arith, tout << "canceled\n";);
|
||||
return l_undef;
|
||||
}
|
||||
CTRACE("arith", !m_nla, tout << "no nla\n";);
|
||||
CTRACE(arith, !m_nla, tout << "no nla\n";);
|
||||
if (!m_nla)
|
||||
return l_true;
|
||||
if (!m_nla->need_check())
|
||||
|
@ -1519,7 +1519,7 @@ namespace arith {
|
|||
case l_undef:
|
||||
break;
|
||||
}
|
||||
TRACE("arith", tout << "nla " << r << "\n");
|
||||
TRACE(arith, tout << "nla " << r << "\n");
|
||||
return r;
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ namespace arith {
|
|||
lo = lo1, is_strict = is_strict1;
|
||||
found = true;
|
||||
}
|
||||
CTRACE("arith_value", !found, tout << "value not found for " << mk_pp(e, m) << "\n";);
|
||||
CTRACE(arith_value, !found, tout << "value not found for " << mk_pp(e, m) << "\n";);
|
||||
return found;
|
||||
}
|
||||
|
||||
|
@ -74,7 +74,7 @@ namespace arith {
|
|||
hi = hi1, is_strict = is_strict1;
|
||||
found = true;
|
||||
}
|
||||
CTRACE("arith_value", !found, tout << "value not found for " << mk_pp(e, m) << "\n";);
|
||||
CTRACE(arith_value, !found, tout << "value not found for " << mk_pp(e, m) << "\n";);
|
||||
return found;
|
||||
}
|
||||
|
||||
|
@ -109,7 +109,7 @@ namespace arith {
|
|||
if (m_thr && m_thr->get_value(next, val)) return true;
|
||||
next = next->get_next();
|
||||
} while (next != n);
|
||||
TRACE("arith_value", tout << "value not found for " << mk_pp(e, m_ctx->get_manager()) << "\n";);
|
||||
TRACE(arith_value, tout << "value not found for " << mk_pp(e, m_ctx->get_manager()) << "\n";);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace array {
|
|||
void solver::push_axiom(axiom_record const& r) {
|
||||
unsigned idx = m_axiom_trail.size();
|
||||
m_axiom_trail.push_back(r);
|
||||
TRACE("array", display(tout, r) << " " << m_axioms.contains(idx) << "\n";);
|
||||
TRACE(array, display(tout, r) << " " << m_axioms.contains(idx) << "\n";);
|
||||
if (m_axioms.contains(idx))
|
||||
m_axiom_trail.pop_back();
|
||||
else {
|
||||
|
@ -79,7 +79,7 @@ namespace array {
|
|||
expr* child = r.n->get_expr();
|
||||
SASSERT(can_beta_reduce(r.n));
|
||||
|
||||
TRACE("array", tout << "default-axiom: " << mk_bounded_pp(child, m, 2) << "\n";);
|
||||
TRACE(array, tout << "default-axiom: " << mk_bounded_pp(child, m, 2) << "\n";);
|
||||
if (a.is_const(child))
|
||||
return assert_default_const_axiom(to_app(child));
|
||||
else if (a.is_store(child))
|
||||
|
@ -101,7 +101,7 @@ namespace array {
|
|||
r.select->get_arg(0)->get_root() != r.n->get_root() &&
|
||||
!r.is_delayed() && m_enable_delay;
|
||||
|
||||
TRACE("array", display(tout << "select-axiom: " << (should_delay ? "delay " : ""), r) << "\n";);
|
||||
TRACE(array, display(tout << "select-axiom: " << (should_delay ? "delay " : ""), r) << "\n";);
|
||||
|
||||
if (should_delay) {
|
||||
IF_VERBOSE(11, verbose_stream() << "delay: " << mk_bounded_pp(child, m) << " " << mk_bounded_pp(select, m) << "\n");
|
||||
|
@ -131,7 +131,7 @@ namespace array {
|
|||
* n := store(a, i, v)
|
||||
*/
|
||||
bool solver::assert_store_axiom(app* e) {
|
||||
TRACE("array", tout << "store-axiom: " << mk_bounded_pp(e, m) << "\n";);
|
||||
TRACE(array, tout << "store-axiom: " << mk_bounded_pp(e, m) << "\n";);
|
||||
++m_stats.m_num_store_axiom;
|
||||
SASSERT(a.is_store(e));
|
||||
unsigned num_args = e->get_num_args();
|
||||
|
@ -182,7 +182,7 @@ namespace array {
|
|||
|
||||
euf::enode* s1 = e_internalize(sel1);
|
||||
euf::enode* s2 = e_internalize(sel2);
|
||||
TRACE("array",
|
||||
TRACE(array,
|
||||
tout << "select-store " << ctx.bpp(s1) << " " << ctx.bpp(s1->get_root()) << "\n";
|
||||
tout << "select-store " << ctx.bpp(s2) << " " << ctx.bpp(s2->get_root()) << "\n";);
|
||||
|
||||
|
@ -228,7 +228,7 @@ namespace array {
|
|||
new_prop = true;
|
||||
}
|
||||
++m_stats.m_num_select_store_axiom;
|
||||
TRACE("array", tout << "select-stored " << new_prop << "\n";);
|
||||
TRACE(array, tout << "select-stored " << new_prop << "\n";);
|
||||
return new_prop;
|
||||
}
|
||||
|
||||
|
@ -270,7 +270,7 @@ namespace array {
|
|||
expr_ref sel2(a.mk_select(args2), m);
|
||||
literal lit1 = eq_internalize(e1, e2);
|
||||
literal lit2 = eq_internalize(sel1, sel2);
|
||||
TRACE("array", tout << "extensionality-axiom: " << mk_bounded_pp(e1, m) << " == " << mk_bounded_pp(e2, m) << "\n" << lit1 << " " << ~lit2 << "\n";);
|
||||
TRACE(array, tout << "extensionality-axiom: " << mk_bounded_pp(e1, m) << " == " << mk_bounded_pp(e2, m) << "\n" << lit1 << " " << ~lit2 << "\n";);
|
||||
return add_clause(lit1, ~lit2);
|
||||
}
|
||||
|
||||
|
@ -465,7 +465,7 @@ namespace array {
|
|||
expr_ref alpha(a.mk_select(args), m);
|
||||
expr_ref beta(alpha);
|
||||
rewrite(beta);
|
||||
TRACE("array", tout << alpha << " == " << beta << "\n";);
|
||||
TRACE(array, tout << alpha << " == " << beta << "\n";);
|
||||
return ctx.propagate(e_internalize(alpha), e_internalize(beta), array_axiom());
|
||||
}
|
||||
|
||||
|
@ -473,7 +473,7 @@ namespace array {
|
|||
\brief assert n1 = n2 => forall vars . (n1 vars) = (n2 vars)
|
||||
*/
|
||||
bool solver::assert_congruent_axiom(expr* e1, expr* e2) {
|
||||
TRACE("array", tout << "congruence-axiom: " << mk_bounded_pp(e1, m) << " " << mk_bounded_pp(e2, m) << "\n";);
|
||||
TRACE(array, tout << "congruence-axiom: " << mk_bounded_pp(e1, m) << " " << mk_bounded_pp(e2, m) << "\n";);
|
||||
++m_stats.m_num_congruence_axiom;
|
||||
sort* srt = e1->get_sort();
|
||||
unsigned dimension = get_array_arity(srt);
|
||||
|
@ -638,20 +638,20 @@ namespace array {
|
|||
euf::enode * n = var2enode(i);
|
||||
if (!is_array(n))
|
||||
continue;
|
||||
CTRACE("array", !ctx.is_relevant(n), tout << "not relevant: " << ctx.bpp(n) << "\n");
|
||||
CTRACE(array, !ctx.is_relevant(n), tout << "not relevant: " << ctx.bpp(n) << "\n");
|
||||
if (!ctx.is_relevant(n))
|
||||
continue;
|
||||
euf::enode * r = n->get_root();
|
||||
if (r->is_marked1())
|
||||
continue;
|
||||
// arrays used as indices in other arrays have to be treated as shared issue #3532, #3529
|
||||
CTRACE("array", !ctx.is_shared(r) && !is_shared_arg(r), tout << "not shared: " << ctx.bpp(r) << "\n");
|
||||
CTRACE(array, !ctx.is_shared(r) && !is_shared_arg(r), tout << "not shared: " << ctx.bpp(r) << "\n");
|
||||
if (ctx.is_shared(r) || is_shared_arg(r))
|
||||
roots.push_back(r->get_th_var(get_id()));
|
||||
r->mark1();
|
||||
to_unmark.push_back(r);
|
||||
}
|
||||
TRACE("array", tout << "collecting shared vars...\n"; for (auto v : roots) tout << ctx.bpp(var2enode(v)) << "\n";);
|
||||
TRACE(array, tout << "collecting shared vars...\n"; for (auto v : roots) tout << ctx.bpp(var2enode(v)) << "\n";);
|
||||
for (auto* n : to_unmark)
|
||||
n->unmark1();
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace array {
|
|||
sat::literal solver::internalize(expr* e, bool sign, bool root) {
|
||||
SASSERT(m.is_bool(e));
|
||||
if (!visit_rec(m, e, sign, root)) {
|
||||
TRACE("array", tout << mk_pp(e, m) << "\n";);
|
||||
TRACE(array, tout << mk_pp(e, m) << "\n";);
|
||||
return sat::null_literal;
|
||||
}
|
||||
auto lit = expr2literal(e);
|
||||
|
|
|
@ -129,7 +129,7 @@ namespace array {
|
|||
args.reset();
|
||||
for (unsigned i = 1; i < p->num_args(); ++i) {
|
||||
if (!values.get(p->get_arg(i)->get_root_id())) {
|
||||
TRACE("array", tout << ctx.bpp(p->get_arg(i)) << "\n");
|
||||
TRACE(array, tout << ctx.bpp(p->get_arg(i)) << "\n");
|
||||
}
|
||||
SASSERT(values.get(p->get_arg(i)->get_root_id()));
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ namespace array {
|
|||
fi->insert_entry(args.data(), value);
|
||||
}
|
||||
|
||||
TRACE("array", tout << "array-as-function " << ctx.bpp(n) << " := " << mk_pp(f, m) << "\n" << "default " << mk_pp(fi->get_else(), m) << "\n";);
|
||||
TRACE(array, tout << "array-as-function " << ctx.bpp(n) << " := " << mk_pp(f, m) << "\n" << "default " << mk_pp(fi->get_else(), m) << "\n";);
|
||||
parameter p(f);
|
||||
values.set(n->get_expr_id(), m.mk_app(get_id(), OP_AS_ARRAY, 1, &p));
|
||||
}
|
||||
|
@ -282,7 +282,7 @@ namespace array {
|
|||
theory_var w = get_th_var(n->get_arg(0));
|
||||
SASSERT(w != euf::null_theory_var);
|
||||
mg_merge(v, get_representative(w));
|
||||
TRACE("array", tout << "merge: " << ctx.bpp(n) << " " << v << " " << w << "\n";);
|
||||
TRACE(array, tout << "merge: " << ctx.bpp(n) << " " << v << " " << w << "\n";);
|
||||
}
|
||||
else if (a.is_default(e)) {
|
||||
theory_var w = get_th_var(n->get_arg(0));
|
||||
|
@ -294,7 +294,7 @@ namespace array {
|
|||
|
||||
void solver::set_default(theory_var v, euf::enode* n) {
|
||||
v = mg_find(v);
|
||||
CTRACE("array", !m_defaults[v], tout << "set default: " << v << " " << ctx.bpp(n) << "\n";);
|
||||
CTRACE(array, !m_defaults[v], tout << "set default: " << v << " " << ctx.bpp(n) << "\n";);
|
||||
if (!m_defaults[v])
|
||||
m_defaults[v] = n;
|
||||
}
|
||||
|
@ -343,7 +343,7 @@ namespace array {
|
|||
if (!m_defaults[u])
|
||||
m_defaults[u] = m_defaults[v];
|
||||
|
||||
CTRACE("array", m_defaults[v],
|
||||
CTRACE(array, m_defaults[v],
|
||||
tout << ctx.bpp(m_defaults[v]->get_root()) << "\n";
|
||||
tout << ctx.bpp(m_defaults[u]->get_root()) << "\n";
|
||||
);
|
||||
|
|
|
@ -150,7 +150,7 @@ namespace array {
|
|||
void solver::merge_eh(theory_var v1, theory_var v2, theory_var, theory_var) {
|
||||
euf::enode* n1 = var2enode(v1);
|
||||
euf::enode* n2 = var2enode(v2);
|
||||
TRACE("array", tout << "merge: " << ctx.bpp(n1) << " == " << ctx.bpp(n2) << "\n";);
|
||||
TRACE(array, tout << "merge: " << ctx.bpp(n1) << " == " << ctx.bpp(n2) << "\n";);
|
||||
SASSERT(n1->get_root() == n2->get_root());
|
||||
SASSERT(v1 == find(v1));
|
||||
expr* e1 = n1->get_expr();
|
||||
|
@ -179,8 +179,8 @@ namespace array {
|
|||
v_child = find(v_child);
|
||||
ctx.push_vec(get_var_data(v_child).m_parent_selects, select);
|
||||
euf::enode* child = var2enode(v_child);
|
||||
TRACE("array", tout << "v" << v_child << " - " << ctx.bpp(select) << " " << ctx.bpp(child) << " prop: " << should_prop_upward(get_var_data(v_child)) << "\n";);
|
||||
TRACE("array", tout << "can beta reduce " << can_beta_reduce(child) << "\n";);
|
||||
TRACE(array, tout << "v" << v_child << " - " << ctx.bpp(select) << " " << ctx.bpp(child) << " prop: " << should_prop_upward(get_var_data(v_child)) << "\n";);
|
||||
TRACE(array, tout << "can beta reduce " << can_beta_reduce(child) << "\n";);
|
||||
if (can_beta_reduce(child))
|
||||
push_axiom(select_axiom(select, child));
|
||||
propagate_parent_select_axioms(v_child);
|
||||
|
|
|
@ -132,7 +132,7 @@ namespace bv {
|
|||
if (r1 == r2)
|
||||
return true;
|
||||
|
||||
TRACE("bv", tout << mk_bounded_pp(e, m) << " evaluates to " << r1 << " arguments: " << args << "\n";);
|
||||
TRACE(bv, tout << mk_bounded_pp(e, m) << " evaluates to " << r1 << " arguments: " << args << "\n";);
|
||||
// check x*0 = 0
|
||||
if (!check_mul_zero(e, args, r1, r2))
|
||||
return false;
|
||||
|
@ -207,7 +207,7 @@ namespace bv {
|
|||
};
|
||||
auto add_inv = [&](expr* s) {
|
||||
inv = invert(s, n);
|
||||
TRACE("bv", tout << "enforce " << inv << "\n";);
|
||||
TRACE(bv, tout << "enforce " << inv << "\n";);
|
||||
add_unit(eq_internalize(inv, n));
|
||||
};
|
||||
bool ok = true;
|
||||
|
@ -280,14 +280,14 @@ namespace bv {
|
|||
expr_ref mul1(m.mk_app(n->get_decl(), arg_values[0], n->get_arg(1)), m);
|
||||
set_delay_internalize(mul1, internalize_mode::init_bits_only_i);
|
||||
add_unit(eq_internalize(mul1, n->get_arg(1)));
|
||||
TRACE("bv", tout << mul1 << "\n";);
|
||||
TRACE(bv, tout << mul1 << "\n";);
|
||||
return false;
|
||||
}
|
||||
if (bv.is_one(arg_values[1])) {
|
||||
expr_ref mul1(m.mk_app(n->get_decl(), n->get_arg(0), arg_values[1]), m);
|
||||
set_delay_internalize(mul1, internalize_mode::init_bits_only_i);
|
||||
add_unit(eq_internalize(mul1, n->get_arg(0)));
|
||||
TRACE("bv", tout << mul1 << "\n";);
|
||||
TRACE(bv, tout << mul1 << "\n";);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -90,7 +90,7 @@ namespace bv {
|
|||
m_wpos.push_back(0);
|
||||
m_zero_one_bits.push_back(zero_one_bits());
|
||||
ctx.attach_th_var(n, this, r);
|
||||
TRACE("bv", tout << "mk-var: v" << r << " " << n->get_expr_id() << " " << mk_bounded_pp(n->get_expr(), m) << "\n";);
|
||||
TRACE(bv, tout << "mk-var: v" << r << " " << n->get_expr_id() << " " << mk_bounded_pp(n->get_expr(), m) << "\n";);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
@ -240,7 +240,7 @@ namespace bv {
|
|||
}
|
||||
|
||||
void solver::mk_bits(theory_var v) {
|
||||
TRACE("bv", tout << "v" << v << "@" << s().scope_lvl() << "\n";);
|
||||
TRACE(bv, tout << "v" << v << "@" << s().scope_lvl() << "\n";);
|
||||
expr* e = var2expr(v);
|
||||
unsigned bv_size = get_bv_size(v);
|
||||
m_bits[v].reset();
|
||||
|
@ -248,7 +248,7 @@ namespace bv {
|
|||
expr_ref b2b(bv.mk_bit2bool(e, i), m);
|
||||
m_bits[v].push_back(sat::null_literal);
|
||||
sat::literal lit = ctx.internalize(b2b, false, false);
|
||||
TRACE("bv", tout << "add-bit: " << lit << " " << literal2expr(lit) << "\n";);
|
||||
TRACE(bv, tout << "add-bit: " << lit << " " << literal2expr(lit) << "\n";);
|
||||
if (m_bits[v].back() == sat::null_literal)
|
||||
m_bits[v].back() = lit;
|
||||
SASSERT(m_bits[v].back() == lit);
|
||||
|
@ -293,7 +293,7 @@ namespace bv {
|
|||
SASSERT(l == mk_true() || ~l == mk_true());
|
||||
bool is_true = l == mk_true();
|
||||
zero_one_bits& bits = m_zero_one_bits[v];
|
||||
TRACE("bv", tout << "register v" << v << " " << l << " " << mk_true() << "\n";);
|
||||
TRACE(bv, tout << "register v" << v << " " << l << " " << mk_true() << "\n";);
|
||||
bits.push_back(zero_one_bit(v, idx, is_true));
|
||||
}
|
||||
|
||||
|
@ -303,7 +303,7 @@ namespace bv {
|
|||
void solver::add_bit(theory_var v, literal l) {
|
||||
unsigned idx = m_bits[v].size();
|
||||
m_bits[v].push_back(l);
|
||||
TRACE("bv", tout << "add-bit: v" << v << "[" << idx << "] " << l << " " << literal2expr(l) << "@" << s().scope_lvl() << "\n";);
|
||||
TRACE(bv, tout << "add-bit: v" << v << "[" << idx << "] " << l << " " << literal2expr(l) << "@" << s().scope_lvl() << "\n";);
|
||||
SASSERT(m_num_scopes == 0);
|
||||
s().set_external(l.var());
|
||||
euf::enode* n = bool_var2enode(l.var());
|
||||
|
@ -346,7 +346,7 @@ namespace bv {
|
|||
unsigned i = 0;
|
||||
for (expr* bit : bits) {
|
||||
sat::literal lit = ctx.internalize(bit, false, false);
|
||||
TRACE("bv", tout << "set " << m_bits[v][i] << " == " << lit << "\n";);
|
||||
TRACE(bv, tout << "set " << m_bits[v][i] << " == " << lit << "\n";);
|
||||
add_clause(~lit, m_bits[v][i]);
|
||||
add_clause(lit, ~m_bits[v][i]);
|
||||
++i;
|
||||
|
@ -589,7 +589,7 @@ namespace bv {
|
|||
bits.swap(new_bits);
|
||||
}
|
||||
init_bits(e, bits);
|
||||
TRACE("bv_verbose", tout << arg_bits << " " << bits << " " << new_bits << "\n";);
|
||||
TRACE(bv_verbose, tout << arg_bits << " " << bits << " " << new_bits << "\n";);
|
||||
}
|
||||
|
||||
void solver::internalize_novfl(app* n, std::function<void(unsigned, expr* const*, expr* const*, expr_ref&)>& fn) {
|
||||
|
@ -675,7 +675,7 @@ namespace bv {
|
|||
sat::literal lit0 = m_bits[v_arg][idx];
|
||||
if (lit0 == sat::null_literal) {
|
||||
m_bits[v_arg][idx] = lit;
|
||||
TRACE("bv", tout << "add-bit: " << lit << " " << literal2expr(lit) << "\n";);
|
||||
TRACE(bv, tout << "add-bit: " << lit << " " << literal2expr(lit) << "\n";);
|
||||
atom* a = new (get_region()) atom(lit.var());
|
||||
a->m_occs = new (get_region()) var_pos_occ(v_arg, idx);
|
||||
insert_bv2a(lit.var(), a);
|
||||
|
@ -760,7 +760,7 @@ namespace bv {
|
|||
expr_ref oe = mk_var_eq(v1, v2);
|
||||
literal oeq = ctx.internalize(oe, false, false);
|
||||
unsigned sz = m_bits[v1].size();
|
||||
TRACE("bv", tout << "ackerman-eq: " << s().scope_lvl() << " " << oe << "\n";);
|
||||
TRACE(bv, tout << "ackerman-eq: " << s().scope_lvl() << " " << oe << "\n";);
|
||||
literal_vector eqs;
|
||||
eqs.push_back(oeq);
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
|
@ -771,7 +771,7 @@ namespace bv {
|
|||
add_clause(eq, ~oeq);
|
||||
eqs.push_back(~eq);
|
||||
}
|
||||
TRACE("bv", for (auto l : eqs) tout << mk_bounded_pp(literal2expr(l), m) << " "; tout << "\n";);
|
||||
TRACE(bv, for (auto l : eqs) tout << mk_bounded_pp(literal2expr(l), m) << " "; tout << "\n";);
|
||||
euf::th_proof_hint* ph = ctx.mk_smt_clause(name(), eqs.size(), eqs.data());
|
||||
s().mk_clause(eqs, sat::status::th(true, m.get_basic_family_id(), ph));
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ namespace bv {
|
|||
m_fixed_var_table.insert(key, v1);
|
||||
else if (n1->get_root() != var2enode(v2)->get_root()) {
|
||||
SASSERT(get_bv_size(v1) == get_bv_size(v2));
|
||||
TRACE("bv", tout << "detected equality: v" << v1 << " = v" << v2 << "\n" << pp(v1) << pp(v2););
|
||||
TRACE(bv, tout << "detected equality: v" << v1 << " = v" << v2 << "\n" << pp(v1) << pp(v2););
|
||||
m_stats.m_num_bit2eq++;
|
||||
add_fixed_eq(v1, v2);
|
||||
ctx.propagate(n1, var2enode(v2), mk_bit2eq_justification(v1, v2));
|
||||
|
@ -134,11 +134,11 @@ namespace bv {
|
|||
unsigned idx = (i + wpos) % sz;
|
||||
if (s().value(bits[idx]) == l_undef) {
|
||||
wpos = idx;
|
||||
TRACE("bv", tout << "moved wpos of v" << v << " to " << wpos << "\n";);
|
||||
TRACE(bv, tout << "moved wpos of v" << v << " to " << wpos << "\n";);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
TRACE("bv", tout << "v" << v << " is a fixed variable.\n";);
|
||||
TRACE(bv, tout << "v" << v << " is a fixed variable.\n";);
|
||||
fixed_var_eh(v);
|
||||
return true;
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ namespace bv {
|
|||
*/
|
||||
void solver::mk_new_diseq_axiom(theory_var v1, theory_var v2, unsigned idx) {
|
||||
SASSERT(m_bits[v1][idx] == ~m_bits[v2][idx]);
|
||||
TRACE("bv", tout << "found new diseq axiom\n" << pp(v1) << pp(v2););
|
||||
TRACE(bv, tout << "found new diseq axiom\n" << pp(v1) << pp(v2););
|
||||
m_stats.m_num_diseq_static++;
|
||||
expr_ref eq(m.mk_eq(var2expr(v1), var2expr(v2)), m);
|
||||
add_unit(~ctx.internalize(eq, false, false));
|
||||
|
@ -201,7 +201,7 @@ namespace bv {
|
|||
|
||||
void solver::new_eq_eh(euf::th_eq const& eq) {
|
||||
force_push();
|
||||
TRACE("bv", tout << "new eq " << mk_bounded_pp(var2expr(eq.v1()), m) << " == " << mk_bounded_pp(var2expr(eq.v2()), m) << "\n";);
|
||||
TRACE(bv, tout << "new eq " << mk_bounded_pp(var2expr(eq.v1()), m) << " == " << mk_bounded_pp(var2expr(eq.v2()), m) << "\n";);
|
||||
if (is_bv(eq.v1())) {
|
||||
m_find.merge(eq.v1(), eq.v2());
|
||||
VERIFY(eq.is_eq());
|
||||
|
@ -244,7 +244,7 @@ namespace bv {
|
|||
if (s().is_probing())
|
||||
return;
|
||||
|
||||
TRACE("bv", tout << "diff: " << v1 << " != " << v2 << " @" << s().scope_lvl() << "\n";);
|
||||
TRACE(bv, tout << "diff: " << v1 << " != " << v2 << " @" << s().scope_lvl() << "\n";);
|
||||
unsigned sz = m_bits[v1].size();
|
||||
if (sz == 1)
|
||||
return;
|
||||
|
@ -303,7 +303,7 @@ namespace bv {
|
|||
|
||||
euf::enode_pair solver::get_justification_eq(size_t j) {
|
||||
auto& c = bv_justification::from_index(j);
|
||||
TRACE("bv", display_constraint(tout, j) << "\n";);
|
||||
TRACE(bv, display_constraint(tout, j) << "\n";);
|
||||
switch (c.m_kind) {
|
||||
case bv_justification::kind_t::eq2bit:
|
||||
UNREACHABLE();
|
||||
|
@ -325,7 +325,7 @@ namespace bv {
|
|||
|
||||
void solver::get_antecedents(literal l, sat::ext_justification_idx idx, literal_vector& r, bool probing) {
|
||||
auto& c = bv_justification::from_index(idx);
|
||||
TRACE("bv", display_constraint(tout, idx) << "\n";);
|
||||
TRACE(bv, display_constraint(tout, idx) << "\n";);
|
||||
switch (c.m_kind) {
|
||||
case bv_justification::kind_t::eq2bit:
|
||||
SASSERT(s().value(c.m_antecedent) == l_true);
|
||||
|
@ -523,7 +523,7 @@ namespace bv {
|
|||
|
||||
void solver::asserted(literal l) {
|
||||
atom* a = get_bv2a(l.var());
|
||||
TRACE("bv", tout << "asserted: " << l << "\n";);
|
||||
TRACE(bv, tout << "asserted: " << l << "\n";);
|
||||
if (a) {
|
||||
force_push();
|
||||
m_prop_queue.push_back(propagation_item(a));
|
||||
|
@ -589,7 +589,7 @@ namespace bv {
|
|||
|
||||
literal bit1 = m_bits[v1][idx];
|
||||
lbool val = s().value(bit1);
|
||||
TRACE("bv", tout << "propagating v" << v1 << " #" << var2enode(v1)->get_expr_id() << "[" << idx << "] = " << val << "\n";);
|
||||
TRACE(bv, tout << "propagating v" << v1 << " #" << var2enode(v1)->get_expr_id() << "[" << idx << "] = " << val << "\n";);
|
||||
if (val == l_undef)
|
||||
return false;
|
||||
|
||||
|
@ -600,7 +600,7 @@ namespace bv {
|
|||
for (theory_var v2 = m_find.next(v1); v2 != v1; v2 = m_find.next(v2)) {
|
||||
literal bit2 = m_bits[v2][idx];
|
||||
SASSERT(m_bits[v1][idx] != ~m_bits[v2][idx]);
|
||||
TRACE("bv", tout << "propagating #" << var2enode(v2)->get_expr_id() << "[" << idx << "] = " << s().value(bit2) << "\n";);
|
||||
TRACE(bv, tout << "propagating #" << var2enode(v2)->get_expr_id() << "[" << idx << "] = " << s().value(bit2) << "\n";);
|
||||
|
||||
if (val == l_false)
|
||||
bit2.neg();
|
||||
|
@ -651,7 +651,7 @@ namespace bv {
|
|||
}
|
||||
|
||||
void solver::push_core() {
|
||||
TRACE("bv", tout << "push: " << get_num_vars() << "@" << m_prop_queue_lim.size() << "\n";);
|
||||
TRACE(bv, tout << "push: " << get_num_vars() << "@" << m_prop_queue_lim.size() << "\n";);
|
||||
th_euf_solver::push_core();
|
||||
m_prop_queue_lim.push_back(m_prop_queue.size());
|
||||
}
|
||||
|
@ -666,7 +666,7 @@ namespace bv {
|
|||
m_bits.shrink(old_sz);
|
||||
m_wpos.shrink(old_sz);
|
||||
m_zero_one_bits.shrink(old_sz);
|
||||
TRACE("bv", tout << "num vars " << old_sz << "@" << m_prop_queue_lim.size() << "\n";);
|
||||
TRACE(bv, tout << "num vars " << old_sz << "@" << m_prop_queue_lim.size() << "\n";);
|
||||
}
|
||||
|
||||
void solver::simplify() {
|
||||
|
@ -724,7 +724,7 @@ namespace bv {
|
|||
assert_ackerman(v, w);
|
||||
}
|
||||
}
|
||||
TRACE("bv", tout << "infer new equations for bit-vectors that are now equal\n";);
|
||||
TRACE(bv, tout << "infer new equations for bit-vectors that are now equal\n";);
|
||||
}
|
||||
|
||||
void solver::clauses_modifed() {}
|
||||
|
@ -886,10 +886,10 @@ namespace bv {
|
|||
|
||||
void solver::merge_eh(theory_var r1, theory_var r2, theory_var v1, theory_var v2) {
|
||||
|
||||
TRACE("bv", tout << "merging: v" << v1 << " #" << var2enode(v1)->get_expr_id() << " v" << v2 << " #" << var2enode(v2)->get_expr_id() << "\n";);
|
||||
TRACE(bv, tout << "merging: v" << v1 << " #" << var2enode(v1)->get_expr_id() << " v" << v2 << " #" << var2enode(v2)->get_expr_id() << "\n";);
|
||||
|
||||
if (!merge_zero_one_bits(r1, r2)) {
|
||||
TRACE("bv", tout << "conflict detected\n";);
|
||||
TRACE(bv, tout << "conflict detected\n";);
|
||||
return; // conflict was detected
|
||||
}
|
||||
SASSERT(m_bits[v1].size() == m_bits[v2].size());
|
||||
|
@ -899,7 +899,7 @@ namespace bv {
|
|||
for (unsigned idx = 0; !s().inconsistent() && idx < sz; idx++) {
|
||||
literal bit1 = m_bits[v1][idx];
|
||||
literal bit2 = m_bits[v2][idx];
|
||||
CTRACE("bv", bit1 == ~bit2, tout << pp(v1) << pp(v2) << "idx: " << idx << "\n";);
|
||||
CTRACE(bv, bit1 == ~bit2, tout << pp(v1) << pp(v2) << "idx: " << idx << "\n";);
|
||||
if (bit1 == ~bit2) {
|
||||
mk_new_diseq_axiom(v1, v2, idx);
|
||||
return;
|
||||
|
@ -907,10 +907,10 @@ namespace bv {
|
|||
SASSERT(bit1 != ~bit2);
|
||||
lbool val1 = s().value(bit1);
|
||||
lbool val2 = s().value(bit2);
|
||||
TRACE("bv", tout << "merge v" << v1 << " " << bit1 << ":= " << val1 << " " << bit2 << ":= " << val2 << "\n";);
|
||||
TRACE(bv, tout << "merge v" << v1 << " " << bit1 << ":= " << val1 << " " << bit2 << ":= " << val2 << "\n";);
|
||||
if (val1 == val2)
|
||||
continue;
|
||||
CTRACE("bv", (val1 != l_undef && val2 != l_undef), tout << "inconsistent "; tout << pp(v1) << pp(v2) << "idx: " << idx << "\n";);
|
||||
CTRACE(bv, (val1 != l_undef && val2 != l_undef), tout << "inconsistent "; tout << pp(v1) << pp(v2) << "idx: " << idx << "\n";);
|
||||
if (val1 == l_false)
|
||||
assign_bit(~bit2, v1, v2, idx, ~bit1, true);
|
||||
else if (val1 == l_true)
|
||||
|
@ -927,7 +927,7 @@ namespace bv {
|
|||
sat::constraint_base::initialize(mem, this);
|
||||
auto* constraint = new (sat::constraint_base::ptr2mem(mem)) bv_justification(v1, v2, c, a);
|
||||
auto jst = sat::justification::mk_ext_justification(s().scope_lvl(), constraint->to_index());
|
||||
TRACE("bv", tout << jst << " " << constraint << "\n");
|
||||
TRACE(bv, tout << jst << " " << constraint << "\n");
|
||||
return jst;
|
||||
}
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ namespace dt {
|
|||
where acc_i are the accessors of constructor c.
|
||||
*/
|
||||
void solver::assert_is_constructor_axiom(enode* n, func_decl* c, literal antecedent) {
|
||||
TRACE("dt", tout << mk_pp(c, m) << " " << ctx.bpp(n) << "\n";);
|
||||
TRACE(dt, tout << mk_pp(c, m) << " " << ctx.bpp(n) << "\n";);
|
||||
m_stats.m_assert_cnstr++;
|
||||
expr* e = n->get_expr();
|
||||
SASSERT(dt.is_constructor(c));
|
||||
|
@ -159,7 +159,7 @@ namespace dt {
|
|||
SASSERT(is_recognizer(r));
|
||||
SASSERT(dt.get_recognizer_constructor(r->get_decl()) == c->get_decl());
|
||||
SASSERT(c->get_root() == r->get_arg(0)->get_root());
|
||||
TRACE("dt", tout << ctx.bpp(c) << "\n" << ctx.bpp(r) << "\n";);
|
||||
TRACE(dt, tout << ctx.bpp(c) << "\n" << ctx.bpp(r) << "\n";);
|
||||
literal l = ctx.enode2literal(r);
|
||||
SASSERT(s().value(l) == l_false);
|
||||
clear_mark();
|
||||
|
@ -254,7 +254,7 @@ namespace dt {
|
|||
SASSERT(!d->m_constructor);
|
||||
SASSERT(!recognizer || ctx.value(recognizer) == l_false || !is_final);
|
||||
|
||||
TRACE("dt", tout << ctx.bpp(n) << " non_rec_c: " << non_rec_c->get_name() << " #rec: " << d->m_recognizers.size() << "\n";);
|
||||
TRACE(dt, tout << ctx.bpp(n) << " non_rec_c: " << non_rec_c->get_name() << " #rec: " << d->m_recognizers.size() << "\n";);
|
||||
|
||||
if (!recognizer && non_rec_c->get_arity() == 0) {
|
||||
sat::literal eq = eq_internalize(n->get_expr(), m.mk_const(non_rec_c));
|
||||
|
@ -332,7 +332,7 @@ namespace dt {
|
|||
*
|
||||
*/
|
||||
void solver::apply_sort_cnstr(enode* n, sort* s) {
|
||||
TRACE("dt", tout << "apply_sort_cnstr: #" << ctx.bpp(n) << "\n";);
|
||||
TRACE(dt, tout << "apply_sort_cnstr: #" << ctx.bpp(n) << "\n";);
|
||||
force_push();
|
||||
if (!is_attached_to_var(n))
|
||||
mk_var(n);
|
||||
|
@ -348,7 +348,7 @@ namespace dt {
|
|||
enode* n = bool_var2enode(lit.var());
|
||||
if (!is_recognizer(n))
|
||||
return;
|
||||
TRACE("dt", tout << "assigning recognizer: #" << n->get_expr_id() << " " << ctx.bpp(n) << "\n";);
|
||||
TRACE(dt, tout << "assigning recognizer: #" << n->get_expr_id() << " " << ctx.bpp(n) << "\n";);
|
||||
SASSERT(n->num_args() == 1);
|
||||
enode* arg = n->get_arg(0);
|
||||
theory_var tv = arg->get_th_var(get_id());
|
||||
|
@ -369,7 +369,7 @@ namespace dt {
|
|||
}
|
||||
|
||||
void solver::add_recognizer(theory_var v, enode* recognizer) {
|
||||
TRACE("dt", tout << "add recognizer " << v << " " << mk_pp(recognizer->get_expr(), m) << "\n";);
|
||||
TRACE(dt, tout << "add recognizer " << v << " " << mk_pp(recognizer->get_expr(), m) << "\n";);
|
||||
v = m_find.find(v);
|
||||
var_data* d = m_var_data[v];
|
||||
sort* s = recognizer->get_decl()->get_domain(0);
|
||||
|
@ -384,7 +384,7 @@ namespace dt {
|
|||
return;
|
||||
|
||||
lbool val = ctx.value(recognizer);
|
||||
TRACE("dt", tout << "adding recognizer to v" << v << " rec: #" << recognizer->get_expr_id() << " val: " << val << "\n";);
|
||||
TRACE(dt, tout << "adding recognizer to v" << v << " rec: #" << recognizer->get_expr_id() << " val: " << val << "\n";);
|
||||
|
||||
// do nothing...
|
||||
// If recognizer assignment was already processed, then
|
||||
|
@ -423,7 +423,7 @@ namespace dt {
|
|||
return;
|
||||
}
|
||||
|
||||
CTRACE("dt", d->m_recognizers.empty(), ctx.display(tout););
|
||||
CTRACE(dt, d->m_recognizers.empty(), ctx.display(tout););
|
||||
SASSERT(!d->m_recognizers.empty());
|
||||
m_lits.reset();
|
||||
enode_pair_vector eqs;
|
||||
|
@ -449,7 +449,7 @@ namespace dt {
|
|||
}
|
||||
++idx;
|
||||
}
|
||||
TRACE("dt", tout << "propagate " << num_unassigned << " eqs: " << eqs.size() << "\n";);
|
||||
TRACE(dt, tout << "propagate " << num_unassigned << " eqs: " << eqs.size() << "\n";);
|
||||
if (num_unassigned == 0) {
|
||||
auto* ph = ctx.mk_smt_hint(name(), m_lits, eqs);
|
||||
ctx.set_conflict(euf::th_explain::conflict(*this, m_lits, eqs, ph));
|
||||
|
@ -488,7 +488,7 @@ namespace dt {
|
|||
var_data* d2 = m_var_data[v2];
|
||||
auto* con1 = d1->m_constructor;
|
||||
auto* con2 = d2->m_constructor;
|
||||
TRACE("dt", tout << "merging v" << v1 << " v" << v2 << "\n" << ctx.bpp(var2enode(v1)) << " == " << ctx.bpp(var2enode(v2)) << " " << ctx.bpp(con1) << " " << ctx.bpp(con2) << "\n";);
|
||||
TRACE(dt, tout << "merging v" << v1 << " v" << v2 << "\n" << ctx.bpp(var2enode(v1)) << " == " << ctx.bpp(var2enode(v2)) << " " << ctx.bpp(con1) << " " << ctx.bpp(con2) << "\n";);
|
||||
if (con1 && con2 && con1->get_decl() != con2->get_decl())
|
||||
ctx.set_conflict(euf::th_explain::conflict(*this, con1, con2, ctx.mk_smt_hint(name(), con1, con2)));
|
||||
else if (con2 && !con1) {
|
||||
|
@ -598,7 +598,7 @@ namespace dt {
|
|||
|
||||
// explain the cycle root -> ... -> app -> root
|
||||
void solver::occurs_check_explain(enode* app, enode* root) {
|
||||
TRACE("dt", tout << "occurs_check_explain " << ctx.bpp(app) << " <-> " << ctx.bpp(root) << "\n";);
|
||||
TRACE(dt, tout << "occurs_check_explain " << ctx.bpp(app) << " <-> " << ctx.bpp(root) << "\n";);
|
||||
|
||||
// first: explain that root=v, given that app=cstor(...,v,...)
|
||||
|
||||
|
@ -616,7 +616,7 @@ namespace dt {
|
|||
if (app != root)
|
||||
m_used_eqs.push_back(enode_pair(app, root));
|
||||
|
||||
TRACE("dt",
|
||||
TRACE(dt,
|
||||
tout << "occurs_check\n"; for (enode_pair const& p : m_used_eqs) tout << ctx.bpp(p.first) << " - " << ctx.bpp(p.second) << " ";);
|
||||
}
|
||||
|
||||
|
@ -685,7 +685,7 @@ namespace dt {
|
|||
a3 = cons(v3, a1)
|
||||
*/
|
||||
bool solver::occurs_check(enode* n) {
|
||||
TRACE("dt_verbose", tout << "occurs check: " << ctx.bpp(n) << "\n";);
|
||||
TRACE(dt_verbose, tout << "occurs check: " << ctx.bpp(n) << "\n";);
|
||||
m_stats.m_occurs_check++;
|
||||
|
||||
bool res = false;
|
||||
|
@ -700,7 +700,7 @@ namespace dt {
|
|||
if (oc_cycle_free(app))
|
||||
continue;
|
||||
|
||||
TRACE("dt_verbose", tout << "occurs check loop: " << ctx.bpp(app) << (op == ENTER ? " enter" : " exit") << "\n";);
|
||||
TRACE(dt_verbose, tout << "occurs check loop: " << ctx.bpp(app) << (op == ENTER ? " enter" : " exit") << "\n";);
|
||||
|
||||
switch (op) {
|
||||
case ENTER:
|
||||
|
@ -716,7 +716,7 @@ namespace dt {
|
|||
if (res) {
|
||||
clear_mark();
|
||||
ctx.set_conflict(euf::th_explain::conflict(*this, m_used_eqs, ctx.mk_smt_hint(name(), m_used_eqs)));
|
||||
TRACE("dt", tout << "occurs check conflict: " << ctx.bpp(n) << "\n";);
|
||||
TRACE(dt, tout << "occurs check conflict: " << ctx.bpp(n) << "\n";);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
@ -783,7 +783,7 @@ namespace dt {
|
|||
if (v == euf::null_theory_var)
|
||||
return false;
|
||||
euf::enode* con = m_var_data[m_find.find(v)]->m_constructor;
|
||||
TRACE("dt", display(tout) << ctx.bpp(n) << " con: " << ctx.bpp(con) << "\n";);
|
||||
TRACE(dt, display(tout) << ctx.bpp(n) << " con: " << ctx.bpp(con) << "\n";);
|
||||
if (con->num_args() == 0)
|
||||
dep.insert(n, nullptr);
|
||||
for (enode* arg : euf::enode_args(con))
|
||||
|
|
|
@ -124,7 +124,7 @@ namespace euf {
|
|||
return;
|
||||
if (!enable_cc(a, b))
|
||||
return;
|
||||
TRACE("ack", tout << "conflict eh: " << mk_pp(a, m) << " == " << mk_pp(b, m) << "\n";);
|
||||
TRACE(ack, tout << "conflict eh: " << mk_pp(a, m) << " == " << mk_pp(b, m) << "\n";);
|
||||
insert(a, b);
|
||||
gc();
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ namespace euf {
|
|||
return;
|
||||
if (!enable_eq(a, b, c))
|
||||
return;
|
||||
TRACE("ack", tout << mk_pp(a, m) << " " << mk_pp(b, m) << " " << mk_pp(c, m) << "\n";);
|
||||
TRACE(ack, tout << mk_pp(a, m) << " " << mk_pp(b, m) << " " << mk_pp(c, m) << "\n";);
|
||||
insert(a, b, c);
|
||||
gc();
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ namespace euf {
|
|||
void ackerman::used_cc_eh(app* a, app* b) {
|
||||
if (ctx.m_drating)
|
||||
return;
|
||||
TRACE("ack", tout << "used cc: " << mk_pp(a, m) << " == " << mk_pp(b, m) << "\n";);
|
||||
TRACE(ack, tout << "used cc: " << mk_pp(a, m) << " == " << mk_pp(b, m) << "\n";);
|
||||
SASSERT(a->get_decl() == b->get_decl());
|
||||
SASSERT(a->get_num_args() == b->get_num_args());
|
||||
if (!enable_cc(a, b))
|
||||
|
@ -191,7 +191,7 @@ namespace euf {
|
|||
void ackerman::add_cc(expr* _a, expr* _b) {
|
||||
app* a = to_app(_a);
|
||||
app* b = to_app(_b);
|
||||
TRACE("ack", tout << mk_pp(a, m) << " " << mk_pp(b, m) << "\n";);
|
||||
TRACE(ack, tout << mk_pp(a, m) << " " << mk_pp(b, m) << "\n";);
|
||||
sat::literal_vector lits;
|
||||
unsigned sz = a->get_num_args();
|
||||
|
||||
|
@ -216,7 +216,7 @@ namespace euf {
|
|||
expr_ref eq1(ctx.mk_eq(a, c), m);
|
||||
expr_ref eq2(ctx.mk_eq(b, c), m);
|
||||
expr_ref eq3(ctx.mk_eq(a, b), m);
|
||||
TRACE("ack", tout << mk_pp(a, m) << " " << mk_pp(b, m) << " " << mk_pp(c, m) << "\n";);
|
||||
TRACE(ack, tout << mk_pp(a, m) << " " << mk_pp(b, m) << " " << mk_pp(c, m) << "\n";);
|
||||
lits[0] = ~ctx.mk_literal(eq1);
|
||||
lits[1] = ~ctx.mk_literal(eq2);
|
||||
lits[2] = ctx.mk_literal(eq3);
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace euf {
|
|||
SASSERT(n->bool_var() != sat::null_bool_var);
|
||||
return literal(n->bool_var(), sign);
|
||||
}
|
||||
TRACE("euf", tout << "non-bool\n";);
|
||||
TRACE(euf, tout << "non-bool\n";);
|
||||
return sat::null_literal;
|
||||
}
|
||||
if (si.is_bool_op(e)) {
|
||||
|
@ -171,7 +171,7 @@ namespace euf {
|
|||
lit = lit2;
|
||||
}
|
||||
|
||||
TRACE("euf", tout << "attach b" << v << " " << mk_bounded_pp(e, m) << "\n";);
|
||||
TRACE(euf, tout << "attach b" << v << " " << mk_bounded_pp(e, m) << "\n";);
|
||||
m_bool_var2expr.reserve(v + 1, nullptr);
|
||||
if (m_bool_var2expr[v] && m_egraph.find(e)) {
|
||||
if (m_egraph.find(e)->bool_var() != v) {
|
||||
|
@ -190,7 +190,7 @@ namespace euf {
|
|||
enode* n = m_egraph.find(e);
|
||||
if (!n)
|
||||
n = mk_enode(e, 0, nullptr);
|
||||
CTRACE("euf", n->bool_var() != sat::null_bool_var && n->bool_var() != v, display(tout << bpp(n) << " " << n->bool_var() << " vs " << v << "\n"));
|
||||
CTRACE(euf, n->bool_var() != sat::null_bool_var && n->bool_var() != v, display(tout << bpp(n) << " " << n->bool_var() << " vs " << v << "\n"));
|
||||
SASSERT(n->bool_var() == sat::null_bool_var || n->bool_var() == v);
|
||||
m_egraph.set_bool_var(n, v);
|
||||
if (si.is_bool_op(e))
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace euf {
|
|||
!m.is_bool(n->get_app()->get_arg(0)) &&
|
||||
(n->get_arg(0)->get_root() == n->get_arg(1)->get_root())) {
|
||||
enable_trace("euf");
|
||||
TRACE("euf", display(tout << n->get_expr_id() << ": " << mk_pp(n->get_expr(), m) << "\n"
|
||||
TRACE(euf, display(tout << n->get_expr_id() << ": " << mk_pp(n->get_expr(), m) << "\n"
|
||||
<< "#" << n->get_arg(0)->get_expr_id() << " == #" << n->get_arg(1)->get_expr_id() << " r: " << n->get_arg(0)->get_root_id() << "\n");
|
||||
);
|
||||
UNREACHABLE();
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace euf {
|
|||
else
|
||||
value = factory.get_fresh_value(srt);
|
||||
(void)s;
|
||||
TRACE("model", tout << s.bpp(r) << " := " << value << "\n";);
|
||||
TRACE(model, tout << s.bpp(r) << " := " << value << "\n";);
|
||||
values.set(id, value);
|
||||
expr_ref_vector* vals = nullptr;
|
||||
if (!sort2values.find(srt, vals)) {
|
||||
|
@ -77,7 +77,7 @@ namespace euf {
|
|||
}
|
||||
|
||||
void solver::update_model(model_ref& mdl, bool validate) {
|
||||
TRACE("model", tout << "create model\n";);
|
||||
TRACE(model, tout << "create model\n";);
|
||||
if (m_qmodel) {
|
||||
mdl = m_qmodel;
|
||||
return;
|
||||
|
@ -95,7 +95,7 @@ namespace euf {
|
|||
values2model(deps, mdl);
|
||||
for (auto* mb : m_solvers)
|
||||
mb->finalize_model(*mdl);
|
||||
TRACE("model", tout << "created model " << *mdl << "\n";);
|
||||
TRACE(model, tout << "created model " << *mdl << "\n";);
|
||||
if (validate)
|
||||
validate_model(*mdl);
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ namespace euf {
|
|||
for (enode* n : fresh_values)
|
||||
n->unmark1();
|
||||
|
||||
TRACE("model",
|
||||
TRACE(model,
|
||||
for (auto * t : deps.deps()) {
|
||||
auto* v = deps.get_dep(t);
|
||||
if (v) {
|
||||
|
@ -151,7 +151,7 @@ namespace euf {
|
|||
|
||||
void solver::dependencies2values(user_sort& us, deps_t& deps, model_ref& mdl) {
|
||||
for (enode* n : deps.top_sorted()) {
|
||||
TRACE("model", tout << bpp(n->get_root()) << "\n");
|
||||
TRACE(model, tout << bpp(n->get_root()) << "\n");
|
||||
unsigned id = n->get_root_id();
|
||||
if (m_values.get(id, nullptr))
|
||||
continue;
|
||||
|
@ -228,7 +228,7 @@ namespace euf {
|
|||
if (m.is_bool(e) && is_uninterp_const(e) && mdl->get_const_interp(f))
|
||||
continue;
|
||||
expr* v = m_values.get(n->get_root_id());
|
||||
CTRACE("euf", !v, tout << "no value for " << mk_pp(e, m) << "\n";);
|
||||
CTRACE(euf, !v, tout << "no value for " << mk_pp(e, m) << "\n";);
|
||||
if (!v)
|
||||
continue;
|
||||
unsigned arity = f->get_arity();
|
||||
|
@ -245,13 +245,13 @@ namespace euf {
|
|||
enode* earg = get_enode(arg);
|
||||
expr* val = m_values.get(earg->get_root_id());
|
||||
args.push_back(val);
|
||||
CTRACE("euf", !val, tout << "no value for " << bpp(earg) << "\n" << bpp(n) << "\n"; display(tout););
|
||||
CTRACE(euf, !val, tout << "no value for " << bpp(earg) << "\n" << bpp(n) << "\n"; display(tout););
|
||||
SASSERT(val);
|
||||
}
|
||||
SASSERT(args.size() == arity);
|
||||
if (!fi->get_entry(args.data()))
|
||||
fi->insert_new_entry(args.data(), v);
|
||||
TRACE("euf", tout << bpp(n) << " " << f->get_name() << "\n";
|
||||
TRACE(euf, tout << bpp(n) << " " << f->get_name() << "\n";
|
||||
for (expr* arg : args) tout << mk_pp(arg, m) << " ";
|
||||
tout << "\n -> " << mk_pp(v, m) << "\n";
|
||||
for (euf::enode* arg : euf::enode_args(n)) tout << bpp(arg) << " ";
|
||||
|
@ -279,7 +279,7 @@ namespace euf {
|
|||
for (enode* n : m_egraph.nodes())
|
||||
if (n->is_root() && m_values.get(n->get_expr_id()))
|
||||
m_values2root.insert(m_values.get(n->get_expr_id()), n);
|
||||
TRACE("model",
|
||||
TRACE(model,
|
||||
for (auto const& kv : m_values2root)
|
||||
tout << mk_bounded_pp(kv.m_key, m) << "\n -> " << bpp(kv.m_value) << "\n";);
|
||||
|
||||
|
@ -337,7 +337,7 @@ namespace euf {
|
|||
return;
|
||||
model_evaluator ev(mdl);
|
||||
ev.set_model_completion(true);
|
||||
TRACE("model",
|
||||
TRACE(model,
|
||||
for (enode* n : m_egraph.nodes()) {
|
||||
if (!is_relevant(n))
|
||||
continue;
|
||||
|
@ -365,8 +365,8 @@ namespace euf {
|
|||
continue;
|
||||
if (!tt && !mdl.is_true(e))
|
||||
continue;
|
||||
CTRACE("euf", first, display_validation_failure(tout, mdl, n););
|
||||
CTRACE("euf", first, display(tout));
|
||||
CTRACE(euf, first, display_validation_failure(tout, mdl, n););
|
||||
CTRACE(euf, first, display(tout));
|
||||
IF_VERBOSE(0, display_validation_failure(verbose_stream(), mdl, n););
|
||||
(void)first;
|
||||
first = false;
|
||||
|
|
|
@ -118,7 +118,7 @@ namespace euf {
|
|||
|
||||
void solver::log_antecedents(literal l, literal_vector const& r, th_proof_hint* hint) {
|
||||
SASSERT(hint && use_drat());
|
||||
TRACE("euf", log_antecedents(tout, l, r); tout << mk_pp(hint->get_hint(*this), m) << "\n");
|
||||
TRACE(euf, log_antecedents(tout, l, r); tout << mk_pp(hint->get_hint(*this), m) << "\n");
|
||||
literal_vector lits;
|
||||
for (literal lit : r)
|
||||
lits.push_back(~lit);
|
||||
|
@ -368,7 +368,7 @@ namespace euf {
|
|||
}
|
||||
|
||||
void solver::on_clause(unsigned n, literal const* lits, sat::status st) {
|
||||
TRACE("euf_verbose", tout << "on-clause " << n << "\n");
|
||||
TRACE(euf_verbose, tout << "on-clause " << n << "\n");
|
||||
on_lemma(n, lits, st);
|
||||
on_proof(n, lits, st);
|
||||
on_check(n, lits, st);
|
||||
|
|
|
@ -73,7 +73,7 @@ namespace euf {
|
|||
if (!m_enabled)
|
||||
return;
|
||||
flush();
|
||||
TRACE("relevancy", tout << "root " << sat::literal_vector(n, lits) << "\n");
|
||||
TRACE(relevancy, tout << "root " << sat::literal_vector(n, lits) << "\n");
|
||||
sat::literal true_lit = sat::null_literal;
|
||||
for (unsigned i = 0; i < n; ++i) {
|
||||
if (ctx.s().value(lits[i]) == l_true) {
|
||||
|
@ -102,7 +102,7 @@ namespace euf {
|
|||
if (!m_enabled)
|
||||
return;
|
||||
flush();
|
||||
TRACE("relevancy", tout << "def " << sat::literal_vector(n, lits) << "\n");
|
||||
TRACE(relevancy, tout << "def " << sat::literal_vector(n, lits) << "\n");
|
||||
for (unsigned i = 0; i < n; ++i) {
|
||||
if (ctx.s().value(lits[i]) == l_false && is_relevant(lits[i])) {
|
||||
add_root(n, lits);
|
||||
|
@ -163,7 +163,7 @@ namespace euf {
|
|||
}
|
||||
|
||||
void relevancy::asserted(sat::literal lit) {
|
||||
TRACE("relevancy", tout << "asserted " << lit << " relevant " << is_relevant(lit) << "\n");
|
||||
TRACE(relevancy, tout << "asserted " << lit << " relevant " << is_relevant(lit) << "\n");
|
||||
if (!m_enabled)
|
||||
return;
|
||||
flush();
|
||||
|
@ -210,7 +210,7 @@ namespace euf {
|
|||
}
|
||||
|
||||
void relevancy::merge(euf::enode* root, euf::enode* other) {
|
||||
TRACE("relevancy", tout << "merge #" << ctx.bpp(root) << " " << is_relevant(root) << " #" << ctx.bpp(other) << " " << is_relevant(other) << "\n");
|
||||
TRACE(relevancy, tout << "merge #" << ctx.bpp(root) << " " << is_relevant(root) << " #" << ctx.bpp(other) << " " << is_relevant(other) << "\n");
|
||||
if (is_relevant(root))
|
||||
mark_relevant(other);
|
||||
else if (is_relevant(other))
|
||||
|
@ -223,13 +223,13 @@ namespace euf {
|
|||
flush();
|
||||
if (is_relevant(n))
|
||||
return;
|
||||
TRACE("relevancy", tout << "mark #" << ctx.bpp(n) << "\n");
|
||||
TRACE(relevancy, tout << "mark #" << ctx.bpp(n) << "\n");
|
||||
m_trail.push_back(std::make_pair(update::add_queue, 0));
|
||||
m_queue.push_back(std::make_pair(sat::null_literal, n));
|
||||
}
|
||||
|
||||
void relevancy::mark_relevant(sat::literal lit) {
|
||||
TRACE("relevancy", tout << "mark " << lit << " " << is_relevant(lit) << " " << ctx.s().value(lit) << " lim: " << m_lim.size() << "\n");
|
||||
TRACE(relevancy, tout << "mark " << lit << " " << is_relevant(lit) << " " << ctx.s().value(lit) << " lim: " << m_lim.size() << "\n");
|
||||
if (!m_enabled)
|
||||
return;
|
||||
flush();
|
||||
|
@ -250,7 +250,7 @@ namespace euf {
|
|||
|
||||
void relevancy::propagate_relevant(sat::literal lit) {
|
||||
SASSERT(m_num_scopes == 0);
|
||||
TRACE("relevancy", tout << "propagate " << lit << " lim: " << m_lim.size() << "\n");
|
||||
TRACE(relevancy, tout << "propagate " << lit << " lim: " << m_lim.size() << "\n");
|
||||
SASSERT(ctx.s().value(lit) == l_true);
|
||||
SASSERT(is_relevant(lit));
|
||||
euf::enode* n = ctx.bool_var2enode(lit.var());
|
||||
|
@ -276,7 +276,7 @@ namespace euf {
|
|||
m_roots[idx] = true;
|
||||
}
|
||||
next:
|
||||
TRACE("relevancy", tout << "propagate " << lit << " " << true_lit << " " << m_roots[idx] << "\n");
|
||||
TRACE(relevancy, tout << "propagate " << lit << " " << true_lit << " " << m_roots[idx] << "\n");
|
||||
;
|
||||
}
|
||||
}
|
||||
|
@ -286,7 +286,7 @@ namespace euf {
|
|||
while (!m_todo.empty()) {
|
||||
n = m_todo.back();
|
||||
m_todo.pop_back();
|
||||
TRACE("relevancy", tout << "propagate #" << ctx.bpp(n) << " lim: " << m_lim.size() << "\n");
|
||||
TRACE(relevancy, tout << "propagate #" << ctx.bpp(n) << " lim: " << m_lim.size() << "\n");
|
||||
if (n->is_relevant())
|
||||
continue;
|
||||
m_stack.push_back(n);
|
||||
|
|
|
@ -190,7 +190,7 @@ namespace euf {
|
|||
void solver::init_search() {
|
||||
if (get_config().m_sls_enable)
|
||||
add_solver(alloc(sls::solver, *this));
|
||||
TRACE("before_search", s().display(tout););
|
||||
TRACE(before_search, s().display(tout););
|
||||
m_reason_unknown.clear();
|
||||
for (auto* s : m_solvers)
|
||||
s->init_search();
|
||||
|
@ -310,7 +310,7 @@ namespace euf {
|
|||
}
|
||||
m_egraph.end_explain();
|
||||
|
||||
CTRACE("euf", probing, tout << "explain " << l << " <- " << r << "\n");
|
||||
CTRACE(euf, probing, tout << "explain " << l << " <- " << r << "\n");
|
||||
unsigned j = 0;
|
||||
for (auto lit : r)
|
||||
if (s().lvl(lit) > 0)
|
||||
|
@ -413,7 +413,7 @@ namespace euf {
|
|||
lbool val = ante->value();
|
||||
SASSERT(val != l_undef);
|
||||
literal ante_lit(v, val == l_false);
|
||||
TRACE("euf", tout << "explain " << bpp(n) << " by " << bpp(ante) << "\n");
|
||||
TRACE(euf, tout << "explain " << bpp(n) << " by " << bpp(ante) << "\n");
|
||||
m_explain.push_back(to_ptr(ante_lit));
|
||||
}
|
||||
break;
|
||||
|
@ -448,7 +448,7 @@ namespace euf {
|
|||
if (!m_relevancy.is_relevant(l))
|
||||
return;
|
||||
expr* e = m_bool_var2expr.get(l.var(), nullptr);
|
||||
TRACE("euf", tout << "asserted: " << l << "@" << s().scope_lvl() << " := " << mk_bounded_pp(e, m) << "\n";);
|
||||
TRACE(euf, tout << "asserted: " << l << "@" << s().scope_lvl() << " := " << mk_bounded_pp(e, m) << "\n";);
|
||||
if (!e)
|
||||
return;
|
||||
euf::enode* n = m_egraph.find(e);
|
||||
|
@ -571,7 +571,7 @@ namespace euf {
|
|||
}
|
||||
unsigned lvl = s().scope_lvl();
|
||||
|
||||
CTRACE("euf", s().value(lit) != l_true, tout << lit << " " << s().value(lit) << "@" << lvl << " " << mk_bounded_pp(a, m) << " = " << mk_bounded_pp(b, m) << "\n";);
|
||||
CTRACE(euf, s().value(lit) != l_true, tout << lit << " " << s().value(lit) << "@" << lvl << " " << mk_bounded_pp(a, m) << " = " << mk_bounded_pp(b, m) << "\n";);
|
||||
if (s().value(lit) == l_false && m_ackerman && a && b)
|
||||
m_ackerman->cg_conflict_eh(a, b);
|
||||
switch (s().value(lit)) {
|
||||
|
@ -646,8 +646,8 @@ namespace euf {
|
|||
|
||||
sat::check_result solver::check() {
|
||||
++m_stats.m_final_checks;
|
||||
TRACE("euf", s().display(tout););
|
||||
TRACE("final_check", s().display(tout););
|
||||
TRACE(euf, s().display(tout););
|
||||
TRACE(final_check, s().display(tout););
|
||||
bool give_up = false;
|
||||
bool cont = false;
|
||||
|
||||
|
@ -658,7 +658,7 @@ namespace euf {
|
|||
auto apply_solver = [&](th_solver* e) {
|
||||
switch (e->check()) {
|
||||
case sat::check_result::CR_CONTINUE: cont = true; break;
|
||||
case sat::check_result::CR_GIVEUP: m_reason_unknown = "incomplete theory " + e->name().str(); TRACE("euf", tout << "give up " << e->name() << "\n"); give_up = true; break;
|
||||
case sat::check_result::CR_GIVEUP: m_reason_unknown = "incomplete theory " + e->name().str(); TRACE(euf, tout << "give up " << e->name() << "\n"); give_up = true; break;
|
||||
default: break;
|
||||
}
|
||||
};
|
||||
|
@ -688,7 +688,7 @@ namespace euf {
|
|||
return sat::check_result::CR_CONTINUE;
|
||||
if (cont)
|
||||
return sat::check_result::CR_CONTINUE;
|
||||
TRACE("after_search", s().display(tout););
|
||||
TRACE(after_search, s().display(tout););
|
||||
if (give_up)
|
||||
return sat::check_result::CR_GIVEUP;
|
||||
if (m_qsolver && m_config.m_arith_ignore_int)
|
||||
|
@ -705,17 +705,17 @@ namespace euf {
|
|||
if (!m.is_bool(n->get_expr()) || !is_shared(n))
|
||||
continue;
|
||||
if (n->value() == l_true && n->cgc_enabled() && !m.is_true(n->get_root()->get_expr())) {
|
||||
TRACE("euf", tout << "merge " << bpp(n) << "\n");
|
||||
TRACE(euf, tout << "merge " << bpp(n) << "\n");
|
||||
m_egraph.merge(n, mk_true(), to_ptr(sat::literal(n->bool_var())));
|
||||
merged = true;
|
||||
}
|
||||
if (n->value() == l_false && n->cgc_enabled() && !m.is_false(n->get_root()->get_expr())) {
|
||||
TRACE("euf", tout << "merge " << bpp(n) << "\n");
|
||||
TRACE(euf, tout << "merge " << bpp(n) << "\n");
|
||||
m_egraph.merge(n, mk_false(), to_ptr(~sat::literal(n->bool_var())));
|
||||
merged = true;
|
||||
}
|
||||
}
|
||||
CTRACE("euf", merged, tout << "shared bools merged\n");
|
||||
CTRACE(euf, merged, tout << "shared bools merged\n");
|
||||
return merged;
|
||||
}
|
||||
|
||||
|
@ -747,7 +747,7 @@ namespace euf {
|
|||
m_var_trail.shrink(sc.m_var_lim);
|
||||
m_scopes.shrink(m_scopes.size() - n);
|
||||
SASSERT(m_egraph.num_scopes() == m_scopes.size());
|
||||
TRACE("euf_verbose", display(tout << "pop to: " << m_scopes.size() << "\n"););
|
||||
TRACE(euf_verbose, display(tout << "pop to: " << m_scopes.size() << "\n"););
|
||||
}
|
||||
|
||||
void solver::user_push() {
|
||||
|
@ -792,10 +792,10 @@ namespace euf {
|
|||
for (auto const& [e, generation, v] : m_reinit)
|
||||
replay.m.insert(e, v);
|
||||
|
||||
TRACE("euf", for (auto const& kv : replay.m) tout << "b" << kv.m_value << "\n";);
|
||||
TRACE(euf, for (auto const& kv : replay.m) tout << "b" << kv.m_value << "\n";);
|
||||
for (auto const& [e, generation, v] : m_reinit) {
|
||||
scoped_generation _sg(*this, generation);
|
||||
TRACE("euf", tout << "replay: b" << v << " #" << e->get_id() << " " << mk_bounded_pp(e, m) << " " << si.is_bool_op(e) << "\n";);
|
||||
TRACE(euf, tout << "replay: b" << v << " #" << e->get_id() << " " << mk_bounded_pp(e, m) << " " << si.is_bool_op(e) << "\n";);
|
||||
sat::literal lit;
|
||||
if (si.is_bool_op(e))
|
||||
lit = literal(replay.m[e], false);
|
||||
|
@ -823,7 +823,7 @@ namespace euf {
|
|||
for (auto const& [e, generation, v] : m_reinit)
|
||||
if (si.is_bool_op(e))
|
||||
relevancy_reinit(e);
|
||||
TRACE("euf", display(tout << "replay done\n"););
|
||||
TRACE(euf, display(tout << "replay done\n"););
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -832,7 +832,7 @@ namespace euf {
|
|||
* is not supported, we just disable relevancy.
|
||||
*/
|
||||
void solver::relevancy_reinit(expr* e) {
|
||||
TRACE("euf", tout << "internalize again " << mk_pp(e, m) << "\n";);
|
||||
TRACE(euf, tout << "internalize again " << mk_pp(e, m) << "\n";);
|
||||
if (to_app(e)->get_family_id() != m.get_basic_family_id()) {
|
||||
disable_relevancy(e);
|
||||
return;
|
||||
|
@ -1040,7 +1040,7 @@ namespace euf {
|
|||
ok = false;
|
||||
|
||||
(void)ok;
|
||||
TRACE("euf", tout << ok << " " << l << " -> " << r << "\n";);
|
||||
TRACE(euf, tout << ok << " " << l << " -> " << r << "\n";);
|
||||
// roots cannot be eliminated as long as the egraph contains the expressions.
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -47,17 +47,17 @@ namespace fpa {
|
|||
expr_ref solver::convert(expr* e) {
|
||||
expr_ref res(m);
|
||||
expr* ccnv;
|
||||
TRACE("t_fpa", tout << "converting " << mk_ismt2_pp(e, m) << "\n";);
|
||||
TRACE(t_fpa, tout << "converting " << mk_ismt2_pp(e, m) << "\n";);
|
||||
|
||||
if (m_conversions.find(e, ccnv)) {
|
||||
res = ccnv;
|
||||
TRACE("t_fpa_detail", tout << "cached:" << "\n";
|
||||
TRACE(t_fpa_detail, tout << "cached:" << "\n";
|
||||
tout << mk_ismt2_pp(e, m) << "\n" << " -> " << "\n" << mk_ismt2_pp(res, m) << "\n";);
|
||||
}
|
||||
else {
|
||||
res = m_rw.convert(m_th_rw, e);
|
||||
|
||||
TRACE("t_fpa_detail", tout << "converted; caching:" << "\n";
|
||||
TRACE(t_fpa_detail, tout << "converted; caching:" << "\n";
|
||||
tout << mk_ismt2_pp(e, m) << "\n" << " -> " << "\n" << mk_ismt2_pp(res, m) << "\n";);
|
||||
|
||||
m_conversions.insert(e, res);
|
||||
|
@ -92,7 +92,7 @@ namespace fpa {
|
|||
void solver::attach_new_th_var(enode* n) {
|
||||
theory_var v = mk_var(n);
|
||||
ctx.attach_th_var(n, this, v);
|
||||
TRACE("t_fpa", tout << "new theory var: " << mk_ismt2_pp(n->get_expr(), m) << " := " << v << "\n";);
|
||||
TRACE(t_fpa, tout << "new theory var: " << mk_ismt2_pp(n->get_expr(), m) << " := " << v << "\n";);
|
||||
}
|
||||
|
||||
sat::literal solver::internalize(expr* e, bool sign, bool root) {
|
||||
|
@ -132,14 +132,14 @@ namespace fpa {
|
|||
n = mk_enode(e, false);
|
||||
SASSERT(!n->is_attached_to(get_id()));
|
||||
attach_new_th_var(n);
|
||||
TRACE("fp", tout << "post: " << mk_bounded_pp(e, m) << "\n";);
|
||||
TRACE(fp, tout << "post: " << mk_bounded_pp(e, m) << "\n";);
|
||||
m_nodes.push_back(std::tuple(n, sign, root));
|
||||
ctx.push(push_back_trail(m_nodes));
|
||||
return true;
|
||||
}
|
||||
|
||||
void solver::apply_sort_cnstr(enode* n, sort* s) {
|
||||
TRACE("t_fpa", tout << "apply sort cnstr for: " << mk_ismt2_pp(n->get_expr(), m) << "\n";);
|
||||
TRACE(t_fpa, tout << "apply sort cnstr for: " << mk_ismt2_pp(n->get_expr(), m) << "\n";);
|
||||
SASSERT(s->get_family_id() == get_id());
|
||||
SASSERT(m_fpa_util.is_float(s) || m_fpa_util.is_rm(s));
|
||||
SASSERT(m_fpa_util.is_float(n->get_expr()) || m_fpa_util.is_rm(n->get_expr()));
|
||||
|
@ -210,7 +210,7 @@ namespace fpa {
|
|||
}
|
||||
|
||||
void solver::activate(expr* n) {
|
||||
TRACE("t_fpa", tout << "relevant_eh for: " << mk_ismt2_pp(n, m) << "\n";);
|
||||
TRACE(t_fpa, tout << "relevant_eh for: " << mk_ismt2_pp(n, m) << "\n";);
|
||||
|
||||
mpf_manager& mpfm = m_fpa_util.fm();
|
||||
|
||||
|
@ -264,13 +264,13 @@ namespace fpa {
|
|||
if (fu.is_bvwrap(xe) || fu.is_bvwrap(ye))
|
||||
return;
|
||||
|
||||
TRACE("t_fpa", tout << "new eq: " << x << " = " << y << "\n";
|
||||
TRACE(t_fpa, tout << "new eq: " << x << " = " << y << "\n";
|
||||
tout << mk_ismt2_pp(xe, m) << "\n" << " = " << "\n" << mk_ismt2_pp(ye, m) << "\n";);
|
||||
|
||||
expr_ref xc = convert(xe);
|
||||
expr_ref yc = convert(ye);
|
||||
|
||||
TRACE("t_fpa_detail", tout << "xc = " << mk_ismt2_pp(xc, m) << "\n" <<
|
||||
TRACE(t_fpa_detail, tout << "xc = " << mk_ismt2_pp(xc, m) << "\n" <<
|
||||
"yc = " << mk_ismt2_pp(yc, m) << "\n";);
|
||||
|
||||
expr_ref c(m);
|
||||
|
@ -300,7 +300,7 @@ namespace fpa {
|
|||
void solver::asserted(sat::literal l) {
|
||||
expr* e = ctx.bool_var2expr(l.var());
|
||||
|
||||
TRACE("t_fpa", tout << "assign_eh for: " << l << "\n" << mk_ismt2_pp(e, m) << "\n";);
|
||||
TRACE(t_fpa, tout << "assign_eh for: " << l << "\n" << mk_ismt2_pp(e, m) << "\n";);
|
||||
|
||||
sat::literal c = mk_literal(convert(e));
|
||||
sat::literal_vector conds = mk_side_conditions();
|
||||
|
@ -354,7 +354,7 @@ namespace fpa {
|
|||
value = m_fpa_util.mk_pzero(ebits, sbits);
|
||||
}
|
||||
values.set(n->get_root_id(), value);
|
||||
TRACE("t_fpa", tout << ctx.bpp(n) << " := " << value << "\n";);
|
||||
TRACE(t_fpa, tout << ctx.bpp(n) << " := " << value << "\n";);
|
||||
}
|
||||
|
||||
bool solver::add_dep(euf::enode* n, top_sort<euf::enode>& dep) {
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace intblast {
|
|||
euf::theory_var solver::mk_var(euf::enode* n) {
|
||||
auto r = euf::th_euf_solver::mk_var(n);
|
||||
ctx.attach_th_var(n, this, r);
|
||||
TRACE("bv", tout << "mk-var: v" << r << " " << ctx.bpp(n) << "\n";);
|
||||
TRACE(bv, tout << "mk-var: v" << r << " " << ctx.bpp(n) << "\n";);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ namespace intblast {
|
|||
sat::literal lit = expr2literal(e);
|
||||
if (sign)
|
||||
lit.neg();
|
||||
TRACE("bv", tout << mk_pp(e, m) << " -> " << literal2expr(lit) << "\n");
|
||||
TRACE(bv, tout << mk_pp(e, m) << " -> " << literal2expr(lit) << "\n");
|
||||
return lit;
|
||||
}
|
||||
|
||||
|
@ -365,7 +365,7 @@ namespace intblast {
|
|||
for (expr* e : todo)
|
||||
m_translator.translate_expr(e);
|
||||
|
||||
TRACE("bv",
|
||||
TRACE(bv,
|
||||
for (expr* e : es)
|
||||
tout << mk_pp(e, m) << "\n->\n" << mk_pp(m_translator.translated(e), m) << "\n";
|
||||
);
|
||||
|
@ -500,7 +500,7 @@ namespace intblast {
|
|||
value = bv.mk_numeral(r, bv.get_bv_size(n->get_expr()));
|
||||
}
|
||||
values.set(n->get_root_id(), value);
|
||||
TRACE("model", tout << "add_value " << ctx.bpp(n) << " := " << value << "\n");
|
||||
TRACE(model, tout << "add_value " << ctx.bpp(n) << " := " << value << "\n");
|
||||
}
|
||||
|
||||
void solver::finalize_model(model& mdl) {
|
||||
|
|
|
@ -124,7 +124,7 @@ namespace pb {
|
|||
if (!is_watched(s, root)) watch_literal(s, root);
|
||||
if (!is_pure() && !is_watched(s, ~root)) watch_literal(s, ~root);
|
||||
}
|
||||
TRACE("ba", display(tout << "init watch: ", s, true););
|
||||
TRACE(ba, display(tout << "init watch: ", s, true););
|
||||
SASSERT(root == sat::null_literal || s.value(root) == l_true);
|
||||
unsigned j = 0, sz = c.size(), bound = c.k();
|
||||
// put the non-false literals into the head.
|
||||
|
|
|
@ -125,7 +125,7 @@ namespace pb {
|
|||
bool_var v = s().add_var(true);
|
||||
literal lit(v, sign);
|
||||
add_pb_ge(v, false, wlits, k.get_unsigned());
|
||||
TRACE("ba", tout << "root: " << root << " lit: " << lit << "\n";);
|
||||
TRACE(ba, tout << "root: " << root << " lit: " << lit << "\n";);
|
||||
return lit;
|
||||
}
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ namespace pb {
|
|||
sat::bool_var v = s().add_var(true);
|
||||
sat::literal lit(v, sign);
|
||||
add_pb_ge(v, false, wlits, k.get_unsigned());
|
||||
TRACE("goal2sat", tout << "root: " << root << " lit: " << lit << "\n";);
|
||||
TRACE(goal2sat, tout << "root: " << root << " lit: " << lit << "\n";);
|
||||
return lit;
|
||||
}
|
||||
}
|
||||
|
@ -217,7 +217,7 @@ namespace pb {
|
|||
add_at_least(v, lits, k.get_unsigned());
|
||||
si.cache(t, lit);
|
||||
if (sign) lit.neg();
|
||||
TRACE("ba", tout << "root: " << root << " lit: " << lit << "\n";);
|
||||
TRACE(ba, tout << "root: " << root << " lit: " << lit << "\n";);
|
||||
return lit;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -178,7 +178,7 @@ namespace pb {
|
|||
|
||||
// SASSERT(validate_watch(p, sat::null_literal));
|
||||
|
||||
TRACE("ba", display(tout << "init watch: ", s, true););
|
||||
TRACE(ba, display(tout << "init watch: ", s, true););
|
||||
|
||||
|
||||
// slack is tight:
|
||||
|
@ -245,7 +245,7 @@ namespace pb {
|
|||
return false;
|
||||
|
||||
unsigned sum = 0;
|
||||
TRACE("ba", display(tout << "validate: " << alit << "\n", s, true););
|
||||
TRACE(ba, display(tout << "validate: " << alit << "\n", s, true););
|
||||
for (wliteral wl : *this) {
|
||||
literal l = wl.second;
|
||||
lbool val = s.value(l);
|
||||
|
|
|
@ -34,7 +34,7 @@ namespace pb {
|
|||
|
||||
void solver::set_conflict(constraint& c, literal lit) {
|
||||
m_stats.m_num_conflicts++;
|
||||
TRACE("pb", display(tout, c, true); );
|
||||
TRACE(pb, display(tout, c, true); );
|
||||
if (!validate_conflict(c)) {
|
||||
IF_VERBOSE(0, display(verbose_stream(), c, true));
|
||||
UNREACHABLE();
|
||||
|
@ -56,7 +56,7 @@ namespace pb {
|
|||
default:
|
||||
m_stats.m_num_propagations++;
|
||||
m_num_propagations_since_pop++;
|
||||
//TRACE("pb", tout << "#prop: " << m_stats.m_num_propagations << " - " << c.lit() << " => " << lit << "\n";);
|
||||
//TRACE(pb, tout << "#prop: " << m_stats.m_num_propagations << " - " << c.lit() << " => " << lit << "\n";);
|
||||
SASSERT(validate_unit_propagation(c, lit));
|
||||
assign(lit, sat::justification::mk_ext_justification(s().scope_lvl(), c.cindex()));
|
||||
break;
|
||||
|
@ -69,7 +69,7 @@ namespace pb {
|
|||
void solver::simplify(constraint& p) {
|
||||
SASSERT(s().at_base_lvl());
|
||||
if (p.lit() != sat::null_literal && value(p.lit()) == l_false) {
|
||||
TRACE("pb", tout << "pb: flip sign " << p << "\n";);
|
||||
TRACE(pb, tout << "pb: flip sign " << p << "\n";);
|
||||
IF_VERBOSE(2, verbose_stream() << "sign is flipped " << p << "\n";);
|
||||
return;
|
||||
}
|
||||
|
@ -280,7 +280,7 @@ namespace pb {
|
|||
*/
|
||||
lbool solver::add_assign(pbc& p, literal alit) {
|
||||
BADLOG(display(verbose_stream() << "assign: " << alit << " watch: " << p.num_watch() << " size: " << p.size(), p, true));
|
||||
TRACE("pb", display(tout << "assign: " << alit << "\n", p, true););
|
||||
TRACE(pb, display(tout << "assign: " << alit << "\n", p, true););
|
||||
SASSERT(!inconsistent());
|
||||
unsigned sz = p.size();
|
||||
unsigned bound = p.k();
|
||||
|
@ -348,7 +348,7 @@ namespace pb {
|
|||
SASSERT(validate_watch(p, sat::null_literal));
|
||||
BADLOG(display(verbose_stream() << "conflict: " << alit << " watch: " << p.num_watch() << " size: " << p.size(), p, true));
|
||||
SASSERT(bound <= slack);
|
||||
TRACE("pb", tout << "conflict " << alit << "\n";);
|
||||
TRACE(pb, tout << "conflict " << alit << "\n";);
|
||||
set_conflict(p, alit);
|
||||
return l_false;
|
||||
}
|
||||
|
@ -372,7 +372,7 @@ namespace pb {
|
|||
//
|
||||
if (slack < bound + m_a_max) {
|
||||
BADLOG(verbose_stream() << "slack " << slack << " " << bound << " " << m_a_max << "\n";);
|
||||
TRACE("pb", tout << p << "\n"; for(auto j : m_pb_undef) tout << j << " "; tout << "\n";);
|
||||
TRACE(pb, tout << p << "\n"; for(auto j : m_pb_undef) tout << j << " "; tout << "\n";);
|
||||
for (unsigned index1 : m_pb_undef) {
|
||||
if (index1 == num_watch) {
|
||||
index1 = index;
|
||||
|
@ -389,7 +389,7 @@ namespace pb {
|
|||
|
||||
SASSERT(validate_watch(p, alit)); // except that alit is still watched.
|
||||
|
||||
TRACE("pb", display(tout << "assign: " << alit << "\n", p, true););
|
||||
TRACE(pb, display(tout << "assign: " << alit << "\n", p, true););
|
||||
|
||||
BADLOG(verbose_stream() << "unwatch " << alit << " watch: " << p.num_watch() << " size: " << p.size() << " slack: " << p.slack() << " " << inconsistent() << "\n");
|
||||
|
||||
|
@ -497,7 +497,7 @@ namespace pb {
|
|||
bool_var v = l.var();
|
||||
SASSERT(v != sat::null_bool_var);
|
||||
m_coeffs.reserve(v + 1, 0);
|
||||
TRACE("ba_verbose", tout << l << " " << offset << "\n";);
|
||||
TRACE(ba_verbose, tout << l << " " << offset << "\n";);
|
||||
|
||||
int64_t coeff0 = m_coeffs[v];
|
||||
if (coeff0 == 0) {
|
||||
|
@ -547,7 +547,7 @@ namespace pb {
|
|||
literal l = literal(v, c1 < 0);
|
||||
c1 = std::abs(c1);
|
||||
unsigned c = static_cast<unsigned>(c1);
|
||||
// TRACE("pb", tout << l << " " << c << "\n";);
|
||||
// TRACE(pb, tout << l << " " << c << "\n";);
|
||||
m_overflow |= c != c1;
|
||||
return wliteral(c, l);
|
||||
}
|
||||
|
@ -638,7 +638,7 @@ namespace pb {
|
|||
m_bound = 0;
|
||||
literal consequent = s().m_not_l;
|
||||
sat::justification js = s().m_conflict;
|
||||
TRACE("pb", tout << consequent << " " << js << "\n";);
|
||||
TRACE(pb, tout << consequent << " " << js << "\n";);
|
||||
bool unique_max;
|
||||
m_conflict_lvl = s().get_max_lvl(consequent, js, unique_max);
|
||||
if (m_conflict_lvl == 0) {
|
||||
|
@ -666,8 +666,8 @@ namespace pb {
|
|||
goto process_next_resolvent;
|
||||
}
|
||||
|
||||
DEBUG_CODE(TRACE("sat_verbose", display(tout, m_A);););
|
||||
TRACE("pb", tout << "process consequent: " << consequent << " : "; s().display_justification(tout, js) << "\n";);
|
||||
DEBUG_CODE(TRACE(sat_verbose, display(tout, m_A);););
|
||||
TRACE(pb, tout << "process consequent: " << consequent << " : "; s().display_justification(tout, js) << "\n";);
|
||||
SASSERT(offset > 0);
|
||||
|
||||
if (_debug_conflict) {
|
||||
|
@ -729,7 +729,7 @@ namespace pb {
|
|||
inc_bound(offset);
|
||||
inc_coeff(consequent, offset);
|
||||
get_antecedents(consequent, p, m_lemma);
|
||||
TRACE("pb", display(tout, p, true); tout << m_lemma << "\n";);
|
||||
TRACE(pb, display(tout, p, true); tout << m_lemma << "\n";);
|
||||
if (_debug_conflict) {
|
||||
verbose_stream() << consequent << " ";
|
||||
verbose_stream() << "antecedents: " << m_lemma << "\n";
|
||||
|
@ -754,7 +754,7 @@ namespace pb {
|
|||
active2pb(m_C);
|
||||
VERIFY(validate_resolvent());
|
||||
m_A = m_C;
|
||||
TRACE("pb", display(tout << "conflict: ", m_A);););
|
||||
TRACE(pb, display(tout << "conflict: ", m_A);););
|
||||
|
||||
cut();
|
||||
|
||||
|
@ -781,7 +781,7 @@ namespace pb {
|
|||
SASSERT(lvl(v) == m_conflict_lvl);
|
||||
s().reset_mark(v);
|
||||
--idx;
|
||||
TRACE("sat_verbose", tout << "Unmark: v" << v << "\n";);
|
||||
TRACE(sat_verbose, tout << "Unmark: v" << v << "\n";);
|
||||
--m_num_marks;
|
||||
js = s().m_justification[v];
|
||||
offset = get_abs_coeff(v);
|
||||
|
@ -875,7 +875,7 @@ namespace pb {
|
|||
}
|
||||
}
|
||||
ineq.divide(c);
|
||||
TRACE("pb", display(tout << "var: " << v << " " << c << ": ", ineq, true););
|
||||
TRACE(pb, display(tout << "var: " << v << " " << c << ": ", ineq, true););
|
||||
}
|
||||
|
||||
void solver::round_to_one(bool_var w) {
|
||||
|
@ -893,7 +893,7 @@ namespace pb {
|
|||
SASSERT(validate_lemma());
|
||||
divide(c);
|
||||
SASSERT(validate_lemma());
|
||||
TRACE("pb", active2pb(m_B); display(tout, m_B, true););
|
||||
TRACE(pb, active2pb(m_B); display(tout, m_B, true););
|
||||
}
|
||||
|
||||
void solver::divide(unsigned c) {
|
||||
|
@ -923,14 +923,14 @@ namespace pb {
|
|||
}
|
||||
|
||||
void solver::resolve_with(ineq const& ineq) {
|
||||
TRACE("pb", display(tout, ineq, true););
|
||||
TRACE(pb, display(tout, ineq, true););
|
||||
inc_bound(ineq.m_k);
|
||||
TRACE("pb", tout << "bound: " << m_bound << "\n";);
|
||||
TRACE(pb, tout << "bound: " << m_bound << "\n";);
|
||||
|
||||
for (unsigned i = ineq.size(); i-- > 0; ) {
|
||||
literal l = ineq.lit(i);
|
||||
inc_coeff(l, static_cast<unsigned>(ineq.coeff(i)));
|
||||
TRACE("pb", tout << "bound: " << m_bound << " lit: " << l << " coeff: " << ineq.coeff(i) << "\n";);
|
||||
TRACE(pb, tout << "bound: " << m_bound << " lit: " << l << " coeff: " << ineq.coeff(i) << "\n";);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -983,11 +983,11 @@ namespace pb {
|
|||
consequent.neg();
|
||||
process_antecedent(consequent, 1);
|
||||
}
|
||||
TRACE("pb", tout << consequent << " " << js << "\n";);
|
||||
TRACE(pb, tout << consequent << " " << js << "\n";);
|
||||
unsigned idx = s().m_trail.size() - 1;
|
||||
|
||||
do {
|
||||
TRACE("pb", s().display_justification(tout << "process consequent: " << consequent << " : ", js) << "\n";
|
||||
TRACE(pb, s().display_justification(tout << "process consequent: " << consequent << " : ", js) << "\n";
|
||||
if (consequent != sat::null_literal) { active2pb(m_A); display(tout, m_A, true); }
|
||||
);
|
||||
|
||||
|
@ -1049,7 +1049,7 @@ namespace pb {
|
|||
}
|
||||
else {
|
||||
SASSERT(k > c);
|
||||
TRACE("pb", tout << "visited: " << l << "\n";);
|
||||
TRACE(pb, tout << "visited: " << l << "\n";);
|
||||
k -= c;
|
||||
}
|
||||
}
|
||||
|
@ -1098,7 +1098,7 @@ namespace pb {
|
|||
}
|
||||
}
|
||||
if (idx == 0) {
|
||||
TRACE("pb", tout << "there is no consequent\n";);
|
||||
TRACE(pb, tout << "there is no consequent\n";);
|
||||
goto bail_out;
|
||||
}
|
||||
--idx;
|
||||
|
@ -1111,7 +1111,7 @@ namespace pb {
|
|||
js = s().m_justification[v];
|
||||
}
|
||||
while (m_num_marks > 0 && !m_overflow);
|
||||
TRACE("pb", active2pb(m_A); display(tout, m_A, true););
|
||||
TRACE(pb, active2pb(m_A); display(tout, m_A, true););
|
||||
|
||||
// TBD: check if this is useful
|
||||
if (!m_overflow && consequent != sat::null_literal) {
|
||||
|
@ -1123,7 +1123,7 @@ namespace pb {
|
|||
}
|
||||
|
||||
bail_out:
|
||||
TRACE("pb", tout << "bail " << m_overflow << "\n";);
|
||||
TRACE(pb, tout << "bail " << m_overflow << "\n";);
|
||||
if (m_overflow) {
|
||||
++m_stats.m_num_overflow;
|
||||
m_overflow = false;
|
||||
|
@ -1179,23 +1179,23 @@ namespace pb {
|
|||
}
|
||||
}
|
||||
if (slack >= 0) {
|
||||
TRACE("pb", tout << "slack is non-negative\n";);
|
||||
TRACE(pb, tout << "slack is non-negative\n";);
|
||||
IF_VERBOSE(20, verbose_stream() << "(sat.card slack: " << slack << " skipped: " << num_skipped << ")\n";);
|
||||
return false;
|
||||
}
|
||||
if (m_overflow) {
|
||||
TRACE("pb", tout << "overflow\n";);
|
||||
TRACE(pb, tout << "overflow\n";);
|
||||
return false;
|
||||
}
|
||||
if (m_lemma[0] == sat::null_literal) {
|
||||
if (m_lemma.size() == 1) {
|
||||
s().set_conflict(sat::justification(0));
|
||||
}
|
||||
TRACE("pb", tout << "no asserting literal\n";);
|
||||
TRACE(pb, tout << "no asserting literal\n";);
|
||||
return false;
|
||||
}
|
||||
|
||||
TRACE("pb", tout << m_lemma << "\n";);
|
||||
TRACE(pb, tout << m_lemma << "\n";);
|
||||
|
||||
if (get_config().m_drat && m_solver) {
|
||||
s().m_drat.add(m_lemma, sat::status::th(true, get_id()));
|
||||
|
@ -1204,7 +1204,7 @@ namespace pb {
|
|||
s().m_lemma.reset();
|
||||
s().m_lemma.append(m_lemma);
|
||||
for (unsigned i = 1; i < m_lemma.size(); ++i) {
|
||||
CTRACE("pb", s().is_marked(m_lemma[i].var()), tout << "marked: " << m_lemma[i] << "\n";);
|
||||
CTRACE(pb, s().is_marked(m_lemma[i].var()), tout << "marked: " << m_lemma[i] << "\n";);
|
||||
s().mark(m_lemma[i].var());
|
||||
}
|
||||
return true;
|
||||
|
@ -1550,7 +1550,7 @@ namespace pb {
|
|||
}
|
||||
|
||||
void solver::get_antecedents(literal l, pbc const& p, literal_vector& r) {
|
||||
TRACE("pb", display(tout << l << " level: " << s().scope_lvl() << " ", p, true););
|
||||
TRACE(pb, display(tout << l << " level: " << s().scope_lvl() << " ", p, true););
|
||||
SASSERT(p.lit() == sat::null_literal || value(p.lit()) == l_true);
|
||||
|
||||
if (p.lit() != sat::null_literal) {
|
||||
|
@ -1602,7 +1602,7 @@ namespace pb {
|
|||
if (j < p.num_watch()) {
|
||||
j = p.num_watch();
|
||||
}
|
||||
CTRACE("pb", coeff == 0, display(tout << l << " coeff: " << coeff << "\n", p, true););
|
||||
CTRACE(pb, coeff == 0, display(tout << l << " coeff: " << coeff << "\n", p, true););
|
||||
|
||||
if (_debug_conflict) {
|
||||
IF_VERBOSE(0, verbose_stream() << "coeff " << coeff << "\n";);
|
||||
|
@ -1653,7 +1653,7 @@ namespace pb {
|
|||
for (unsigned i = 0; !found && i < c.k(); ++i) {
|
||||
found = c[i] == l;
|
||||
}
|
||||
CTRACE("pb",!found, s().display(tout << l << ":" << c << "\n"););
|
||||
CTRACE(pb,!found, s().display(tout << l << ":" << c << "\n"););
|
||||
SASSERT(found););
|
||||
|
||||
VERIFY(c.lit() == sat::null_literal || value(c.lit()) != l_false);
|
||||
|
@ -1693,7 +1693,7 @@ namespace pb {
|
|||
}
|
||||
|
||||
void solver::remove_constraint(constraint& c, char const* reason) {
|
||||
TRACE("pb", display(tout << "remove ", c, true) << " " << reason << "\n";);
|
||||
TRACE(pb, display(tout << "remove ", c, true) << " " << reason << "\n";);
|
||||
IF_VERBOSE(21, display(verbose_stream() << "remove " << reason << " ", c, true););
|
||||
c.nullify_tracking_literal(*this);
|
||||
clear_watch(c);
|
||||
|
@ -1868,7 +1868,7 @@ namespace pb {
|
|||
}
|
||||
|
||||
void solver::gc_half(char const* st_name) {
|
||||
TRACE("pb", tout << "gc\n";);
|
||||
TRACE(pb, tout << "gc\n";);
|
||||
unsigned sz = m_learned.size();
|
||||
unsigned new_sz = sz/2;
|
||||
unsigned removed = 0;
|
||||
|
@ -1915,7 +1915,7 @@ namespace pb {
|
|||
// literal is assigned to false.
|
||||
unsigned sz = c.size();
|
||||
unsigned bound = c.k();
|
||||
TRACE("pb", tout << "assign: " << c.lit() << ": " << ~alit << "@" << lvl(~alit) << " " << c << "\n";);
|
||||
TRACE(pb, tout << "assign: " << c.lit() << ": " << ~alit << "@" << lvl(~alit) << " " << c << "\n";);
|
||||
|
||||
SASSERT(0 < bound && bound <= sz);
|
||||
if (bound == sz) {
|
||||
|
@ -1953,7 +1953,7 @@ namespace pb {
|
|||
|
||||
// conflict
|
||||
if (bound != index && value(c[bound]) == l_false) {
|
||||
TRACE("pb", tout << "conflict " << c[bound] << " " << alit << "\n";);
|
||||
TRACE(pb, tout << "conflict " << c[bound] << " " << alit << "\n";);
|
||||
if (c.lit() != sat::null_literal && value(c.lit()) == l_undef) {
|
||||
if (index + 1 < bound) c.swap(index, bound - 1);
|
||||
assign(c, ~c.lit());
|
||||
|
@ -1967,7 +1967,7 @@ namespace pb {
|
|||
c.swap(index, bound);
|
||||
}
|
||||
|
||||
// TRACE("pb", tout << "no swap " << index << " " << alit << "\n";);
|
||||
// TRACE(pb, tout << "no swap " << index << " " << alit << "\n";);
|
||||
// there are no literals to swap with,
|
||||
// prepare for unit propagation by swapping the false literal into
|
||||
// position bound. Then literals in positions 0..bound-1 have to be
|
||||
|
@ -2002,7 +2002,7 @@ namespace pb {
|
|||
}
|
||||
|
||||
void solver::pop(unsigned n) {
|
||||
TRACE("sat_verbose", tout << "pop:" << n << "\n";);
|
||||
TRACE(sat_verbose, tout << "pop:" << n << "\n";);
|
||||
unsigned new_lim = m_constraint_to_reinit_lim.size() - n;
|
||||
m_constraint_to_reinit_last_sz = m_constraint_to_reinit_lim[new_lim];
|
||||
m_constraint_to_reinit_lim.shrink(new_lim);
|
||||
|
@ -2333,7 +2333,7 @@ namespace pb {
|
|||
}
|
||||
|
||||
if (!all_units) {
|
||||
TRACE("pb", tout << "replacing by pb: " << c << "\n";);
|
||||
TRACE(pb, tout << "replacing by pb: " << c << "\n";);
|
||||
m_wlits.reset();
|
||||
for (unsigned i = 0; i < sz; ++i) {
|
||||
m_wlits.push_back(wliteral(coeffs[i], c[i]));
|
||||
|
@ -2898,13 +2898,13 @@ namespace pb {
|
|||
SASSERT(&c1 != &c2);
|
||||
if (subsumes(c1, c2, slit)) {
|
||||
if (slit.empty()) {
|
||||
TRACE("pb", tout << "subsume cardinality\n" << c1 << "\n" << c2 << "\n";);
|
||||
TRACE(pb, tout << "subsume cardinality\n" << c1 << "\n" << c2 << "\n";);
|
||||
remove_constraint(c2, "subsumed");
|
||||
++m_stats.m_num_pb_subsumes;
|
||||
set_non_learned(c1);
|
||||
}
|
||||
else {
|
||||
TRACE("pb", tout << "self subsume cardinality\n";);
|
||||
TRACE(pb, tout << "self subsume cardinality\n";);
|
||||
IF_VERBOSE(11,
|
||||
verbose_stream() << "self-subsume cardinality\n";
|
||||
verbose_stream() << c1 << "\n";
|
||||
|
@ -2936,7 +2936,7 @@ namespace pb {
|
|||
// self-subsumption is TBD
|
||||
}
|
||||
else {
|
||||
TRACE("pb", tout << "remove\n" << c1 << "\n" << c2 << "\n";);
|
||||
TRACE(pb, tout << "remove\n" << c1 << "\n" << c2 << "\n";);
|
||||
removed_clauses.push_back(&c2);
|
||||
++m_stats.m_num_clause_subsumes;
|
||||
set_non_learned(c1);
|
||||
|
@ -3268,7 +3268,7 @@ namespace pb {
|
|||
val += wl.first;
|
||||
}
|
||||
}
|
||||
CTRACE("pb", val >= 0, active2pb(m_A); display(tout, m_A, true););
|
||||
CTRACE(pb, val >= 0, active2pb(m_A); display(tout, m_A, true););
|
||||
return val < 0;
|
||||
}
|
||||
|
||||
|
@ -3281,7 +3281,7 @@ namespace pb {
|
|||
if (!is_false(wl.second))
|
||||
k += wl.first;
|
||||
}
|
||||
CTRACE("pb", k > 0, display(tout, ineq, true););
|
||||
CTRACE(pb, k > 0, display(tout, ineq, true););
|
||||
return k <= 0;
|
||||
}
|
||||
|
||||
|
@ -3340,7 +3340,7 @@ namespace pb {
|
|||
return nullptr;
|
||||
}
|
||||
constraint* c = add_pb_ge(sat::null_literal, m_wlits, m_bound, true);
|
||||
TRACE("pb", if (c) display(tout, *c, true););
|
||||
TRACE(pb, if (c) display(tout, *c, true););
|
||||
++m_stats.m_num_lemmas;
|
||||
return c;
|
||||
}
|
||||
|
@ -3528,7 +3528,7 @@ namespace pb {
|
|||
s0.assign_scoped(l2);
|
||||
s0.assign_scoped(l3);
|
||||
lbool is_sat = s0.check();
|
||||
TRACE("pb", s0.display(tout << "trying sat encoding"););
|
||||
TRACE(pb, s0.display(tout << "trying sat encoding"););
|
||||
if (is_sat == l_false) return true;
|
||||
|
||||
IF_VERBOSE(0,
|
||||
|
@ -3639,11 +3639,11 @@ namespace pb {
|
|||
bool solver::validate_conflict(literal_vector const& lits, ineq& p) {
|
||||
for (literal l : lits) {
|
||||
if (value(l) != l_false) {
|
||||
TRACE("pb", tout << "literal " << l << " is not false\n";);
|
||||
TRACE(pb, tout << "literal " << l << " is not false\n";);
|
||||
return false;
|
||||
}
|
||||
if (!p.contains(l)) {
|
||||
TRACE("pb", tout << "lemma contains literal " << l << " not in inequality\n";);
|
||||
TRACE(pb, tout << "lemma contains literal " << l << " not in inequality\n";);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -3654,7 +3654,7 @@ namespace pb {
|
|||
value += coeff;
|
||||
}
|
||||
}
|
||||
CTRACE("pb", value >= p.m_k, tout << "slack: " << value << " bound " << p.m_k << "\n";
|
||||
CTRACE(pb, value >= p.m_k, tout << "slack: " << value << " bound " << p.m_k << "\n";
|
||||
display(tout, p);
|
||||
tout << lits << "\n";);
|
||||
return value < p.m_k;
|
||||
|
|
|
@ -157,7 +157,7 @@ namespace q {
|
|||
SASSERT(is_forall(r));
|
||||
for (expr* d : m_new_defs)
|
||||
m_qs.add_unit(m_qs.mk_literal(d));
|
||||
CTRACE("q", r != q, tout << mk_pp(q, m) << " -->\n" << r << "\n" << m_new_defs << "\n";);
|
||||
CTRACE(q, r != q, tout << mk_pp(q, m) << " -->\n" << r << "\n" << m_new_defs << "\n";);
|
||||
return quantifier_ref(to_quantifier(r), m);
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,7 @@ namespace q {
|
|||
};
|
||||
|
||||
void ematch::on_merge(euf::enode* root, euf::enode* other) {
|
||||
TRACE("q", tout << "on-merge " << ctx.bpp(root) << " " << ctx.bpp(other) << "\n";);
|
||||
TRACE(q, tout << "on-merge " << ctx.bpp(root) << " " << ctx.bpp(other) << "\n";);
|
||||
SASSERT(root->get_root() == other->get_root());
|
||||
unsigned root_id = root->get_expr_id();
|
||||
unsigned other_id = other->get_expr_id();
|
||||
|
@ -331,7 +331,7 @@ namespace q {
|
|||
binding* b = alloc_binding(c, pat, _binding, max_generation, min_gen, max_gen);
|
||||
if (!b)
|
||||
return;
|
||||
TRACE("q", b->display(ctx, tout << "on-binding " << mk_pp(q, m) << "\n") << "\n";);
|
||||
TRACE(q, b->display(ctx, tout << "on-binding " << mk_pp(q, m) << "\n") << "\n";);
|
||||
|
||||
|
||||
if (propagate(false, _binding, max_generation, c, new_propagation))
|
||||
|
@ -576,7 +576,7 @@ namespace q {
|
|||
};
|
||||
|
||||
void ematch::add(quantifier* _q) {
|
||||
TRACE("q", tout << "add " << mk_pp(_q, m) << "\n");
|
||||
TRACE(q, tout << "add " << mk_pp(_q, m) << "\n");
|
||||
scoped_ptr<clause> c = clausify(_q);
|
||||
quantifier* q = c->q();
|
||||
if (m_q2clauses.contains(q))
|
||||
|
@ -598,9 +598,9 @@ namespace q {
|
|||
app * mp = to_app(q->get_pattern(i));
|
||||
SASSERT(m.is_pattern(mp));
|
||||
bool unary = (mp->get_num_args() == 1);
|
||||
TRACE("q", tout << "adding:\n" << expr_ref(mp, m) << "\n");
|
||||
TRACE(q, tout << "adding:\n" << expr_ref(mp, m) << "\n");
|
||||
if (!unary && j >= num_eager_multi_patterns) {
|
||||
TRACE("q", tout << "delaying (too many multipatterns):\n" << mk_ismt2_pp(mp, m) << "\n";);
|
||||
TRACE(q, tout << "delaying (too many multipatterns):\n" << mk_ismt2_pp(mp, m) << "\n";);
|
||||
if (!m_lazy_mam)
|
||||
m_lazy_mam = euf::mam::mk(ctx, *this);
|
||||
m_lazy_mam->add_pattern(q, mp);
|
||||
|
@ -675,7 +675,7 @@ namespace q {
|
|||
}
|
||||
|
||||
bool ematch::operator()() {
|
||||
TRACE("q", m_mam->display(tout););
|
||||
TRACE(q, m_mam->display(tout););
|
||||
if (propagate(false))
|
||||
return true;
|
||||
if (m_lazy_mam)
|
||||
|
@ -692,11 +692,11 @@ namespace q {
|
|||
for (unsigned i = 0; i < m_clauses.size(); ++i)
|
||||
if (m_clauses[i]->m_bindings) {
|
||||
IF_VERBOSE(0, verbose_stream() << "missed propagation " << i << "\n");
|
||||
TRACE("q", display(tout << "missed propagation\n"));
|
||||
TRACE(q, display(tout << "missed propagation\n"));
|
||||
break;
|
||||
}
|
||||
|
||||
TRACE("q", tout << "no more propagation\n";);
|
||||
TRACE(q, tout << "no more propagation\n";);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ namespace q {
|
|||
unsigned lim = m_indirect_nodes.size();
|
||||
lit l = c[i];
|
||||
lbool cmp = compare(n, binding, l.lhs, l.rhs, evidence);
|
||||
TRACE("q", tout << l.lhs << " ~~ " << l.rhs << " is " << cmp << "\n";);
|
||||
TRACE(q, tout << l.lhs << " ~~ " << l.rhs << " is " << cmp << "\n";);
|
||||
switch (cmp) {
|
||||
case l_false:
|
||||
m_indirect_nodes.shrink(lim);
|
||||
|
@ -93,7 +93,7 @@ namespace q {
|
|||
euf::enode* tr = tn ? tn->get_root() : tn;
|
||||
if (sn != sr) evidence.push_back(euf::enode_pair(sn, sr)), sn = sr;
|
||||
if (tn != tr) evidence.push_back(euf::enode_pair(tn, tr)), tn = tr;
|
||||
TRACE("q", tout << mk_pp(s, m) << " ~~ " << mk_pp(t, m) << "\n";
|
||||
TRACE(q, tout << mk_pp(s, m) << " ~~ " << mk_pp(t, m) << "\n";
|
||||
tout << ctx.bpp(sn) << " " << ctx.bpp(tn) << "\n";);
|
||||
|
||||
lbool c;
|
||||
|
@ -237,7 +237,7 @@ namespace q {
|
|||
if (a->get_root() != b->get_root())
|
||||
return nullptr;
|
||||
|
||||
TRACE("q", tout << "evidence " << ctx.bpp(a) << " " << ctx.bpp(b) << "\n");
|
||||
TRACE(q, tout << "evidence " << ctx.bpp(a) << " " << ctx.bpp(b) << "\n");
|
||||
evidence.push_back(euf::enode_pair(a, b));
|
||||
}
|
||||
m_indirect_nodes.push_back(n);
|
||||
|
|
|
@ -197,7 +197,7 @@ namespace q {
|
|||
expr_ref_vector eqs(m);
|
||||
add_domain_bounds(mdl, qb);
|
||||
auto proj = solver_project(mdl, qb, eqs, false);
|
||||
CTRACE("q", !proj, tout << "could not project " << qb.mbody << " " << eqs << "\n" << mdl);
|
||||
CTRACE(q, !proj, tout << "could not project " << qb.mbody << " " << eqs << "\n" << mdl);
|
||||
if (!proj)
|
||||
return false;
|
||||
add_instantiation(q, proj);
|
||||
|
@ -234,7 +234,7 @@ namespace q {
|
|||
if (is_exists(q))
|
||||
qlit.neg();
|
||||
ctx.rewrite(proj);
|
||||
TRACE("q", tout << "project: " << proj << "\n";);
|
||||
TRACE(q, tout << "project: " << proj << "\n";);
|
||||
IF_VERBOSE(11, verbose_stream() << "mbi:\n" << mk_pp(q, m) << "\n" << proj << "\n");
|
||||
++m_stats.m_num_instantiations;
|
||||
unsigned generation = ctx.get_max_generation(proj);
|
||||
|
@ -280,7 +280,7 @@ namespace q {
|
|||
mbody = subst(mbody, result->vars);
|
||||
if (is_forall(q))
|
||||
mbody = mk_not(m, mbody);
|
||||
TRACE("q", tout << "specialize " << mbody << "\n";);
|
||||
TRACE(q, tout << "specialize " << mbody << "\n";);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -319,7 +319,7 @@ namespace q {
|
|||
app_ref_vector vars(qb.vars);
|
||||
bool fmls_extracted = false;
|
||||
m_defs.reset();
|
||||
TRACE("q",
|
||||
TRACE(q,
|
||||
tout << "Project\n";
|
||||
tout << fmls << "\n";
|
||||
tout << "model\n";
|
||||
|
@ -337,13 +337,13 @@ namespace q {
|
|||
app* v = vars.get(i);
|
||||
auto* p = get_plugin(v);
|
||||
if (p && !fmls_extracted) {
|
||||
TRACE("q", tout << "domain eqs\n" << qb.domain_eqs << "\n";);
|
||||
TRACE(q, tout << "domain eqs\n" << qb.domain_eqs << "\n";);
|
||||
|
||||
fmls.append(qb.domain_eqs);
|
||||
eliminate_nested_vars(fmls, qb);
|
||||
for (expr* e : fmls)
|
||||
if (!m_model->is_true(e)) {
|
||||
TRACE("q", tout << "not true: " << mk_pp(e, m) << " := " << (*m_model)(e) << "\n");
|
||||
TRACE(q, tout << "not true: " << mk_pp(e, m) << " := " << (*m_model)(e) << "\n");
|
||||
return expr_ref(nullptr, m);
|
||||
}
|
||||
mbp::project_plugin proj(m);
|
||||
|
@ -357,21 +357,21 @@ namespace q {
|
|||
return expr_ref(m);
|
||||
}
|
||||
else if (!(*p)(*m_model, vars, fmls)) {
|
||||
TRACE("q", tout << "theory projection failed - use value\n");
|
||||
TRACE(q, tout << "theory projection failed - use value\n");
|
||||
}
|
||||
}
|
||||
for (app* v : vars) {
|
||||
expr_ref term(m);
|
||||
expr_ref val = (*m_model)(v);
|
||||
term = replace_model_value(val);
|
||||
TRACE("euf", tout << "replaced model value " << term << "\nfrom\n" << val << "\n");
|
||||
TRACE(euf, tout << "replaced model value " << term << "\nfrom\n" << val << "\n");
|
||||
rep.insert(v, term);
|
||||
if (ctx.use_drat())
|
||||
m_defs.push_back({expr_ref(v, m), term});
|
||||
eqs.push_back(m.mk_eq(v, val));
|
||||
}
|
||||
rep(fmls);
|
||||
TRACE("q", tout << "generated formulas\n" << fmls << "\ngenerated eqs:\n" << eqs << "\n";
|
||||
TRACE(q, tout << "generated formulas\n" << fmls << "\ngenerated eqs:\n" << eqs << "\n";
|
||||
for (auto const& [v,t] : m_defs) tout << v << " := " << t << "\n");
|
||||
return mk_and(fmls);
|
||||
}
|
||||
|
@ -436,7 +436,7 @@ namespace q {
|
|||
|
||||
void mbqi::assert_expr(expr* e) {
|
||||
expr_ref _e(e, m);
|
||||
TRACE("q", tout << _e << "\n");
|
||||
TRACE(q, tout << _e << "\n");
|
||||
m_solver->assert_expr(e);
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ namespace q {
|
|||
if (univ.empty())
|
||||
return;
|
||||
|
||||
TRACE("q", tout << "start: " << mdl << "\n";);
|
||||
TRACE(q, tout << "start: " << mdl << "\n";);
|
||||
m_dependencies.reset();
|
||||
m_projection_data.reset();
|
||||
m_projection_pinned.reset();
|
||||
|
@ -96,7 +96,7 @@ namespace q {
|
|||
if (fi->is_partial())
|
||||
fi->set_else(mdl.get_some_value(f->get_range()));
|
||||
}
|
||||
TRACE("q", tout << "end: " << mdl << "\n";);
|
||||
TRACE(q, tout << "end: " << mdl << "\n";);
|
||||
}
|
||||
|
||||
quantifier_macro_info* model_fixer::operator()(quantifier* q) {
|
||||
|
@ -252,7 +252,7 @@ namespace q {
|
|||
expr* model_fixer::invert_app(app* t, expr* value) {
|
||||
euf::enode* r = nullptr;
|
||||
auto& v2r = ctx.values2root();
|
||||
TRACE("q",
|
||||
TRACE(q,
|
||||
tout << "invert-app " << mk_pp(t, m) << " =\n" << mk_pp(value, m) << "\n";
|
||||
if (v2r.find(value, r))
|
||||
tout << "inverse " << mk_pp(r->get_expr(), m) << "\n";
|
||||
|
@ -273,7 +273,7 @@ namespace q {
|
|||
*/
|
||||
|
||||
void model_fixer::invert_arg(app* t, unsigned i, expr* value, expr_ref_vector& lits) {
|
||||
TRACE("q", tout << "invert-arg " << mk_pp(t, m) << " " << i << " " << mk_pp(value, m) << "\n";);
|
||||
TRACE(q, tout << "invert-arg " << mk_pp(t, m) << " " << i << " " << mk_pp(value, m) << "\n";);
|
||||
auto const* md = get_projection_data(t->get_decl(), i);
|
||||
if (!md)
|
||||
return;
|
||||
|
@ -326,7 +326,7 @@ namespace q {
|
|||
* restrict arg_i of t := f(...,arg_i,...) to be one of terms from the ground instantiations of f.
|
||||
*/
|
||||
expr_ref model_fixer::restrict_arg(app* t, unsigned i) {
|
||||
TRACE("q", tout << "restrict-arg " << mk_pp(t, m) << " " << i << "\n";);
|
||||
TRACE(q, tout << "restrict-arg " << mk_pp(t, m) << " " << i << "\n";);
|
||||
auto const* md = get_projection_data(t->get_decl(), i);
|
||||
if (!md)
|
||||
return expr_ref(m.mk_true(), m);
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace q {
|
|||
}
|
||||
|
||||
void queue::setup() {
|
||||
TRACE("q", tout << "qi_cost: " << m_params.m_qi_cost << "\n";);
|
||||
TRACE(q, tout << "qi_cost: " << m_params.m_qi_cost << "\n";);
|
||||
if (!m_parser.parse_string(m_params.m_qi_cost.c_str(), m_cost_function)) {
|
||||
warning_msg("invalid cost function '%s', switching to default one", m_params.m_qi_cost.c_str());
|
||||
VERIFY(m_parser.parse_string("(+ weight generation)", m_cost_function));
|
||||
|
@ -105,7 +105,7 @@ namespace q {
|
|||
m_vals[SCOPE] = static_cast<float>(ctx.s().num_scopes());
|
||||
m_vals[NESTED_QUANTIFIERS] = static_cast<float>(stat->get_num_nested_quantifiers());
|
||||
m_vals[CS_FACTOR] = static_cast<float>(stat->get_case_split_factor());
|
||||
TRACE("q_detail", for (unsigned i = 0; i < m_vals.size(); i++) { tout << m_vals[i] << " "; } tout << "\n";);
|
||||
TRACE(q_detail, for (unsigned i = 0; i < m_vals.size(); i++) { tout << m_vals[i] << " "; } tout << "\n";);
|
||||
}
|
||||
|
||||
float queue::get_cost(binding& f) {
|
||||
|
@ -196,11 +196,11 @@ namespace q {
|
|||
instantiate(curr);
|
||||
else if (m_params.m_qi_promote_unsat && l_false == em.evaluate(f.nodes(), *f.c)) {
|
||||
// do not delay instances that produce a conflict.
|
||||
TRACE("q", tout << "promoting instance that produces a conflict\n" << mk_pp(f.q(), m) << "\n";);
|
||||
TRACE(q, tout << "promoting instance that produces a conflict\n" << mk_pp(f.q(), m) << "\n";);
|
||||
instantiate(curr);
|
||||
}
|
||||
else {
|
||||
TRACE("q", tout << "delaying quantifier instantiation... " << f << "\n" << mk_pp(f.q(), m) << "\ncost: " << curr.m_cost << "\n";);
|
||||
TRACE(q, tout << "delaying quantifier instantiation... " << f << "\n" << mk_pp(f.q(), m) << "\ncost: " << curr.m_cost << "\n";);
|
||||
m_delayed_entries.push_back(curr);
|
||||
ctx.push(push_back_vector<svector<entry>>(m_delayed_entries));
|
||||
}
|
||||
|
@ -227,7 +227,7 @@ namespace q {
|
|||
bool init = false;
|
||||
cost_limit = 0.0;
|
||||
for (entry & e : m_delayed_entries) {
|
||||
TRACE("q", tout << e.m_qb << ", cost: " << e.m_cost << ", instantiated: " << e.m_instantiated << "\n";);
|
||||
TRACE(q, tout << e.m_qb << ", cost: " << e.m_cost << ", instantiated: " << e.m_instantiated << "\n";);
|
||||
if (!e.m_instantiated && e.m_cost <= m_params.m_qi_lazy_threshold && (!init || e.m_cost < cost_limit)) {
|
||||
init = true;
|
||||
cost_limit = e.m_cost;
|
||||
|
|
|
@ -357,7 +357,7 @@ namespace q {
|
|||
}
|
||||
|
||||
void solver::log_instantiation(unsigned n, sat::literal const* lits, justification* j) {
|
||||
TRACE("q", for (unsigned i = 0; i < n; ++i) tout << literal2expr(lits[i]) << "\n";);
|
||||
TRACE(q, for (unsigned i = 0; i < n; ++i) tout << literal2expr(lits[i]) << "\n";);
|
||||
if (get_config().m_instantiations2console) {
|
||||
ctx.on_instantiation(n, lits, j ? j->m_clause.num_decls() : 0, j ? j->m_binding : nullptr);
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ Author:
|
|||
#include "sat/smt/euf_solver.h"
|
||||
|
||||
|
||||
#define TRACEFN(x) TRACE("recfun", tout << x << '\n';)
|
||||
#define TRACEFN(x) TRACE(recfun, tout << x << '\n';)
|
||||
|
||||
|
||||
namespace recfun {
|
||||
|
@ -236,7 +236,7 @@ namespace recfun {
|
|||
force_push();
|
||||
SASSERT(m.is_bool(e));
|
||||
if (!visit_rec(m, e, sign, root)) {
|
||||
TRACE("array", tout << mk_pp(e, m) << "\n";);
|
||||
TRACE(array, tout << mk_pp(e, m) << "\n";);
|
||||
return sat::null_literal;
|
||||
}
|
||||
auto lit = expr2literal(e);
|
||||
|
|
|
@ -198,7 +198,7 @@ namespace euf {
|
|||
virtual void push_core();
|
||||
virtual void pop_core(unsigned n);
|
||||
void force_push() {
|
||||
CTRACE("euf_verbose", m_num_scopes > 0, tout << "push-core " << m_num_scopes << "\n";);
|
||||
CTRACE(euf_verbose, m_num_scopes > 0, tout << "push-core " << m_num_scopes << "\n";);
|
||||
for (; m_num_scopes > 0; --m_num_scopes) push_core();
|
||||
}
|
||||
|
||||
|
|
|
@ -52,11 +52,11 @@ namespace specrel {
|
|||
}
|
||||
|
||||
void solver::new_eq_eh(euf::th_eq const& eq) {
|
||||
TRACE("specrel", tout << "new-eq\n");
|
||||
TRACE(specrel, tout << "new-eq\n");
|
||||
if (eq.is_eq()) {
|
||||
auto* p = ctx.get_egraph().get_plugin(sp.get_family_id());
|
||||
p->merge_eh(var2enode(eq.v1()), var2enode(eq.v2()));
|
||||
TRACE("specrel", tout << eq.v1() << " " << eq.v2() << "\n");
|
||||
TRACE(specrel, tout << eq.v1() << " " << eq.v2() << "\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -103,7 +103,7 @@ namespace specrel {
|
|||
n = mk_enode(term);
|
||||
SASSERT(!n->is_attached_to(get_id()));
|
||||
mk_var(n);
|
||||
TRACE("specrel", tout << ctx.bpp(n) << "\n");
|
||||
TRACE(specrel, tout << ctx.bpp(n) << "\n");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -325,7 +325,7 @@ namespace user_solver {
|
|||
|
||||
sat::literal solver::internalize(expr* e, bool sign, bool root) {
|
||||
if (!visit_rec(m, e, sign, root)) {
|
||||
TRACE("array", tout << mk_pp(e, m) << "\n";);
|
||||
TRACE(array, tout << mk_pp(e, m) << "\n";);
|
||||
return sat::null_literal;
|
||||
}
|
||||
sat::literal lit = ctx.expr2literal(e);
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace sat {
|
|||
lbool ba_solver::add_assign(xr& x, literal alit) {
|
||||
// literal is assigned
|
||||
unsigned sz = x.size();
|
||||
TRACE("ba", tout << "assign: " << ~alit << "@" << lvl(~alit) << " " << x << "\n"; display(tout, x, true); );
|
||||
TRACE(ba, tout << "assign: " << ~alit << "@" << lvl(~alit) << " " << x << "\n"; display(tout, x, true); );
|
||||
|
||||
VERIFY(x.lit() == null_literal);
|
||||
SASSERT(value(alit) != l_undef);
|
||||
|
@ -47,7 +47,7 @@ namespace sat {
|
|||
// alit gets unwatched by propagate_core because we return l_undef
|
||||
x.watch_literal(*this, lit);
|
||||
x.watch_literal(*this, ~lit);
|
||||
TRACE("ba", tout << "swap in: " << lit << " " << x << "\n";);
|
||||
TRACE(ba, tout << "swap in: " << lit << " " << x << "\n";);
|
||||
return l_undef;
|
||||
}
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ namespace sat {
|
|||
unsigned level = lvl(l);
|
||||
bool_var v = l.var();
|
||||
SASSERT(js.get_kind() == justification::EXT_JUSTIFICATION);
|
||||
TRACE("ba", tout << l << ": " << js << "\n";
|
||||
TRACE(ba, tout << l << ": " << js << "\n";
|
||||
for (unsigned i = 0; i <= index; ++i) tout << s().m_trail[i] << " "; tout << "\n";
|
||||
s().display_units(tout);
|
||||
);
|
||||
|
@ -196,10 +196,10 @@ namespace sat {
|
|||
|
||||
unsigned num_marks = 0;
|
||||
while (true) {
|
||||
TRACE("ba", tout << "process: " << l << " " << js << "\n";);
|
||||
TRACE(ba, tout << "process: " << l << " " << js << "\n";);
|
||||
if (js.get_kind() == justification::EXT_JUSTIFICATION) {
|
||||
constraint& c = index2constraint(js.get_ext_justification_idx());
|
||||
TRACE("ba", tout << c << "\n";);
|
||||
TRACE(ba, tout << c << "\n";);
|
||||
if (!c.is_xr()) {
|
||||
r.push_back(l);
|
||||
}
|
||||
|
@ -213,7 +213,7 @@ namespace sat {
|
|||
literal lit(value(x[i]) == l_true ? x[i] : ~x[i]);
|
||||
inc_parity(lit.var());
|
||||
if (lvl(lit) == level) {
|
||||
TRACE("ba", tout << "mark: " << lit << "\n";);
|
||||
TRACE(ba, tout << "mark: " << lit << "\n";);
|
||||
++num_marks;
|
||||
}
|
||||
else {
|
||||
|
@ -259,7 +259,7 @@ namespace sat {
|
|||
reset_parity(lit.var());
|
||||
}
|
||||
m_parity_trail.reset();
|
||||
TRACE("ba", tout << r << "\n";);
|
||||
TRACE(ba, tout << r << "\n";);
|
||||
}
|
||||
|
||||
void ba_solver::pre_simplify() {
|
||||
|
@ -290,7 +290,7 @@ namespace sat {
|
|||
|
||||
void ba_solver::get_antecedents(literal l, xr const& x, literal_vector& r) {
|
||||
if (x.lit() != null_literal) r.push_back(x.lit());
|
||||
// TRACE("ba", display(tout << l << " ", x, true););
|
||||
// TRACE(ba, display(tout << l << " ", x, true););
|
||||
SASSERT(x.lit() == null_literal || value(x.lit()) == l_true);
|
||||
SASSERT(x[0].var() == l.var() || x[1].var() == l.var());
|
||||
if (x[0].var() == l.var()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue