3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-10-31 03:32:28 +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:
LeeYoungJoon 2025-05-28 22:31:25 +09:00 committed by GitHub
parent d766292dab
commit 0a93ff515d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
583 changed files with 8698 additions and 7299 deletions

View file

@ -34,13 +34,13 @@ bvsls_opt_engine::optimization_result bvsls_opt_engine::optimize(
bool _maximize)
{
SASSERT(m_bv_util.is_bv(objective));
TRACE("sls_opt", tout << "objective: " << (_maximize?"maximize":"minimize") << " " <<
TRACE(sls_opt, tout << "objective: " << (_maximize?"maximize":"minimize") << " " <<
mk_ismt2_pp(objective, m()) << std::endl;);
m_hard_tracker.initialize(m_assertions);
setup_opt_tracker(objective, _maximize);
if (initial_model.get() != nullptr) {
TRACE("sls_opt", tout << "Initial model provided: " << std::endl;
TRACE(sls_opt, tout << "Initial model provided: " << std::endl;
for (unsigned i = 0; i < initial_model->get_num_constants(); i++) {
func_decl * fd = initial_model->get_constant(i);
expr * val = initial_model->get_const_interp(fd);
@ -53,7 +53,7 @@ bvsls_opt_engine::optimization_result bvsls_opt_engine::optimize(
optimization_result res(m_manager);
lbool is_sat = m_hard_tracker.is_sat() ? l_true : l_undef;
TRACE("sls_opt", tout << "initial model is sat? " << is_sat << std::endl;);
TRACE(sls_opt, tout << "initial model is sat? " << is_sat << std::endl;);
for (m_stats.m_restarts = 0;
m_stats.m_restarts < m_max_restarts;
@ -95,7 +95,7 @@ bvsls_opt_engine::optimization_result bvsls_opt_engine::optimize(
is_sat = m_hard_tracker.is_sat() ? l_true : l_undef;
}
TRACE("sls_opt", tout << "sat: " << res.is_sat << "; optimum: " << mk_ismt2_pp(res.optimum, m()) << std::endl;);
TRACE(sls_opt, tout << "sat: " << res.is_sat << "; optimum: " << mk_ismt2_pp(res.optimum, m()) << std::endl;);
return res;
}
@ -118,7 +118,7 @@ expr_ref bvsls_opt_engine::maximize()
{
SASSERT(m_hard_tracker.is_sat());
TRACE("sls_opt", tout << "Initial opt model:" << std::endl; m_obj_tracker.show_model(tout););
TRACE(sls_opt, tout << "Initial opt model:" << std::endl; m_obj_tracker.show_model(tout););
mpz score, old_score, max_score, new_value;
unsigned new_const = (unsigned)-1, new_bit = 0;
@ -149,7 +149,7 @@ expr_ref bvsls_opt_engine::maximize()
save_model(score);
if (!randomize_wrt_hard()) {
// Can't improve and can't randomize; can't do anything other than bail out.
TRACE("sls_opt", tout << "Got stuck; bailing out." << std::endl;);
TRACE(sls_opt, tout << "Got stuck; bailing out." << std::endl;);
IF_VERBOSE(10, verbose_stream() << "No local improvements possible." << std::endl;);
goto bailout;
}
@ -157,7 +157,7 @@ expr_ref bvsls_opt_engine::maximize()
}
else {
m_stats.m_moves++;
TRACE("sls_opt", tout << "New optimum: " << m_mpz_manager.to_string(score) << std::endl;);
TRACE(sls_opt, tout << "New optimum: " << m_mpz_manager.to_string(score) << std::endl;);
IF_VERBOSE(10, verbose_stream() << "New optimum: " << m_mpz_manager.to_string(score) << std::endl;);
func_decl * fd = consts[new_const];
incremental_score(fd, new_value);
@ -183,7 +183,7 @@ void bvsls_opt_engine::save_model(mpz const & score) {
expr * val = obj_mdl->get_const_interp(fd);
if (mdl->has_interpretation(fd)) {
if (mdl->get_const_interp(fd) != val)
TRACE("sls_opt", tout << "model disagreement on " << fd->get_name() << ": " <<
TRACE(sls_opt, tout << "model disagreement on " << fd->get_name() << ": " <<
mk_ismt2_pp(val, m()) << " != " << mk_ismt2_pp(mdl->get_const_interp(fd), m()) << std::endl;);
SASSERT(mdl->get_const_interp(fd) == val);
}
@ -215,7 +215,7 @@ bool bvsls_opt_engine::what_if(
mpz cur_best(0);
m_mpz_manager.set(cur_best, top_score());
TRACE("sls_whatif", tout << "WHAT IF " << fd->get_name() << " WERE " << m_mpz_manager.to_string(temp) <<
TRACE(sls_whatif, tout << "WHAT IF " << fd->get_name() << " WERE " << m_mpz_manager.to_string(temp) <<
" --> " << r << "; score=" << m_mpz_manager.to_string(cur_best) << std::endl;);
if (m_mpz_manager.gt(cur_best, best_score)) {
@ -227,7 +227,7 @@ bool bvsls_opt_engine::what_if(
}
else
{
TRACE("sls_whatif_failed", tout << "WHAT IF " << fd->get_name() << " WERE " << m_mpz_manager.to_string(temp) <<
TRACE(sls_whatif_failed, tout << "WHAT IF " << fd->get_name() << " WERE " << m_mpz_manager.to_string(temp) <<
" --> unsatisfied hard constraints" << std::endl;);
}
@ -351,7 +351,7 @@ bool bvsls_opt_engine::randomize_wrt_hard() {
m_evaluator.update(random_fd, random_val);
if (m_hard_tracker.is_sat()) {
TRACE("sls_opt", tout << "Randomizing " << random_fd->get_name() << " to " <<
TRACE(sls_opt, tout << "Randomizing " << random_fd->get_name() << " to " <<
m_mpz_manager.to_string(random_val) << std::endl;);
m_obj_evaluator.update(random_fd, random_val);
return true;

View file

@ -378,7 +378,7 @@ namespace sls {
template<typename num_t>
void arith_base<num_t>::find_linear_moves(ineq const& ineq, var_t v, num_t const& coeff) {
num_t const& sum = ineq.m_args_value;
TRACE("arith_verbose", tout << ineq << " " << v << " " << value(v) << "\n");
TRACE(arith_verbose, tout << ineq << " " << v << " " << value(v) << "\n");
if (ineq.is_true()) {
switch (ineq.m_op) {
case ineq_kind::LE:
@ -433,12 +433,12 @@ namespace sls {
delta_out = delta;
if (m_last_var == v && m_last_delta == -delta) {
TRACE("arith_verbose", tout << "flip back " << v << " " << delta << "\n";);
TRACE(arith_verbose, tout << "flip back " << v << " " << delta << "\n";);
return false;
}
if (m_use_tabu && vi.is_tabu(m_stats.m_steps, delta)) {
TRACE("arith_verbose", tout << "tabu v" << v << " delta:" << delta << "\n");
TRACE(arith_verbose, tout << "tabu v" << v << " delta:" << delta << "\n");
return false;
}
@ -446,7 +446,7 @@ namespace sls {
auto old_value = value(v);
auto new_value = old_value + delta;
if (!vi.in_range(new_value)) {
TRACE("arith", display(tout, v) << "out of range: v" << v << " " << old_value << " " << delta << " " << new_value << "\n";);
TRACE(arith, display(tout, v) << "out of range: v" << v << " " << old_value << " " << delta << " " << new_value << "\n";);
return false;
}
@ -747,11 +747,11 @@ namespace sls {
if (old_value == new_value)
return true;
if (!vi.in_range(new_value)) {
TRACE("arith", display(tout << "out of range " << new_value << ": ", v) << "\n"; );
TRACE(arith, display(tout << "out of range " << new_value << ": ", v) << "\n"; );
return false;
}
if (!in_bounds(v, new_value) && in_bounds(v, old_value)) {
TRACE("arith", tout << "out of bounds: v" << v << " " << old_value << " " << new_value << "\n";);
TRACE(arith, tout << "out of bounds: v" << v << " " << old_value << " " << new_value << "\n";);
return false;
}
@ -781,7 +781,7 @@ namespace sls {
}
IF_VERBOSE(5, verbose_stream() << "repair: v" << v << " := " << old_value << " -> " << new_value << "\n");
TRACE("arith", tout << "update: v" << v << " " << mk_bounded_pp(vi.m_expr, m) << " := " << old_value << " -> " << new_value << "\n");
TRACE(arith, tout << "update: v" << v << " " << mk_bounded_pp(vi.m_expr, m) << " := " << old_value << " -> " << new_value << "\n");
vi.set_value(new_value);
ctx.new_value_eh(e);
m_last_var = v;
@ -1061,7 +1061,7 @@ namespace sls {
m_vars[v].m_op = k;
m_vars[v].set_value(val);
m_vars[vx].m_ops.push_back(v);
TRACE("arith", display(tout << "initialize op ", v) << " " << value(vx) << " op " << value(vy) << "\n");
TRACE(arith, display(tout << "initialize op ", v) << " " << value(vx) << " op " << value(vy) << "\n");
if (vy != vx)
m_vars[vy].m_ops.push_back(v);
return v;
@ -1372,7 +1372,7 @@ namespace sls {
if (!vi.is_arith_op())
return false;
flet<bool> _tabu(m_use_tabu, false);
TRACE("sls_verbose", tout << "repair def " << mk_bounded_pp(vi.m_expr, m) << "\n");
TRACE(sls_verbose, tout << "repair def " << mk_bounded_pp(vi.m_expr, m) << "\n");
switch (vi.m_op) {
case arith_op_kind::LAST_ARITH_OP:
break;
@ -2304,7 +2304,7 @@ namespace sls {
bool r = update_checked(w, n);
if (!r) {
TRACE("arith", tout << "set value failed " << mk_pp(e, m) << " := " << mk_pp(v, m) << "\n";
TRACE(arith, tout << "set value failed " << mk_pp(e, m) << " := " << mk_pp(v, m) << "\n";
display(tout, w) << " := " << value(w) << "\n";);
IF_VERBOSE(3,
verbose_stream() << "set value failed " << mk_pp(e, m) << " := " << mk_pp(v, m) << "\n";
@ -2523,7 +2523,7 @@ namespace sls {
if (!vi.is_arith_op())
return true;
IF_VERBOSE(10, verbose_stream() << vi.m_op << " repair def " << mk_bounded_pp(vi.m_expr, m) << "\n");
TRACE("sls_verbose", tout << "repair def " << mk_bounded_pp(vi.m_expr, m) << "\n");
TRACE(sls_verbose, tout << "repair def " << mk_bounded_pp(vi.m_expr, m) << "\n");
switch (vi.m_op) {
case arith_op_kind::LAST_ARITH_OP:
break;
@ -2623,7 +2623,7 @@ namespace sls {
for (var_t v = 0; v < m_vars.size(); ++v) {
if (!eval_is_correct(v)) {
report_error(verbose_stream(), v);
TRACE("arith", report_error(tout, v));
TRACE(arith, report_error(tout, v));
UNREACHABLE();
}
}
@ -2636,7 +2636,7 @@ namespace sls {
val += c * value(v);
if (val != i.m_args_value) {
IF_VERBOSE(0, verbose_stream() << val << ": " << i << "\n"; display(verbose_stream()));
TRACE("arith", display(tout << val << ": " << i << "\n"));
TRACE(arith, display(tout << val << ": " << i << "\n"));
}
SASSERT(val == i.m_args_value);
VERIFY(val == i.m_args_value);
@ -2679,11 +2679,11 @@ namespace sls {
if (old_value == new_value)
return true;
if (!vi.in_range(new_value)) {
TRACE("arith_verbose", tout << "Not in range v" << v << " " << new_value << "\n");
TRACE(arith_verbose, tout << "Not in range v" << v << " " << new_value << "\n");
return false;
}
if (!in_bounds(v, new_value) && in_bounds(v, old_value)) {
TRACE("arith_verbose", tout << "out of bounds v" << v << " " << new_value << "\n");
TRACE(arith_verbose, tout << "out of bounds v" << v << " " << new_value << "\n");
//verbose_stream() << "out of bounds v" << v << " " << new_value << "\n";
return false;
}
@ -2708,7 +2708,7 @@ namespace sls {
auto& vi = m_vars[v];
auto old_value = value(v);
IF_VERBOSE(5, verbose_stream() << "update: v" << v << " " << mk_bounded_pp(vi.m_expr, m) << " := " << old_value << " -> " << new_value << "\n");
TRACE("arith", tout << "update: v" << v << " " << mk_bounded_pp(vi.m_expr, m) << " := " << old_value << " -> " << new_value << "\n");
TRACE(arith, tout << "update: v" << v << " " << mk_bounded_pp(vi.m_expr, m) << " := " << old_value << " -> " << new_value << "\n");
vi.set_value(new_value);
ctx.new_value_eh(vi.m_expr);

View file

@ -39,7 +39,7 @@ namespace sls {
initialize();
TRACE("arith", ctx.display_all(tout));
TRACE(arith, ctx.display_all(tout));
a.m_config.max_moves = a.m_stats.m_steps + a.m_config.max_moves_base;
@ -72,7 +72,7 @@ namespace sls {
(void)bv;
(void)v;
TRACE("arith",
TRACE(arith,
if (bv != sat::null_bool_var) tout << "bool flip " << bv << "\n";
else if (v != null_arith_var) tout << "arith flip v" << v << "\n";
else tout << "no flip\n";
@ -124,7 +124,7 @@ namespace sls {
template<typename num_t>
void arith_clausal<num_t>::add_lookahead_on_unsat_vars() {
a.m_updates.reset();
TRACE("arith_verbose", tout << "unsat-vars ";
TRACE(arith_verbose, tout << "unsat-vars ";
for (auto v : ctx.unsat_vars())
if (a.get_ineq(v)) tout << mk_bounded_pp(ctx.atom(v), a.m) << " ";
tout << "\n";);
@ -267,7 +267,7 @@ namespace sls {
return;
a.m_last_delta = delta;
a.m_last_var = v;
TRACE("arith", tout << mt << " v" << v << " " << mk_bounded_pp(a.m_vars[v].m_expr, a.m)
TRACE(arith, tout << mt << " v" << v << " " << mk_bounded_pp(a.m_vars[v].m_expr, a.m)
<< " += " << delta << " score:" << m_best_score << "\n");
a.m_vars[v].set_step(a.m_stats.m_steps, a.m_stats.m_steps + 3 + ctx.rand(10), delta);
VERIFY(a.update_num(v, delta));
@ -278,7 +278,7 @@ namespace sls {
DEBUG_CODE(
for (sat::bool_var bv = 0; bv < ctx.num_bool_vars(); ++bv) {
if (a.get_ineq(bv) && a.get_ineq(bv)->is_true() != ctx.is_true(bv)) {
TRACE("arith", tout << "bv:" << bv << " " << *a.get_ineq(bv) << " " << (ctx.is_true(bv)?"T":"F") << "\n";
TRACE(arith, tout << "bv:" << bv << " " << *a.get_ineq(bv) << " " << (ctx.is_true(bv)?"T":"F") << "\n";
tout << "v" << v << " bool vars: " << a.m_vars[v].m_bool_vars_of << "\n";
tout << mk_bounded_pp(a.m_vars[v].m_expr, a.m) << "\n";
tout << mk_bounded_pp(ctx.atom(bv), a.m) << "\n";
@ -291,7 +291,7 @@ namespace sls {
template<typename num_t>
double arith_clausal<num_t>::get_score(var_t v, num_t const& delta) {
auto& vi = a.m_vars[v];
TRACE("arith", tout << "get-score v" << v << " += " << delta << "\n";);
TRACE(arith, tout << "get-score v" << v << " += " << delta << "\n";);
if (!a.update_num(v, delta))
return -1;
double score = 0;
@ -309,7 +309,7 @@ namespace sls {
++num_true;
}
CTRACE("arith_verbose", c.m_num_trues != num_true && (c.m_num_trues == 0 || num_true == 0),
CTRACE(arith_verbose, c.m_num_trues != num_true && (c.m_num_trues == 0 || num_true == 0),
tout << "clause: " << c
<< " v" << v << " += " << delta
<< " new-true lits: " << num_true
@ -326,7 +326,7 @@ namespace sls {
// verbose_stream() << num_clauses << " " << num_dup << "\n";
// revert the update
TRACE("arith", tout << "revert update v" << v << " -= " << delta << "\n";);
TRACE(arith, tout << "revert update v" << v << " -= " << delta << "\n";);
a.update_unchecked(v, vi.value() - delta);
return score;
}
@ -348,7 +348,7 @@ namespace sls {
#endif
IF_VERBOSE(2, verbose_stream() << "restart sls-arith " << a.m_config.restart_next << "\n");
TRACE("arith", tout << "restart\n";);
TRACE(arith, tout << "restart\n";);
// reset values of (arithmetical) variables at bounds.
for (auto& vi : a.m_vars) {
if (vi.m_lo && !vi.m_lo->is_strict && vi.m_lo->value > 0)
@ -369,7 +369,7 @@ namespace sls {
DEBUG_CODE(
for (sat::bool_var bv = 0; bv < ctx.num_bool_vars(); ++bv) {
if (a.get_ineq(bv) && a.get_ineq(bv)->is_true() != ctx.is_true(bv)) {
TRACE("arith", tout << "bv:" << bv << " " << *a.get_ineq(bv) << ctx.is_true(bv) << "\n";
TRACE(arith, tout << "bv:" << bv << " " << *a.get_ineq(bv) << ctx.is_true(bv) << "\n";
tout << mk_bounded_pp(ctx.atom(bv), a.m) << "\n";
ctx.display(tout););
}
@ -403,7 +403,7 @@ namespace sls {
template<typename num_t>
void arith_clausal<num_t>::enter_bool_mode() {
CTRACE("arith", !m_bool_mode, tout << "enter bool mode\n";);
CTRACE(arith, !m_bool_mode, tout << "enter bool mode\n";);
m_best_found_cost_bool = ctx.unsat().size();
if (!m_bool_mode)
m_no_improve_bool = 0;
@ -420,7 +420,7 @@ namespace sls {
template<typename num_t>
void arith_clausal<num_t>::enter_arith_mode() {
CTRACE("arith", m_bool_mode, tout << "enter arith mode\n";);
CTRACE(arith, m_bool_mode, tout << "enter arith mode\n";);
m_best_found_cost_arith = ctx.unsat().size();
if (m_bool_mode)
m_no_improve_arith = 0;

View file

@ -259,7 +259,7 @@ namespace sls {
for (unsigned depth = m_min_depth; depth <= m_max_depth; ++depth) {
for (unsigned i = 0; i < m_update_stack[depth].size(); ++i) {
auto* a = m_update_stack[depth][i];
TRACE("arith_verbose", tout << "update " << mk_bounded_pp(a, m) << " depth: " << depth << "\n";);
TRACE(arith_verbose, tout << "update " << mk_bounded_pp(a, m) << " depth: " << depth << "\n";);
if (t != a)
set_bool_value(a, get_bool_value_rec(a));
if (m_is_root.is_marked(a)) {
@ -311,7 +311,7 @@ namespace sls {
if (!a.update_num(v, delta))
return;
auto score = lookahead(e, false);
TRACE("arith_verbose", tout << "lookahead " << v << " " << mk_bounded_pp(e, m) << " := " << delta + old_value << " " << score << " (" << m_best_score << ")\n";);
TRACE(arith_verbose, tout << "lookahead " << v << " " << mk_bounded_pp(e, m) << " := " << delta + old_value << " " << score << " (" << m_best_score << ")\n";);
if (score > m_best_score) {
m_tabu_set = 0;
m_best_score = score;
@ -565,7 +565,7 @@ namespace sls {
else {
var_t v = a.mk_term(m_best_expr);
if (!a.update_num(v, m_best_value - a.value(v))) {
TRACE("arith",
TRACE(arith,
tout << "could not move v" << v << " " << t << " " << mk_bounded_pp(m_best_expr, m) << " := " << a.value(v) << " " << m_top_score << "\n";
);
return false;
@ -576,8 +576,8 @@ namespace sls {
clear_update_stack();
}
CTRACE("arith", !m_best_expr, tout << "no move " << t << "\n";);
CTRACE("arith", m_best_expr && autil.is_int_real(m_best_expr), {
CTRACE(arith, !m_best_expr, tout << "no move " << t << "\n";);
CTRACE(arith, m_best_expr && autil.is_int_real(m_best_expr), {
var_t v = a.mk_term(m_best_expr);
tout << t << " v" << v << " " << mk_bounded_pp(m_best_expr, m) << " := " << a.value(v) << " " << m_top_score << "\n";
});
@ -677,9 +677,9 @@ namespace sls {
initialize_bool_assignment();
rescore();
a.m_config.max_moves = a.m_stats.m_steps + a.m_config.max_moves_base;
TRACE("arith", tout << "search " << a.m_stats.m_steps << " " << a.m_config.max_moves << "\n";);
TRACE(arith, tout << "search " << a.m_stats.m_steps << " " << a.m_config.max_moves << "\n";);
IF_VERBOSE(3, verbose_stream() << "lookahead-search steps:" << a.m_stats.m_steps << " max-moves:" << a.m_config.max_moves << "\n");
TRACE("arith", a.display(tout));
TRACE(arith, a.display(tout));
while (ctx.rlimit().inc() && a.m_stats.m_steps < a.m_config.max_moves) {
a.m_stats.m_steps++;
@ -741,8 +741,8 @@ namespace sls {
}
m_last_atom = e;
CTRACE("arith", !e, tout << "no unsatisfiable candidate\n";);
CTRACE("arith", e,
CTRACE(arith, !e, tout << "no unsatisfiable candidate\n";);
CTRACE(arith, e,
tout << "select " << mk_bounded_pp(e, m) << " ";
for (auto v : get_fixable_exprs(e))
tout << mk_bounded_pp(v, m) << " ";

View file

@ -84,7 +84,7 @@ bool sls_engine::full_eval(model & mdl) {
if (!m_manager.inc())
return false;
if (!mdl.is_true(a)) {
TRACE("sls", tout << "Evaluation: false\n";);
TRACE(sls, tout << "Evaluation: false\n";);
return false;
}
}
@ -96,7 +96,7 @@ double sls_engine::top_score() {
for (expr* e : m_assertions) {
top_sum += m_tracker.get_score(e);
}
TRACE("sls_top", tout << "Score distribution:";
TRACE(sls_top, tout << "Score distribution:";
for (expr* e : m_assertions)
tout << " " << m_tracker.get_score(e);
tout << " AVG: " << top_sum / (double)m_assertions.size() << std::endl;);
@ -152,7 +152,7 @@ bool sls_engine::what_if(
else
r = incremental_score(fd, temp);
#ifdef Z3DEBUG
TRACE("sls_whatif", tout << "WHAT IF " << fd->get_name() << " WERE " << m_mpz_manager.to_string(temp) <<
TRACE(sls_whatif, tout << "WHAT IF " << fd->get_name() << " WERE " << m_mpz_manager.to_string(temp) <<
" --> " << r << std::endl;);
m_mpz_manager.del(old_value);
@ -268,7 +268,7 @@ void sls_engine::mk_random_move(ptr_vector<func_decl> & unsat_constants)
NOT_IMPLEMENTED_YET();
}
TRACE("sls", tout << "Randomization candidates: ";
TRACE(sls, tout << "Randomization candidates: ";
for (unsigned i = 0; i < unsat_constants.size(); i++)
tout << unsat_constants[i]->get_name() << ", ";
tout << std::endl;

View file

@ -204,7 +204,7 @@ namespace sls {
auto old_val = m_tmp_bool_values.get(id, l_undef);
m_tmp_bool_values.setx(id, to_lbool(val), l_undef);
m_tmp_bool_value_updates.push_back({ id, old_val });
//TRACE("bv", tout << mk_bounded_pp(e, m) << " := " << val << " old: " << old_val << "\n");
//TRACE(bv, tout << mk_bounded_pp(e, m) << " := " << val << " old: " << old_val << "\n");
}
void bv_eval::set_bool_value_no_log(expr* e, bool val) {
@ -216,7 +216,7 @@ namespace sls {
SASSERT(m.is_bool(e));
auto id = e->get_id();
auto val = m_tmp_bool_values.get(id, l_undef);
//TRACE("bv", tout << mk_bounded_pp(e, m) << " == " << val << "\n");
//TRACE(bv, tout << mk_bounded_pp(e, m) << " == " << val << "\n");
if (val != l_undef)
return val == l_true;
bool b;
@ -227,12 +227,12 @@ namespace sls {
b = bval1(e);
m_tmp_bool_values.setx(id, to_lbool(b), l_undef);
m_tmp_bool_value_updates.push_back({ id, l_undef });
//TRACE("bv", tout << mk_bounded_pp(e, m) << " := " << b << " old: " << val << "\n");
//TRACE(bv, tout << mk_bounded_pp(e, m) << " := " << b << " old: " << val << "\n");
return b;
}
void bv_eval::restore_bool_values(unsigned r) {
//TRACE("bv", tout << "restore " << m_tmp_bool_value_updates.size() - r << "\n";);
//TRACE(bv, tout << "restore " << m_tmp_bool_value_updates.size() - r << "\n";);
for (auto i = m_tmp_bool_value_updates.size(); i-- > r; ) {
auto& [id, val] = m_tmp_bool_value_updates[i];
m_tmp_bool_values.set(id, val);

View file

@ -494,7 +494,7 @@ public:
NOT_IMPLEMENTED_YET();
}
TRACE("sls_eval", tout << "(" << fd->get_name();
TRACE(sls_eval, tout << "(" << fd->get_name();
for (unsigned i = 0; i < n_args; i++)
tout << " " << m_mpz_manager.to_string(m_tracker.get_value(args[i]));
tout << ") ---> " << m_mpz_manager.to_string(result);
@ -525,7 +525,7 @@ public:
evaluator(q, temp);
mpz check_res;
m_tracker.value2mpz(temp, check_res);
CTRACE("sls", !m_mpz_manager.eq(check_res, result),
CTRACE(sls, !m_mpz_manager.eq(check_res, result),
tout << "EVAL BUG: IS " << m_mpz_manager.to_string(result) <<
" SHOULD BE " << m_mpz_manager.to_string(check_res) << std::endl; );
SASSERT(m_mpz_manager.eq(check_res, result));
@ -654,7 +654,7 @@ public:
}
void serious_update(func_decl * fd, const mpz & new_value) {
TRACE("sls", tout << "set: " << fd->get_name() << " to " << m_mpz_manager.to_string(new_value) << std::endl;);
TRACE(sls, tout << "set: " << fd->get_name() << " to " << m_mpz_manager.to_string(new_value) << std::endl;);
m_tracker.set_value(fd, new_value);
expr * ep = m_tracker.get_entry_point(fd);
unsigned cur_depth = m_tracker.get_distance(ep);
@ -808,7 +808,7 @@ public:
m_mpz_manager.del(temp);
TRACE("sls", tout << "Randomization candidate: " << unsat_constants[r]->get_name() << std::endl;
TRACE(sls, tout << "Randomization candidate: " << unsat_constants[r]->get_name() << std::endl;
tout << "Locally randomized model: " << std::endl;
m_tracker.show_model(tout); );

View file

@ -58,7 +58,7 @@ namespace sls {
initialize_bool_values();
rescore();
m_config.max_moves = m_stats.m_moves + m_config.max_moves_base;
TRACE("bv", tout << "search " << m_stats.m_moves << " " << m_config.max_moves << "\n";);
TRACE(bv, tout << "search " << m_stats.m_moves << " " << m_config.max_moves << "\n";);
IF_VERBOSE(1, verbose_stream() << "lookahead-search moves:" << m_stats.m_moves << " max-moves:" << m_config.max_moves << "\n");
while (ctx.rlimit().inc() && m_stats.m_moves < m_config.max_moves) {
@ -129,7 +129,7 @@ namespace sls {
unsigned start = ctx.rand();
for (unsigned i = 0; i < sz; ++i)
add_updates(vars[(start + i) % sz]);
CTRACE("bv", !m_best_expr, tout << "no guided move\n";);
CTRACE(bv, !m_best_expr, tout << "no guided move\n";);
return apply_update(m_last_atom, m_best_expr, m_best_value, move_type::guided_t);
}
@ -162,7 +162,7 @@ namespace sls {
if (vars.empty())
return false;
expr* e = vars[ctx.rand(vars.size())];
TRACE("bv", tout << "random move " << mk_bounded_pp(e, m) << "\n";);
TRACE(bv, tout << "random move " << mk_bounded_pp(e, m) << "\n";);
if (m.is_bool(e)) {
if (is_root(e))
return false;
@ -198,7 +198,7 @@ namespace sls {
expr* e = nullptr;
if (m_config.ucb) {
double max = -1.0;
TRACE("bv", tout << "select\n");
TRACE(bv, tout << "select\n");
for (auto a : get_root_assertions()) {
auto const& vars = m_ev.terms.uninterp_occurs(a);
//verbose_stream() << mk_bounded_pp(a, m) << " " << assertion_is_true(a) << " num vars " << vars.size() << "\n";
@ -208,7 +208,7 @@ namespace sls {
if (vars.empty())
continue;
auto score = old_score(a);
TRACE("bv", tout << "score " << score << " " << mk_bounded_pp(a, m) << "\n");
TRACE(bv, tout << "score " << score << " " << mk_bounded_pp(a, m) << "\n");
auto q = score
+ m_config.ucb_constant * sqrt(log((double)m_touched) / get_touched(a))
+ m_config.ucb_noise * ctx.rand(512);
@ -226,7 +226,7 @@ namespace sls {
if (!assertion_is_true(a) && !m_ev.terms.uninterp_occurs(e).empty() && ctx.rand() % ++n == 0)
e = a;
}
CTRACE("bv", !e, ; display_weights(ctx.display(tout << "no candidate\n")););
CTRACE(bv, !e, ; display_weights(ctx.display(tout << "no candidate\n")););
m_last_atom = e;
@ -235,7 +235,7 @@ namespace sls {
auto const& vars = m_ev.terms.uninterp_occurs(e);
TRACE("bv", tout << "candidates " << mk_bounded_pp(e, m) << ": ";
TRACE(bv, tout << "candidates " << mk_bounded_pp(e, m) << ": ";
for (auto e : vars) tout << mk_bounded_pp(e, m) << " ";
tout << "\n";);
return vars;
@ -493,12 +493,12 @@ namespace sls {
else if (m.is_bool(t))
m_ev.set_bool_value_no_log(t, !m_ev.get_bool_value(t));
// TRACE("bv_verbose", tout << "lookahead update " << mk_bounded_pp(t, m) << " := " << new_value << "\n";);
// TRACE(bv_verbose, tout << "lookahead update " << mk_bounded_pp(t, m) << " := " << new_value << "\n";);
for (unsigned depth = m_min_depth; depth <= m_max_depth; ++depth) {
for (unsigned i = 0; i < m_update_stack[depth].size(); ++i) {
auto const& [a, is_bv] = m_update_stack[depth][i];
TRACE("bv_verbose", tout << "update " << mk_bounded_pp(a, m) << " depth: " << depth << "\n";);
TRACE(bv_verbose, tout << "update " << mk_bounded_pp(a, m) << " depth: " << depth << "\n";);
if (t != a) {
if (is_bv)
@ -512,7 +512,7 @@ namespace sls {
}
m_ev.restore_bool_values(restore_point);
TRACE("bv_verbose", tout << "lookahead update " << mk_bounded_pp(t, m) << " := " << new_value << " score: " << score << " " << m_best_score << "\n");
TRACE(bv_verbose, tout << "lookahead update " << mk_bounded_pp(t, m) << " := " << new_value << " score: " << score << " " << m_best_score << "\n");
return score;
}
@ -546,7 +546,7 @@ namespace sls {
m_in_update_stack.reset();
for (auto e : m_bv_restore) {
wval(e).restore_value();
TRACE("sls_verbose", tout << "restore value " << mk_bounded_pp(e, m) << " " << wval(e) << "\n");
TRACE(sls_verbose, tout << "restore value " << mk_bounded_pp(e, m) << " " << wval(e) << "\n");
}
for (auto const& [e, b]: m_bool_restore)
m_ev.set_bool_value_no_log(e, b);
@ -679,7 +679,7 @@ namespace sls {
for (unsigned depth = max_depth; depth <= max_depth; ++depth) {
for (unsigned i = 0; i < m_update_stack[depth].size(); ++i) {
auto [e, is_bv] = m_update_stack[depth][i];
TRACE("bv_verbose", tout << "update " << mk_bounded_pp(e, m) << "\n";);
TRACE(bv_verbose, tout << "update " << mk_bounded_pp(e, m) << "\n";);
if (t == e)
;
else if (is_bv) {
@ -690,7 +690,7 @@ namespace sls {
SASSERT(m.is_bool(e));
auto v1 = m_ev.bval1(e);
CTRACE("bv_verbose", m_ev.get_bool_value(e) != v1, tout << "updated truth value " << mk_bounded_pp(e, m) << " := " << v1 << "\n";);
CTRACE(bv_verbose, m_ev.get_bool_value(e) != v1, tout << "updated truth value " << mk_bounded_pp(e, m) << " := " << v1 << "\n";);
if (m_config.use_top_level_assertions) {
@ -715,7 +715,7 @@ namespace sls {
bool rot = ctx.try_rotate(v, m_rotated, budget);
if (rot)
++m_stats.m_rotations;
CTRACE("bv", rot, tout << "rotated: " << m_rotated << "\n";);
CTRACE(bv, rot, tout << "rotated: " << m_rotated << "\n";);
}
}
}
@ -740,7 +740,7 @@ namespace sls {
m_ev.commit_bool_values();
else
m_ev.restore_bool_values(restore_point);
TRACE("bv", tout << mt << " " << mk_bounded_pp(t, m);
TRACE(bv, tout << mt << " " << mk_bounded_pp(t, m);
if (bv.is_bv(t)) tout << " := " << new_value; else tout << " " << m_ev.get_bool_value(t);
tout << " score " << m_top_score << "\n";);
return true;
@ -755,7 +755,7 @@ namespace sls {
}
void bv_lookahead::insert_update(expr* e, bool is_bv) {
TRACE("sls_verbose", tout << "insert update " << mk_bounded_pp(e, m) << "\n");
TRACE(sls_verbose, tout << "insert update " << mk_bounded_pp(e, m) << "\n");
if (is_bv) {
SASSERT(bv.is_bv(e));
auto& v = wval(e);

View file

@ -56,7 +56,7 @@ namespace sls {
auto a = to_app(e);
if (!m_eval.eval_is_correct(a)) {
TRACE("sls", tout << "incorrect eval " << lit << ": " << mk_bounded_pp(e, m) << "\n";);
TRACE(sls, tout << "incorrect eval " << lit << ": " << mk_bounded_pp(e, m) << "\n";);
IF_VERBOSE(20, verbose_stream() << "repair " << lit << " " << mk_bounded_pp(e, m) << "\n");
ctx.new_value_eh(e);
}
@ -84,7 +84,7 @@ namespace sls {
bool is_sat = true;
for (auto t : ctx.subterms())
if (is_app(t) && bv.is_bv(t) && to_app(t)->get_family_id() == bv.get_fid() && !m_eval.eval_is_correct(to_app(t))) {
TRACE("sls", tout << "incorrect eval: " << mk_bounded_pp(t, m) << " " << m_eval.wval(t) << "\n";);
TRACE(sls, tout << "incorrect eval: " << mk_bounded_pp(t, m) << " " << m_eval.wval(t) << "\n";);
ctx.new_value_eh(t);
is_sat = false;
}

View file

@ -424,7 +424,7 @@ public:
calculate_expr_distances(as);
TRACE("sls", tout << "Initial model:" << std::endl; show_model(tout); );
TRACE(sls, tout << "Initial model:" << std::endl; show_model(tout); );
if (m_track_unsat)
{
@ -617,7 +617,7 @@ public:
}
void randomize(ptr_vector<expr> const & as) {
TRACE("sls_verbose", tout << "Abandoned model:" << std::endl; show_model(tout); );
TRACE(sls_verbose, tout << "Abandoned model:" << std::endl; show_model(tout); );
for (entry_point_type::iterator it = m_entry_points.begin(); it != m_entry_points.end(); it++) {
func_decl * fd = it->m_key;
@ -627,11 +627,11 @@ public:
m_mpz_manager.del(temp);
}
TRACE("sls", tout << "Randomized model:" << std::endl; show_model(tout); );
TRACE(sls, tout << "Randomized model:" << std::endl; show_model(tout); );
}
void reset(ptr_vector<expr> const & as) {
TRACE("sls_verbose", tout << "Abandoned model:" << std::endl; show_model(tout); );
TRACE(sls_verbose, tout << "Abandoned model:" << std::endl; show_model(tout); );
for (entry_point_type::iterator it = m_entry_points.begin(); it != m_entry_points.end(); it++) {
set_value(it->m_value, m_zero);
@ -677,7 +677,7 @@ public:
}
double score_bool(expr * n, bool negated = false) {
TRACE("sls_score", tout << ((negated)?"NEG ":"") << "BOOL: " << mk_ismt2_pp(n, m_manager) << std::endl; );
TRACE(sls_score, tout << ((negated)?"NEG ":"") << "BOOL: " << mk_ismt2_pp(n, m_manager) << std::endl; );
double res = 0.0;
@ -738,12 +738,12 @@ public:
if (negated) {
res = (m_mpz_manager.eq(v0, v1)) ? 0.0 : 1.0;
TRACE("sls_score", tout << "V0 = " << m_mpz_manager.to_string(v0) << " ; V1 = " <<
TRACE(sls_score, tout << "V0 = " << m_mpz_manager.to_string(v0) << " ; V1 = " <<
m_mpz_manager.to_string(v1) << std::endl; );
}
else if (m_manager.is_bool(arg0)) {
res = m_mpz_manager.eq(v0, v1) ? 1.0 : 0.0;
TRACE("sls_score", tout << "V0 = " << m_mpz_manager.to_string(v0) << " ; V1 = " <<
TRACE(sls_score, tout << "V0 = " << m_mpz_manager.to_string(v0) << " ; V1 = " <<
m_mpz_manager.to_string(v1) << std::endl; );
}
else if (m_bv_util.is_bv(arg0)) {
@ -759,7 +759,7 @@ public:
m_mpz_manager.machine_div(diff, m_two, diff);
}
res = 1.0 - (hamming_distance / (double) bv_sz);
TRACE("sls_score", tout << "V0 = " << m_mpz_manager.to_string(v0) << " ; V1 = " <<
TRACE(sls_score, tout << "V0 = " << m_mpz_manager.to_string(v0) << " ; V1 = " <<
m_mpz_manager.to_string(v1) << " ; HD = " << hamming_distance <<
" ; SZ = " << bv_sz << std::endl; );
m_mpz_manager.del(diff);
@ -804,7 +804,7 @@ public:
m_mpz_manager.del(diff);
}
}
TRACE("sls_score", tout << "x = " << m_mpz_manager.to_string(x) << " ; y = " <<
TRACE(sls_score, tout << "x = " << m_mpz_manager.to_string(x) << " ; y = " <<
m_mpz_manager.to_string(y) << " ; SZ = " << bv_sz << std::endl; );
}
else if (m_bv_util.is_bv_sle(n)) { // x <= y
@ -831,7 +831,7 @@ public:
res = (dbl > 1.0) ? 0.0 : (dbl < 0.0) ? 1.0 : 1.0 - dbl;
m_mpz_manager.del(diff);
}
TRACE("sls_score", tout << "x = " << m_mpz_manager.to_string(x) << " ; y = " <<
TRACE(sls_score, tout << "x = " << m_mpz_manager.to_string(x) << " ; y = " <<
m_mpz_manager.to_string(y) << " ; SZ = " << bv_sz << std::endl; );
}
else {
@ -847,7 +847,7 @@ public:
res = (dbl > 1.0) ? 0.0 : (dbl < 0.0) ? 1.0 : 1.0 - dbl;
m_mpz_manager.del(diff);
}
TRACE("sls_score", tout << "x = " << m_mpz_manager.to_string(x) << " ; y = " <<
TRACE(sls_score, tout << "x = " << m_mpz_manager.to_string(x) << " ; y = " <<
m_mpz_manager.to_string(y) << " ; SZ = " << bv_sz << std::endl; );
}
m_mpz_manager.del(x);
@ -887,7 +887,7 @@ public:
if (afid == m_bv_util.get_family_id())
if (res < 1.0) res *= m_scale_unsat;
TRACE("sls_score", tout << "SCORE = " << res << std::endl; );
TRACE(sls_score, tout << "SCORE = " << res << std::endl; );
return res;
}
@ -964,7 +964,7 @@ public:
if (!m_temp_constants.contains(fd))
m_temp_constants.push_back(fd);
}
TRACE("sls", tout << "candidates "; for (auto f : m_temp_constants) tout << f->get_name() << " "; tout << std::endl;);
TRACE(sls, tout << "candidates "; for (auto f : m_temp_constants) tout << f->get_name() << " "; tout << std::endl;);
return m_temp_constants;
}
@ -976,7 +976,7 @@ public:
if (!m_temp_constants.contains(fd))
m_temp_constants.push_back(fd);
TRACE("sls", tout << "candidates " << mk_bounded_pp(e, m_manager) << " ";
TRACE(sls, tout << "candidates " << mk_bounded_pp(e, m_manager) << " ";
for (auto f : m_temp_constants) tout << f->get_name() << " "; tout << std::endl;);
return m_temp_constants;

View file

@ -122,7 +122,7 @@ namespace sls {
if (fid == basic_family_id)
return false;
auto p = m_plugins.get(fid, nullptr);
CTRACE("sls_verbose", p != nullptr, tout << "external " << mk_bounded_pp(a, m) << "\n");
CTRACE(sls_verbose, p != nullptr, tout << "external " << mk_bounded_pp(a, m) << "\n");
return p != nullptr;
}
@ -196,7 +196,7 @@ namespace sls {
s.on_model(mdl);
// verbose_stream() << *mdl << "\n";
TRACE("sls", display(tout));
TRACE(sls, display(tout));
}
void context::validate_model(model& mdl) {
@ -210,7 +210,7 @@ namespace sls {
if (bad_model) {
IF_VERBOSE(0, verbose_stream() << lit << " " << a->get_id() << " " << mk_bounded_pp(a, m) << " " << eval_a << "\n");
TRACE("sls", s.display(tout << lit << " " << a->get_id() << " " << mk_bounded_pp(a, m) << " " << eval_a << "\n");
TRACE(sls, s.display(tout << lit << " " << a->get_id() << " " << mk_bounded_pp(a, m) << " " << eval_a << "\n");
for (expr* t : subterms::all(expr_ref(a, m)))
tout << "#" << t->get_id() << ": " << mk_bounded_pp(t, m) << " := " << ev(t) << "\n";
);
@ -240,13 +240,13 @@ namespace sls {
while (!m_repair_down.empty() && !m_new_constraint && m.inc()) {
auto id = m_repair_down.erase_min();
expr* e = term(id);
TRACE("sls", tout << "repair down " << mk_bounded_pp(e, m) << "\n");
TRACE(sls, tout << "repair down " << mk_bounded_pp(e, m) << "\n");
if (is_app(e)) {
auto p = m_plugins.get(get_fid(e), nullptr);
++m_stats.m_num_repair_down;
if (p && !p->repair_down(to_app(e)) && !m_repair_up.contains(e->get_id())) {
IF_VERBOSE(3, verbose_stream() << "revert repair: " << mk_bounded_pp(e, m) << "\n");
TRACE("sls", tout << "revert repair: " << mk_bounded_pp(e, m) << "\n");
TRACE(sls, tout << "revert repair: " << mk_bounded_pp(e, m) << "\n");
m_repair_up.insert(e->get_id());
}
}
@ -255,7 +255,7 @@ namespace sls {
auto id = m_repair_up.erase_min();
expr* e = term(id);
++m_stats.m_num_repair_up;
TRACE("sls", tout << "repair up " << mk_bounded_pp(e, m) << "\n");
TRACE(sls, tout << "repair up " << mk_bounded_pp(e, m) << "\n");
if (is_app(e)) {
auto p = m_plugins.get(get_fid(e), nullptr);
if (p)

View file

@ -136,7 +136,7 @@ namespace sls {
void datatype_plugin::add_edge(expr* child, expr* parent, expr* cond) {
m_parents.insert_if_not_there(child, vector<parent_t>()).push_back({parent, expr_ref(cond, m)});
TRACE("dt", tout << mk_bounded_pp(child, m) << " <- " << mk_bounded_pp(parent, m) << " " << mk_bounded_pp(cond, m) << "\n");
TRACE(dt, tout << mk_bounded_pp(child, m) << " <- " << mk_bounded_pp(parent, m) << " " << mk_bounded_pp(cond, m) << "\n");
}
void datatype_plugin::add_path_axioms() {
@ -164,7 +164,7 @@ namespace sls {
}
if (children[0]->get_sort() == parent->get_sort()) {
lits.push_back(~ctx.mk_literal(m.mk_eq(children[0], parent)));
TRACE("dt", for (auto lit : lits) tout << (lit.sign() ? "~": "") << mk_pp(ctx.atom(lit.var()), m) << "\n";);
TRACE(dt, for (auto lit : lits) tout << (lit.sign() ? "~": "") << mk_pp(ctx.atom(lit.var()), m) << "\n";);
ctx.add_clause(lits);
lits.pop_back();
}
@ -260,7 +260,7 @@ namespace sls {
}
//collect_path_axioms();
TRACE("dt", for (auto a : m_axioms) tout << mk_pp(a, m) << "\n";);
TRACE(dt, for (auto a : m_axioms) tout << mk_pp(a, m) << "\n";);
for (auto a : m_axioms)
ctx.add_constraint(a);
@ -279,7 +279,7 @@ namespace sls {
if (m_axiomatic_mode) {
init_values();
TRACE("dt", tout << "get value " << mk_bounded_pp(e, m) << " " << m_values.size() << " " << g->find(e)->get_root_id() << "\n";);
TRACE(dt, tout << "get value " << mk_bounded_pp(e, m) << " " << m_values.size() << " " << g->find(e)->get_root_id() << "\n";);
for (auto n : euf::enode_class(g->find(e))) {
auto id = n->get_id();
if (m_values.get(id, nullptr))
@ -295,7 +295,7 @@ namespace sls {
void datatype_plugin::init_values() {
if (!m_values.empty())
return;
TRACE("dt", g->display(tout));
TRACE(dt, g->display(tout));
m_model = alloc(model, m);
// retrieve e-graph from sls_euf_solver: add bridge in sls_context to share e-graph
SASSERT(g);
@ -347,11 +347,11 @@ namespace sls {
if (!has_null) {
m_values.setx(id, m.mk_app(f, args));
m_model->register_value(m_values.get(id));
TRACE("dt", tout << "Set interpretation "; trace_assignment(tout, n););
TRACE(dt, tout << "Set interpretation "; trace_assignment(tout, n););
}
}
TRACE("dt",
TRACE(dt,
for (euf::enode* n : deps.top_sorted()) {
tout << g->bpp(n) << ": ";
tout << g->bpp(get_constructor(n)) << " :: ";
@ -394,7 +394,7 @@ namespace sls {
worklist.push_back(p);
SASSERT(all_of(args, [&](expr* e) { return e != nullptr; }));
m_values.setx(p->get_id(), m.mk_app(f, args));
TRACE("dt", tout << "Patched interpretation "; trace_assignment(tout, p););
TRACE(dt, tout << "Patched interpretation "; trace_assignment(tout, p););
m_model->register_value(m_values.get(p->get_id()));
}
return all_processed;
@ -420,7 +420,7 @@ namespace sls {
SASSERT(v);
unsigned id = n->get_id();
m_values.setx(id, v);
TRACE("dt", tout << "Fresh interpretation "; trace_assignment(tout, n););
TRACE(dt, tout << "Fresh interpretation "; trace_assignment(tout, n););
worklist.reset();
worklist.push_back(n);
while (process_worklist(worklist))
@ -432,7 +432,7 @@ namespace sls {
if (!dt.is_datatype(n->get_expr()))
return;
euf::enode* con = get_constructor(n);
TRACE("dt", tout << g->bpp(n) << " con: " << g->bpp(con) << "\n";);
TRACE(dt, tout << g->bpp(n) << " con: " << g->bpp(con) << "\n";);
if (!con)
dep.insert(n, nullptr);
else if (con->num_args() == 0)

View file

@ -88,14 +88,14 @@ namespace sls {
g.explain<size_t>(explain, nullptr);
g.end_explain();
double reward = -1;
TRACE("euf",
TRACE(euf,
for (auto p : explain) {
sat::literal l = to_literal(p);
tout << l << " " << mk_pp(ctx.atom(l.var()), m) << " " << ctx.is_unit(l) << "\n";
});
for (auto p : explain) {
sat::literal l = to_literal(p);
CTRACE("euf", !ctx.is_true(l), tout << "not true " << l << "\n"; ctx.display(tout););
CTRACE(euf, !ctx.is_true(l), tout << "not true " << l << "\n"; ctx.display(tout););
SASSERT(ctx.is_true(l));
if (ctx.is_unit(l))
@ -133,7 +133,7 @@ namespace sls {
return;
auto block = [&](euf::enode* a, euf::enode* b) {
TRACE("euf", tout << "block " << m_g->bpp(a) << " != " << m_g->bpp(b) << "\n");
TRACE(euf, tout << "block " << m_g->bpp(a) << " != " << m_g->bpp(b) << "\n");
if (a->get_root() != b->get_root())
return;
ptr_vector<size_t> explain;
@ -197,7 +197,7 @@ namespace sls {
g.mk(m.mk_false(), 0, 0, nullptr);
// check for conflict with disequalities during propagation
if (merge_eqs) {
TRACE("euf", tout << "root literals " << ctx.root_literals() << "\n");
TRACE(euf, tout << "root literals " << ctx.root_literals() << "\n");
for (auto lit : ctx.root_literals()) {
if (!ctx.is_true(lit))
lit.neg();

View file

@ -145,7 +145,7 @@ namespace sls {
if (m_result == l_true && m_sls_model) {
ast_translation tr(m_sls, m);
mdl = m_sls_model->translate(tr);
TRACE("sls", tout << "model: " << *m_sls_model << "\n";);
TRACE(sls, tout << "model: " << *m_sls_model << "\n";);
if (!canceled)
ctx.set_finished();
}
@ -430,7 +430,7 @@ namespace sls {
}
lbool smt_plugin::on_save_model() {
TRACE("sls", display(tout));
TRACE(sls, display(tout));
lbool r = l_true;
while (unsat().empty()) {
r = m_context.check();

View file

@ -54,12 +54,12 @@ namespace sls {
if (m_on_save_model)
return r;
flet<bool> _on_save_model(m_on_save_model, true);
CTRACE("sls", unsat().empty(), display(tout));
CTRACE(sls, unsat().empty(), display(tout));
while (unsat().empty()) {
r = m_context.check();
if (!m_new_constraint)
break;
TRACE("sls", display(tout));
TRACE(sls, display(tout));
//m_ddfw.simplify();
m_ddfw.reinit();
m_new_constraint = false;