Go to the documentation of this file.
29 const std::function<
void()> &havoc_code_impl)
70 if(expr.
id() == ID_pointer_object)
84 if(expr.
id() == ID_dereference)
85 validity_checks.push_back(
88 for(
const auto &op : expr.
operands())
95 const std::vector<symbol_exprt> &lhs,
96 const std::vector<symbol_exprt> &rhs)
113 for(
size_t i = 1; i < equality_conjunctions.size() - 1; i++)
116 equality_conjunctions[i] =
117 and_exprt(equality_conjunctions[i - 1], component_i_equality);
127 lexicographic_individual_comparisons[0] =
129 for(
size_t i = 1; i < lexicographic_individual_comparisons.size(); i++)
132 lexicographic_individual_comparisons[i] =
133 and_exprt(equality_conjunctions[i - 1], component_i_less_than);
135 return disjunction(lexicographic_individual_comparisons);
145 std::advance(target, offset);
167 instruction.is_goto() &&
169 instruction.turn_into_skip();
185 "Instruction list vs CFG size mismatch.");
189 std::vector<idxt> node_to_scc(cfg.
size(), -1);
190 auto nof_sccs = cfg.
SCCs(node_to_scc);
193 std::vector<int> scc_size(nof_sccs, 0);
194 for(
auto scc : node_to_scc)
197 0 <= scc && scc < nof_sccs,
"Could not determine SCC for instruction");
202 for(
size_t scc_id = 0; scc_id < nof_sccs; scc_id++)
204 auto size = scc_size[scc_id];
210 mstream <<
"Found CFG SCC with size " << size << messaget::eom;
211 for(const auto &node_id : node_to_scc)
213 if(node_to_scc[node_id] == scc_id)
215 const auto &pc = cfg[node_id].PC;
217 mstream << messaget::eom;
229 " (assigned by the contract of ";
Class that provides messages with a built-in verbosity 'level'.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
exprt all_dereferences_are_valid(const exprt &expr, const namespacet &ns)
Generate a validity check over all dereferences in an expression.
const irep_idt & get_function() const
void insert_before_swap_and_advance(goto_programt &destination, goto_programt::targett &target, goto_programt &payload)
Insert a goto program before a target instruction iterator and advance the iterator.
exprt conjunction(const exprt::operandst &op)
1) generates a conjunction for two or more operands 2) for one operand, returns the operand 3) return...
exprt good_pointer_def(const exprt &pointer, const namespacet &ns)
const dereference_exprt & to_dereference_expr(const exprt &expr)
Cast an exprt to a dereference_exprt.
The type of an expression, extends irept.
exprt generate_lexicographic_less_than_check(const std::vector< symbol_exprt > &lhs, const std::vector< symbol_exprt > &rhs)
Generate a lexicographic less-than comparison over ordered tuples.
irep_idt make_assigns_clause_replacement_tracking_comment(const exprt &target, const irep_idt &function_id, const namespacet &ns)
Returns an irep_idt that essentially says that target was assigned by the contract of function_id.
virtual void append_scalar_havoc_code_for_expr(const source_locationt location, const exprt &expr, goto_programt &dest) const
Append goto instructions to havoc the value of expr
targett add(instructiont &&instruction)
Adds a given instruction at the end.
Base class for all expressions.
virtual void append_havoc_code_for_expr(const source_locationt location, const exprt &expr, goto_programt &dest) const
Append goto instructions to havoc a single expression expr
bool is_assigns_clause_replacement_tracking_comment(const irep_idt &comment)
Returns true if the given comment matches the type of comments created by make_assigns_clause_replace...
static instructiont make_goto(targett _target, const source_locationt &l=source_locationt::nil())
bool is_false() const
Return whether the expression is a constant representing false.
static void append_safe_havoc_code_for_expr(const source_locationt location, const namespacet &ns, const exprt &expr, goto_programt &dest, const std::function< void()> &havoc_code_impl)
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
const pointer_object_exprt & to_pointer_object_expr(const exprt &expr)
Cast an exprt to a pointer_object_exprt.
exprt disjunction(const exprt::operandst &op)
1) generates a disjunction for two or more operands 2) for one operand, returns the operand 3) return...
void simplify_gotos(goto_programt &goto_program, namespacet &ns)
Turns goto instructions IF cond GOTO label where the condition statically simplifies to false into SK...
const std::string & id2string(const irep_idt &d)
void append_object_havoc_code_for_expr(const source_locationt location, const exprt &expr, goto_programt &dest) const override
Append goto instructions to havoc the underlying object of expr
static instructiont make_skip(const source_locationt &l=source_locationt::nil())
#define PRECONDITION(CONDITION)
The symbol table base class interface.
virtual void append_object_havoc_code_for_expr(const source_locationt location, const exprt &expr, goto_programt &dest) const
Append goto instructions to havoc the underlying object of expr
exprt simplify_expr(exprt src, const namespacet &ns)
const irep_idt & id() const
std::vector< exprt > operandst
The Boolean constant false.
void append_scalar_havoc_code_for_expr(const source_locationt location, const exprt &expr, goto_programt &dest) const override
Append goto instructions to havoc the value of expr
void destructive_append(goto_programt &p)
Appends the given program p to *this. p is destroyed.
std::size_t SCCs(std::vector< node_indext > &subgraph_nr) const
Computes strongly-connected components of a graph and yields a vector expressing a mapping from nodes...
instructionst instructions
The list of instructions in the goto program.
bool is_loop_free(const goto_programt &goto_program, namespacet &ns, messaget &log)
Returns true iff the given program is loop-free, i.e.
A base class for relations, i.e., binary predicates whose two operands have the same type.
void conditional_output(mstreamt &mstream, const std::function< void(mstreamt &)> &output_generator) const
Generate output to message_stream using output_generator if the configured verbosity is at least as h...
A generic container class for the GOTO intermediate representation of one function.
void append_havoc_code_for_expr(const source_locationt location, const exprt &expr, goto_programt &dest) const override
Append goto instructions to havoc a single expression expr
const symbolt & new_tmp_symbol(const typet &type, const source_locationt &location, const irep_idt &mode, symbol_table_baset &symtab, std::string suffix, bool is_auxiliary)
Adds a fresh and uniquely named symbol to the symbol table.
#define INVARIANT(CONDITION, REASON)
This macro uses the wrapper function 'invariant_violated_string'.
void insert_before_swap(targett target)
Insertion that preserves jumps to "target".
static const char ASSIGNS_CLAUSE_REPLACEMENT_TRACKING[]
Prefix for comments added to track assigns clause replacement.
static std::string comment(const rw_set_baset::entryt &entry, bool write)
std::string from_expr(const namespacet &ns, const irep_idt &identifier, const exprt &expr)
symbolt & get_fresh_aux_symbol(const typet &type, const std::string &name_prefix, const std::string &basename_prefix, const source_locationt &source_location, const irep_idt &symbol_mode, const namespacet &ns, symbol_table_baset &symbol_table)
Installs a fresh-named symbol with respect to the given namespace ns with the requested name pattern ...
instructionst::iterator targett