Skip to content

Do pretty printing for debug logging only when verbosity is high in incremental SMT2 decision procedure #6704

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ void smt2_incremental_decision_proceduret::ensure_handle_for_expr_defined(

exprt smt2_incremental_decision_proceduret::handle(const exprt &expr)
{
log.debug() << "`handle` -\n " << expr.pretty(2, 0) << messaget::eom;
log.conditional_output(log.debug(), [&](messaget::mstreamt &debug) {
debug << "`handle` -\n " << expr.pretty(2, 0) << messaget::eom;
});
ensure_handle_for_expr_defined(expr);
return expr;
}
Expand All @@ -182,7 +184,9 @@ static optionalt<smt_termt> get_identifier(

exprt smt2_incremental_decision_proceduret::get(const exprt &expr) const
{
log.debug() << "`get` - \n " + expr.pretty(2, 0) << messaget::eom;
log.conditional_output(log.debug(), [&](messaget::mstreamt &debug) {
debug << "`get` - \n " + expr.pretty(2, 0) << messaget::eom;
});
optionalt<smt_termt> descriptor =
get_identifier(expr, expression_handle_identifiers, expression_identifiers);
if(!descriptor)
Expand Down Expand Up @@ -251,8 +255,10 @@ smt2_incremental_decision_proceduret::get_number_of_solver_calls() const
void smt2_incremental_decision_proceduret::set_to(const exprt &expr, bool value)
{
PRECONDITION(can_cast_type<bool_typet>(expr.type()));
log.debug() << "`set_to` (" << std::string{value ? "true" : "false"}
<< ") -\n " << expr.pretty(2, 0) << messaget::eom;
log.conditional_output(log.debug(), [&](messaget::mstreamt &debug) {
debug << "`set_to` (" << std::string{value ? "true" : "false"} << ") -\n "
<< expr.pretty(2, 0) << messaget::eom;
});

define_dependent_functions(expr);
auto converted_term = [&]() -> smt_termt {
Expand Down