void symex_parseoptionst::show_counterexample( const goto_tracet &error_trace) { const namespacet ns(symbol_table); switch(get_ui()) { case ui_message_handlert::PLAIN: std::cout << std::endl << "Counterexample:" << std::endl; show_goto_trace(std::cout, ns, error_trace); break; case ui_message_handlert::XML_UI: { xmlt xml; convert(ns, error_trace, xml); std::cout << xml << std::endl; } break; default: assert(false); } }
void bmc_all_propertiest::report(const cover_goalst &cover_goals) { switch(bmc.ui) { case ui_message_handlert::uit::PLAIN: { status() << "\n** Results:" << eom; for(const auto &goal_pair : goal_map) status() << "[" << goal_pair.first << "] " << goal_pair.second.description << ": " << goal_pair.second.status_string() << eom; if(bmc.options.get_bool_option("trace")) { for(const auto &g : goal_map) if(g.second.status==goalt::statust::FAILURE) { std::cout << "\n" << "Trace for " << g.first << ":" << "\n"; show_goto_trace(std::cout, bmc.ns, g.second.goto_trace); } } status() << "\n** " << cover_goals.number_covered() << " of " << cover_goals.size() << " failed (" << cover_goals.iterations() << " iteration" << (cover_goals.iterations()==1?"":"s") << ")" << eom; } break; case ui_message_handlert::uit::XML_UI: { for(const auto &g : goal_map) { xmlt xml_result("result"); xml_result.set_attribute("property", id2string(g.first)); xml_result.set_attribute("status", g.second.status_string()); if(g.second.status==goalt::statust::FAILURE) convert(bmc.ns, g.second.goto_trace, xml_result.new_element()); std::cout << xml_result << "\n"; } break; } case ui_message_handlert::uit::JSON_UI: { json_objectt json_result; json_arrayt &result_array=json_result["result"].make_array(); for(const auto &g : goal_map) { json_objectt &result=result_array.push_back().make_object(); result["property"]=json_stringt(id2string(g.first)); result["description"]=json_stringt(id2string(g.second.description)); result["status"]=json_stringt(g.second.status_string()); if(g.second.status==goalt::statust::FAILURE) { jsont &json_trace=result["trace"]; convert(bmc.ns, g.second.goto_trace, json_trace); } } std::cout << ",\n" << json_result; } break; } }