Skip to content

Commit a22c2de

Browse files
committed
Improve goto-synthesizer debug output
1 parent 556029c commit a22c2de

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/goto-synthesizer/cegis_verifier.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -600,11 +600,11 @@ optionalt<cext> cegis_verifiert::verify()
600600
// Annotate assigns
601601
annotate_assigns(assigns_map, goto_model);
602602

603-
// Control verbosity.
604-
// We allow non-error output message only when verbosity is set to at least 9.
603+
// Control verbosity. We allow non-error output message only when verbosity
604+
// is set to larger than messaget::M_DEBUG.
605605
const unsigned original_verbosity = log.get_message_handler().get_verbosity();
606-
if(original_verbosity < 9)
607-
log.get_message_handler().set_verbosity(1);
606+
if(original_verbosity < messaget::M_DEBUG)
607+
log.get_message_handler().set_verbosity(messaget::M_ERROR);
608608

609609
// Apply loop contracts we annotated.
610610
code_contractst cont(goto_model, log);
@@ -630,7 +630,7 @@ optionalt<cext> cegis_verifiert::verify()
630630
// Run the checker to get the result.
631631
const resultt result = (*checker)();
632632

633-
if(original_verbosity >= 9)
633+
if(original_verbosity >= messaget::M_DEBUG)
634634
checker->report();
635635

636636
// Restore the verbosity.
@@ -698,6 +698,8 @@ optionalt<cext> cegis_verifiert::verify()
698698
// although there can be multiple ones.
699699

700700
log.debug() << "Start to compute cause loop ids." << messaget::eom;
701+
log.debug() << "Violation description: " << target_violation_info.description
702+
<< messaget::eom;
701703

702704
const auto &trace = checker->get_traces()[target_violation];
703705
// Doing assigns-synthesis or invariant-synthesis

src/goto-synthesizer/enumerative_loop_contracts_synthesizer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ void enumerative_loop_contracts_synthesizert::init_candidates()
120120
}
121121
}
122122
}
123+
log.debug() << "Finished candidates initialization." << messaget::eom;
123124
}
124125

125126
void enumerative_loop_contracts_synthesizert::synthesize_assigns(
@@ -303,6 +304,8 @@ exprt enumerative_loop_contracts_synthesizert::synthesize_strengthening_clause(
303304
// generate candidate and verify
304305
for(auto strengthening_candidate : start_bool_ph.enumerate(size_bound))
305306
{
307+
log.progress() << "Verifying candidate: "
308+
<< format(strengthening_candidate) << messaget::eom;
306309
seen_terms++;
307310
invariant_mapt new_in_clauses = invariant_mapt(in_invariant_clause_map);
308311
new_in_clauses[cause_loop_id] =
@@ -351,6 +354,7 @@ invariant_mapt enumerative_loop_contracts_synthesizert::synthesize_all()
351354
// Set of symbols we used to enumerate strengthening clauses.
352355
std::vector<exprt> terminal_symbols;
353356

357+
log.debug() << "Start the first synthesis iteration." << messaget::eom;
354358
auto return_cex = verifier.verify();
355359

356360
while(return_cex.has_value())

0 commit comments

Comments
 (0)