Go to the documentation of this file.
25 else if(std::next(from) == to)
28 return from->condition();
36 if(to->is_end_function())
40 return to->call_lhs();
55 fixedpoint(function_id, goto_program, goto_functions);
65 <<
"//// Function: " << gf_entry.first <<
"\n////\n\n";
67 output(gf_entry.first, gf_entry.second.body, out);
83 assert(!working_set.empty());
114 while(!working_set.empty())
118 if(
visit(function_id, l, working_set, goto_program, goto_functions))
135 std::cout <<
"Visiting: " << l->function <<
" " <<
136 l->location_number <<
'\n';
152 if(l->is_function_call())
166 if(changed || !
seen(to_l))
194 const goto_functionst::function_mapt::const_iterator f_it,
200 if(!goto_function.body_available())
206 l_call->call_lhs().type(), l_call->source_location())));
207 r->location_number=0;
210 t->location_number=1;
216 state.
transform(
ns, calling_function, l_call, f_it->first,
r);
218 new_data = state.
transform(
ns, f_it->first,
r, f_it->first, t) || new_data;
221 state.
transform(
ns, f_it->first, t, calling_function, l_next) || new_data;
226 assert(!goto_function.body.instructions.empty());
232 locationt l_begin=goto_function.body.instructions.begin();
236 state.
transform(
ns, calling_function, l_call, f_it->first, l_begin);
250 fixedpoint(f_it->first, goto_function.body, goto_functions);
257 locationt l_end=--goto_function.body.instructions.end();
259 assert(l_end->is_end_function());
265 state.
transform(
ns, f_it->first, l_end, calling_function, l_next) ||
275 const exprt &
function,
280 bool new_data =
false;
282 if(
function.
id()==ID_symbol)
294 goto_functionst::function_mapt::const_iterator it=
298 throw "failed to find function "+
id2string(identifier);
301 calling_function, l_call, goto_functions, it, arguments, state);
305 else if(
function.
id()==ID_if)
320 if_expr.false_case(),
326 else if(
function.
id()==ID_dereference)
334 for(
const auto &v : values)
336 if(v.id()==ID_object_descriptor)
341 goto_functionst::function_mapt::const_iterator it=
358 else if(
function.
id() == ID_null_object)
362 else if(
function.
id()==ID_member ||
function.
id()==ID_index)
366 else if(
function.
id()==
"builtin-function")
372 throw "unexpected function_call argument: "+
373 function.id_string();
388 fixedpoint(gf_entry.first, gf_entry.second.body, goto_functions);
virtual void update(const goto_programt &goto_program)
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
virtual statet & get_state()=0
bool visit(const irep_idt &function_id, locationt l, working_sett &working_set, const goto_programt &goto_program, const goto_functionst &goto_functions)
static instructiont make_set_return_value(exprt return_value, const source_locationt &l=source_locationt::nil())
const if_exprt & to_if_expr(const exprt &expr)
Cast an exprt to an if_exprt.
Split an expression into a base object and a (byte) offset.
static instructiont make_end_function(const source_locationt &l=source_locationt::nil())
targett add(instructiont &&instruction)
Adds a given instruction at the end.
Base class for all expressions.
recursion_sett recursion_set
std::list< Target > get_successors(Target target) const
Get control-flow successors of a given instruction.
function_mapt function_map
std::priority_queue< locationt > working_sett
exprt get_return_lhs(locationt to) const
const irep_idt & get(const irep_idt &name) const
const object_descriptor_exprt & to_object_descriptor_expr(const exprt &expr)
Cast an exprt to an object_descriptor_exprt.
virtual void initialize(const goto_programt &)
std::set< locationt > seen_locations
virtual void output(const namespacet &, std::ostream &) const
bool do_function_call_rec(const irep_idt &calling_function, locationt l_call, const exprt &function, const exprt::operandst &arguments, statet &new_state, const goto_functionst &goto_functions)
bool fixedpoint(const irep_idt &function_id, const goto_programt &goto_program, const goto_functionst &goto_functions)
virtual void operator()(const irep_idt &function_id, const goto_programt &goto_program)
virtual void get_reference_set(const exprt &expr, expr_sett &expr_set)=0
goto_programt::const_targett locationt
functions_donet functions_done
const std::string & id2string(const irep_idt &d)
const irep_idt & get_identifier() const
exprt boolean_negate(const exprt &src)
negate a Boolean expression, possibly removing a not_exprt, and swapping false and true
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
void put_in_working_set(working_sett &working_set, locationt l)
std::vector< exprt > operandst
virtual void output(const goto_functionst &goto_functions, std::ostream &out)
A side_effect_exprt that returns a non-deterministically chosen value.
::goto_functiont goto_functiont
bool do_function_call(const irep_idt &calling_function, locationt l_call, const goto_functionst &goto_functions, const goto_functionst::function_mapt::const_iterator f_it, const exprt::operandst &arguments, statet &new_state)
instructionst instructions
The list of instructions in the goto program.
Deprecated expression utility functions.
std::map< locationt, unsigned > statistics
exprt get_guard(locationt from, locationt to) const
A collection of goto functions.
goto_programt::const_targett locationt
virtual bool transform(const namespacet &ns, const irep_idt &function_from, locationt from, const irep_idt &function_to, locationt to)=0
flow_insensitive_abstract_domain_baset::expr_sett expr_sett
A generic container class for the GOTO intermediate representation of one function.
const irept & get_nil_irep()
The Boolean constant true.
bool seen(const locationt &l)
locationt get_next(working_sett &working_set)
instructionst::iterator targett