Go to the documentation of this file.
34 if(ins.source_location().get_property_id() == property)
36 return ins.source_location();
77 property_l=
xml(source_location);
79 xml_property.new_element(
"description").data=
id2string(description);
80 xml_property.new_element(
"expression").data =
81 from_expr(ns, identifier, ins.condition());
83 const irept &basic_block_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_property.new_element(basic_block_lines_xml);
102 msg.
result() << xml_property;
111 msg.
result() <<
"Property " << property_id <<
":\n";
114 <<
" " << description <<
'\n'
115 <<
" " <<
from_expr(ns, identifier, ins.condition())
150 {
"sourceLocation",
json(source_location)},
154 const irept &basic_block_lines =
159 for(
const auto &file_entry : basic_block_lines.
get_named_sub())
162 for(
const auto &lines_entry : file_entry.second.get_named_sub())
164 file_lines_json[
id2string(lines_entry.first)] =
167 basic_block_lines_json[
id2string(file_entry.first)] = file_lines_json;
169 json_property[
"basicBlockLines"] = basic_block_lines_json;
172 json_properties.
push_back(std::move(json_property));
187 json_objectt json_result{{
"properties", json_properties}};
188 msg.
result() << json_result;
201 show_properties(ns, fct.first, ui_message_handler, ui, fct.second.body);
void convert_properties_json(json_arrayt &json_properties, const namespacet &ns, const irep_idt &identifier, const goto_programt &goto_program)
Collects the properties in the goto program into a json_arrayt
Class that provides messages with a built-in verbosity 'level'.
#define UNREACHABLE
This should be used to mark dead code.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
const irep_idt & get_comment() const
const irep_idt & get_property_id() const
const irep_idt & get_property_class() const
void show_properties_json(const namespacet &ns, message_handlert &message_handler, const goto_functionst &goto_functions)
void show_properties(const namespacet &ns, const irep_idt &identifier, message_handlert &message_handler, ui_message_handlert::uit ui, const goto_programt &goto_program)
function_mapt function_map
virtual uit get_ui() const
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
mstreamt & result() const
const std::string & id2string(const irep_idt &d)
named_subt & get_named_sub()
xmlt xml(const irep_idt &property_id, const property_infot &property_info)
source_locationt source_location
static void json(json_objectT &result, const irep_idt &property_id, const property_infot &property_info)
nonstd::optional< T > optionalt
instructionst instructions
The list of instructions in the goto program.
A collection of goto functions.
goto_functionst goto_functions
GOTO functions.
void set_attribute(const std::string &attribute, unsigned value)
optionalt< source_locationt > find_property(const irep_idt &property, const goto_functionst &goto_functions)
Returns a source_locationt that corresponds to the property given by an irep_idt.
A generic container class for the GOTO intermediate representation of one function.
There are a large number of kinds of tree structured or tree-like data in CPROVER.
static std::string comment(const rw_set_baset::entryt &entry, bool write)
symbol_tablet symbol_table
Symbol table.
std::string from_expr(const namespacet &ns, const irep_idt &identifier, const exprt &expr)
const irept & get_basic_block_source_lines() const
jsont & push_back(const jsont &json)
xmlt & new_element(const std::string &key)