Go to the documentation of this file.
16 for(
const auto &t : loop)
21 t->is_goto() && t->get_target() == loop_head &&
22 t->location_number > loop_end->location_number)
26 loop_head != loop_end,
27 "Could not find end of the loop starting at: " +
28 loop_head->source_location().as_string());
38 for(
const auto &t : loop)
43 t->is_goto() && t->get_target() == loop_head &&
44 t->location_number > loop_end->location_number)
48 loop_head != loop_end,
49 "Could not find end of the loop starting at: " +
50 loop_head->source_location().as_string());
56 const unsigned int target_loop_number,
63 for(
const auto &loop_p : natural_loops.
loop_map)
69 if(loop_end->loop_number == target_loop_number)
98 for(
const auto &invariant_map_entry : invariant_map)
100 loop_idt loop_id = invariant_map_entry.first;
109 exprt condition = loop_end->condition();
110 loop_end->condition_nonconst().
add(ID_C_spec_loop_invariant) =
111 invariant_map_entry.second;
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.
goto_programt::targett get_loop_head_or_end(const unsigned int target_loop_number, goto_functiont &function, bool finding_head)
Return loop head if finding_head is true, Otherwise return loop end.
Base class for all expressions.
goto_programt::const_targett get_loop_end_from_loop_head_and_content(const goto_programt::const_targett &loop_head, const loop_templatet< goto_programt::const_targett > &loop)
goto_programt::targett get_loop_head(const unsigned int target_loop_number, goto_functiont &function)
Find and return the first instruction of the natural loop with loop_number in function.
function_mapt function_map
A loop, specified as a set of instructions.
A goto function, consisting of function body (see body) and parameter identifiers (see parameter_iden...
std::map< loop_idt, exprt > invariant_mapt
irept & add(const irep_idt &name)
void annotate_invariants(const invariant_mapt &invariant_map, goto_modelt &goto_model, messaget &log)
Annotate the invariants in invariant_map to their corresponding loops.
goto_functionst goto_functions
GOTO functions.
goto_programt::targett get_loop_end(const unsigned int target_loop_number, goto_functiont &function)
Find and return the last instruction of the natural loop with loop_number in function.
goto_programt::targett get_loop_end_from_loop_head_and_content_mutable(const goto_programt::targett &loop_head, const loop_templatet< goto_programt::targett > &loop)
Find the goto instruction of loop that jumps to loop_head
instructionst::const_iterator const_targett
#define INVARIANT(CONDITION, REASON)
This macro uses the wrapper function 'invariant_violated_string'.
instructionst::iterator targett
Loop id used to identify loops.