1#ifndef GOTO_PROGRAMS_GOTO_LOOP_INVARIANT_H_
2#define GOTO_PROGRAMS_GOTO_LOOP_INVARIANT_H_
10#include <unordered_set>
79 :
goto_loopst(_function_name, _goto_functions, _goto_function),
127 const std::vector<expr2tc> &invariants,
133 const std::vector<expr2tc> &invariants,
157 const std::vector<expr2tc> &invariants,
158 const std::vector<expr2tc> &loop_assigns,
165 const std::vector<expr2tc> &invariants,
202 :
goto_loopst(_function_name, _goto_functions, _goto_function)
205 process_loops_combined();
209 void process_loops_combined();
212 void insert_invariant_verification_branch(
loopst &loop);
Definition frame_enforcer.h:39
Definition goto_functions.h:56
Definition goto_functions.h:23
goto_loop_invariant_combinedt(const irep_idt &_function_name, goto_functionst &_goto_functions, goto_functiont &_goto_function)
Definition goto_loop_invariant.h:198
std::vector< expr2tc > extract_loop_assigns(const loopst &loop)
Definition goto_loop_invariant.cpp:303
void insert_assert_before_loop(goto_programt::targett &loop_head, const std::vector< expr2tc > &invariants, const goto_programt &side_effects)
Definition goto_loop_invariant.cpp:609
void extract_and_remove_side_effects(goto_programt::targett loop_head, const loopst &loop, const std::vector< expr2tc > &invariants, goto_programt &side_effects_out)
Collect DECL/FUNCTION_CALL instructions immediately before LOOP_INVARIANT that define temporaries use...
Definition goto_loop_invariant.cpp:599
contextt & context
Definition goto_loop_invariant.h:88
void convert_loop_with_invariant(loopst &loop)
Definition goto_loop_invariant.cpp:229
static void collect_symbols(const expr2tc &expr, std::set< irep_idt > &symbols)
Collect all symbol names reachable from an expression tree.
Definition goto_loop_invariant.cpp:336
std::vector< expr2tc > extract_loop_invariants(const loopst &loop)
Definition goto_loop_invariant.cpp:296
static type2tc havoc_pointee_type(const expr2tc &ptr, const namespacet &ns)
The type of *ptr when the havoc can cover it, nil otherwise: a pointee with no static width (a VLA,...
Definition goto_loop_invariant.cpp:638
goto_loop_invariantt(const irep_idt &_function_name, goto_functionst &_goto_functions, goto_functiont &_goto_function, contextt &_context, bool _use_frame_rule)
Definition goto_loop_invariant.h:73
void insert_havoc_and_assume_before_condition(goto_programt::targett loop_head, const loopst &loop, const std::vector< expr2tc > &invariants, const std::vector< expr2tc > &loop_assigns, goto_programt &side_effects)
Definition goto_loop_invariant.cpp:692
bool use_frame_rule
Definition goto_loop_invariant.h:89
void insert_inductive_step_and_termination(const loopst &loop, const std::vector< expr2tc > &invariants, const goto_programt &side_effects)
Definition goto_loop_invariant.cpp:856
frame_enforcert * active_frame_enforcer
Frame enforcer shared between the havoc step (ASSUME) and the inductive step (ASSERT compliance check...
Definition goto_loop_invariant.h:95
static constexpr size_t kMaxInvariantSearchBack
Maximum number of instructions to search backwards from the loop head when locating the LOOP_INVARIAN...
Definition goto_loop_invariant.h:71
void goto_loop_invariant()
Definition goto_loop_invariant.cpp:217
void havoc_pointees(const loopst &loop, const locationt &loc, goto_programt &dest) const
Havoc the objects the loop writes through a pointer.
Definition goto_loop_invariant.cpp:675
bool pointees_havocable(const loopst &loop) const
False when a pointee the loop writes is out of the havoc's reach, which leaves the loop to the unwind...
Definition goto_loop_invariant.cpp:661
std::vector< expr2tc > active_loop_assigns
Assigns targets for the current loop (mirrors loop_assigns passed to insert_havoc_and_assume_before_c...
Definition goto_loop_invariant.h:99
static constexpr unsigned kMaxHavocPointeeBits
Largest pointee, in bits, the havoc will cover.
Definition goto_loop_invariant.h:103
goto_loopst(const irep_idt &_function_name, goto_functionst &_goto_functions, goto_functiont &_goto_function)
Definition goto_loops.h:121
function_loopst function_loops
Definition goto_loops.h:23
A generic container class for a control flow graph for one function, in the form of a goto-program.
Definition goto_program.h:63
instructionst::iterator targett
Definition goto_program.h:590
instructionst::const_iterator const_targett
Definition goto_program.h:591
Definition namespace.h:10
const char *const kSynthesisedInvariantProperty
Property tag that goto_synthesise_loop_invariants stamps on the LOOP_INVARIANT markers it emits.
Definition goto_loop_invariant.cpp:49
void goto_loop_invariant(goto_functionst &goto_functions, contextt &context, bool use_frame_rule)
Entry point: process loop invariants for all functions.
Definition goto_loop_invariant.cpp:204
void goto_loop_invariant_combined(goto_functionst &goto_functions)
Combined loop-invariant + k-induction mode.
Definition goto_loop_invariant.cpp:927
irep_container< type2t > type2tc
Definition irep2.h:430
irep_container< expr2t > expr2tc
Definition irep2.h:431
Definition goto_loop_invariant.cpp:52
bool is_inert_scan_instruction(goto_programt::const_targett t)
Instructions with no effect a caller needs to account for: no write to a tracked variable,...
Definition goto_loop_invariant.cpp:53