28 const std::size_t goals_covered =
30 log.status() <<
"** " << goals_covered <<
" of " << properties.size()
31 <<
" covered (" << std::fixed << std::setw(1)
32 << std::setprecision(1)
33 << (properties.empty()
35 : 100.0 * goals_covered / properties.size())
37 log.statistics() <<
"** Used " << iterations <<
" iteration"
45 for(
const auto &property_pair : properties)
47 log.result() <<
"[" << property_pair.first <<
"]";
49 if(property_pair.second.pc->source_location().is_not_nil())
50 log.result() <<
' ' << property_pair.second.pc->source_location();
52 if(!property_pair.second.description.empty())
53 log.result() <<
' ' << property_pair.second.description;
67 for(
const auto &property_pair : properties)
72 {
"description", property_pair.second.description},
78 const auto &source_location = property_pair.second.pc->source_location();
79 if(source_location.is_not_nil())
83 const irept &basic_block_lines =
84 source_location.get_basic_block_source_lines();
87 xmlt basic_block_lines_xml{
"basic_block_lines"};
88 for(
const auto &file_entry : basic_block_lines.
get_named_sub())
90 for(
const auto &lines_entry : file_entry.second.get_named_sub())
94 line.set_attribute(
"function",
id2string(lines_entry.first));
95 line.data =
id2string(lines_entry.second.id());
96 basic_block_lines_xml.new_element(line);
99 xml_result.new_element(basic_block_lines_xml);
103 log.result() << xml_result;
112 if(
log.status().tellp() > 0)
117 for(
const auto &property_pair : properties)
127 const auto &source_location = property_info.
pc->source_location();
128 if(source_location.is_not_nil())
130 json_goal[
"sourceLocation"] =
json(source_location);
132 const irept &basic_block_lines =
133 source_location.get_basic_block_source_lines();
137 for(
const auto &file_entry : basic_block_lines.
get_named_sub())
140 for(
const auto &lines_entry : file_entry.second.get_named_sub())
142 file_lines_json[
id2string(lines_entry.first)] =
145 basic_block_lines_json[
id2string(file_entry.first)] = file_lines_json;
147 json_goal[
"basicBlockLines"] = basic_block_lines_json;
151 goals_array.
push_back(std::move(json_goal));
153 const std::size_t goals_covered =
167 switch(ui_message_handler.
get_ui())
There are a large number of kinds of tree structured or tree-like data in CPROVER.
named_subt & get_named_sub()
Provides methods for streaming JSON arrays.
void push_back(const jsont &json)
Push back a JSON element into the current array stream.
json_stream_objectt & push_back_stream_object()
Add a JSON object child stream.
Provides methods for streaming JSON objects.
void push_back(const std::string &key, const jsont &json)
Push back a JSON element into the current object stream.
json_stream_arrayt & push_back_stream_array(const std::string &key)
Add a JSON array stream for a specific key.
Class that provides messages with a built-in verbosity 'level'.
virtual uit get_ui() const
virtual json_stream_arrayt & get_json_stream()
void set_attribute(const std::string &attribute, unsigned value)
xmlt & new_element(const std::string &key)
static void output_goals_iterations(const propertiest &properties, unsigned iterations, messaget &log)
static void output_goals_xml(const propertiest &properties, messaget &log)
static void output_goals_json(const propertiest &properties, messaget &log, ui_message_handlert &ui_message_handler)
void output_goals(const propertiest &properties, unsigned iterations, ui_message_handlert &ui_message_handler)
Outputs the properties interpreted as 'coverage goals' and the number of goto verifier iterations tha...
static void output_goals_plain(const propertiest &properties, messaget &log)
Cover Goals Reporting Utilities.
const std::string & id2string(const irep_idt &d)
static void json(json_objectT &result, const irep_idt &property_id, const property_infot &property_info)
std::size_t count_properties(const propertiest &properties, property_statust status)
Return the number of properties with given status.
xmlt xml(const irep_idt &property_id, const property_infot &property_info)
@ FAIL
The property was violated.
std::map< irep_idt, property_infot > propertiest
A map of property IDs to property infos.
std::string to_string(const string_not_contains_constraintt &expr)
Used for debug printing.
property_statust status
The status of the property.
std::string description
A description (usually derived from the assertion's comment)
goto_programt::const_targett pc
A pointer to the corresponding goto instruction.