22 const irep_idt &identifier=
function.get_identifier();
28 const auto &body=f_it->second.body;
30 std::vector<goto_programt::const_targett> result;
32 for(
auto i_it=body.instructions.begin();
33 i_it!=body.instructions.end();
36 if(i_it->is_location() ||
42 i_it->source_location().get_property_class() == ID_precondition)
44 result.push_back(i_it);
57 if(instruction.is_location() ||
58 instruction.is_skip())
62 instruction.is_assert() &&
63 instruction.source_location().get_property_class() == ID_precondition)
74 const exprt &
function,
81 const auto ¶meters=code_type.parameters();
85 for(
const auto &p : parameters)
87 if(!p.get_identifier().empty() && arguments.size() > count)
109 if(it->is_function_call())
112 if(
as_const(*it).call_function().id() == ID_symbol)
127 for(
const auto &p : preconditions)
130 exprt instance = p->condition();
134 annotated_location.
set_comment(p->source_location().get_comment());
const T & as_const(T &value)
Return a reference to the same object but ensures the type is const.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
std::vector< exprt > operandst
A collection of goto functions.
function_mapt function_map
A goto function, consisting of function body (see body) and parameter identifiers (see parameter_iden...
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.
void insert_before_swap(targett target)
Insertion that preserves jumps to "target".
static instructiont make_location(const source_locationt &l)
static instructiont make_assertion(const exprt &g, const source_locationt &l=source_locationt::nil())
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
Replace a symbol expression by a given expression.
void insert(const class symbol_exprt &old_expr, const exprt &new_expr)
Sets old_expr to be replaced by new_expr if we don't already have a replacement; otherwise does nothi...
void set_comment(const irep_idt &comment)
void set_property_class(const irep_idt &property_class)
Expression to hold a symbol (variable)
typet type
Type of symbol.
static exprt conditional_cast(const exprt &expr, const typet &type)
void remove_preconditions(goto_programt &goto_program)
replace_symbolt actuals_replace_map(const exprt &lhs, const exprt &function, const exprt::operandst &arguments, const namespacet &ns)
void instrument_preconditions(const goto_modelt &goto_model, goto_programt &goto_program)
std::vector< goto_programt::const_targett > get_preconditions(const symbol_exprt &function, const goto_functionst &goto_functions)
#define PRECONDITION(CONDITION)
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.