22 std::optional<source_locationt>
33 if(ins.source_location().get_property_id() == property)
35 return ins.source_location();
76 property_l=
xml(source_location);
78 xml_property.new_element(
"description").data=
id2string(description);
79 xml_property.new_element(
"expression").data =
80 from_expr(ns, identifier, ins.condition());
82 const irept &basic_block_lines =
86 xmlt basic_block_lines_xml{
"basic_block_lines"};
87 for(
const auto &file_entry : basic_block_lines.
get_named_sub())
89 for(
const auto &lines_entry : file_entry.second.get_named_sub())
93 line.set_attribute(
"function",
id2string(lines_entry.first));
94 line.data =
id2string(lines_entry.second.id());
95 basic_block_lines_xml.new_element(line);
98 xml_property.new_element(basic_block_lines_xml);
101 msg.
result() << xml_property;
110 msg.
result() <<
"Property " << property_id <<
":\n";
113 <<
" " << description <<
'\n'
114 <<
" " <<
from_expr(ns, identifier, ins.condition())
149 {
"sourceLocation",
json(source_location)},
153 const irept &basic_block_lines =
158 for(
const auto &file_entry : basic_block_lines.
get_named_sub())
161 for(
const auto &lines_entry : file_entry.second.get_named_sub())
163 file_lines_json[
id2string(lines_entry.first)] =
166 basic_block_lines_json[
id2string(file_entry.first)] = file_lines_json;
168 json_property[
"basicBlockLines"] = basic_block_lines_json;
171 json_properties.
push_back(std::move(json_property));
186 json_objectt json_result{{
"properties", json_properties}};
187 msg.
result() << json_result;
200 show_properties(ns, fct.first, ui_message_handler, ui, fct.second.body);
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
A collection of goto functions.
function_mapt function_map
symbol_tablet symbol_table
Symbol table.
goto_functionst goto_functions
GOTO functions.
A generic container class for the GOTO intermediate representation of one function.
instructionst instructions
The list of instructions in the goto program.
There are a large number of kinds of tree structured or tree-like data in CPROVER.
named_subt & get_named_sub()
jsont & push_back(const jsont &json)
source_locationt source_location
Class that provides messages with a built-in verbosity 'level'.
mstreamt & result() const
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
const irep_idt & get_property_id() const
const irep_idt & get_comment() const
const irep_idt & get_property_class() const
const irept & get_basic_block_source_lines() const
virtual uit get_ui() const
void set_attribute(const std::string &attribute, unsigned value)
xmlt & new_element(const std::string &key)
const std::string & id2string(const irep_idt &d)
std::string from_expr(const namespacet &ns, const irep_idt &identifier, const exprt &expr)
static void json(json_objectT &result, const irep_idt &property_id, const property_infot &property_info)
xmlt xml(const irep_idt &property_id, const property_infot &property_info)
static std::string comment(const rw_set_baset::entryt &entry, bool write)
void show_properties_json(const namespacet &ns, message_handlert &message_handler, const goto_functionst &goto_functions)
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
std::optional< 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.
void show_properties(const namespacet &ns, const irep_idt &identifier, message_handlert &message_handler, ui_message_handlert::uit ui, const goto_programt &goto_program)
#define UNREACHABLE
This should be used to mark dead code.