Go to the documentation of this file.
28 #define L_M_LAST_ARG(x) , x
31 #define L_M_LAST_ARG(x)
70 const symbol_tablet::symbolst::const_iterator it=
79 new_symbol.
name=identifier;
95 for(std::list<irep_idt>::const_iterator
117 result+=
" data race on ";
128 identifier ==
CPROVER_PREFIX "alloc_size" || identifier ==
"stdin" ||
129 identifier ==
"stdout" || identifier ==
"stderr" ||
130 identifier ==
"sys_nerr" ||
141 for(rw_set_baset::entriest::const_iterator
145 if(
is_shared(ns, it->second.symbol_expr))
148 for(rw_set_baset::entriest::const_iterator
152 if(
is_shared(ns, it->second.symbol_expr))
183 ns, value_sets, function_id, i_it
L_M_LAST_ARG(local_may));
189 original_instruction.
swap(instruction);
196 for(
const auto &w_entry : rw_set.
w_entries)
198 if(!
is_shared(ns, w_entry.second.symbol_expr))
205 w_entry.second.guard,
213 *t=original_instruction;
218 for(
const auto &w_entry : rw_set.
w_entries)
220 if(!
is_shared(ns, w_entry.second.symbol_expr))
233 for(
const auto &r_entry : rw_set.
r_entries)
235 if(!
is_shared(ns, r_entry.second.symbol_expr))
243 t->source_location_nonconst().set_comment(
244 comment(r_entry.second,
false));
248 for(
const auto &w_entry : rw_set.
w_entries)
250 if(!
is_shared(ns, w_entry.second.symbol_expr))
258 t->source_location_nonconst().set_comment(
259 comment(w_entry.second,
true));
285 L_M_ARG(goto_function) goto_program,
289 goto_program.update();
308 L_M_ARG(gf_entry.second) gf_entry.second.body,
314 goto_functionst::function_mapt::iterator
319 throw "race check instrumentation needs an entry point";
#define Forall_goto_program_instructions(it, program)
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
void swap(instructiont &instruction)
Swap two instructions.
typet type
Type of symbol.
void remove_skip(goto_programt &goto_program, goto_programt::targett begin, goto_programt::targett end)
remove unnecessary skip statements
std::list< irep_idt > w_guards
static void race_check(value_setst &value_sets, symbol_tablet &symbol_table, const irep_idt &function_id, goto_programt &goto_program, w_guardst &w_guards)
Base class for all expressions.
irep_idt base_name
Base (non-scoped) name.
function_mapt function_map
Expression to hold a symbol (variable)
const exprt get_assertion(const rw_set_baset::entryt &entry)
static instructiont make_assignment(const code_assignt &_code, const source_locationt &l=source_locationt::nil())
Create an assignment instruction.
static bool is_shared(const namespacet &ns, const symbol_exprt &symbol_expr)
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().
targett insert_before(const_targett target)
Insertion before the instruction pointed-to by the given instruction iterator target.
static instructiont make_assertion(const exprt &g, const source_locationt &l=source_locationt::nil())
bool has_prefix(const std::string &s, const std::string &prefix)
const std::string & id2string(const irep_idt &d)
const source_locationt & source_location() const
static instructiont make_skip(const source_locationt &l=source_locationt::nil())
const symbolt & get_guard_symbol(const irep_idt &object)
#define SYMEX_DYNAMIC_PREFIX
const irep_idt & get_identifier() const
class symbol_exprt symbol_expr() const
Produces a symbol_exprt for a symbol.
#define INITIALIZE_FUNCTION
const exprt get_w_guard_expr(const rw_set_baset::entryt &entry)
The Boolean constant false.
symbol_tablet & symbol_table
int main(int argc, char *argv[])
virtual bool move(symbolt &symbol, symbolt *&new_symbol) override
Move a symbol into the symbol table.
::goto_functiont goto_functiont
instructionst instructions
The list of instructions in the goto program.
exprt value
Initial value of symbol.
goto_functionst goto_functions
GOTO functions.
const symbolst & symbols
Read-only field, used to look up symbols given their names.
A generic container class for the GOTO intermediate representation of one function.
static bool has_shared_entries(const namespacet &ns, const rw_set_baset &rw_set)
void add_initialization(goto_programt &goto_program) const
static irep_idt entry_point()
Get the identifier of the entry point to a goto model.
static std::string comment(const rw_set_baset::entryt &entry, bool write)
This class represents an instruction in the GOTO intermediate representation.
symbol_tablet symbol_table
Symbol table.
irep_idt name
The unique identifier.
w_guardst(symbol_tablet &_symbol_table)
const exprt get_guard_symbol_expr(const irep_idt &object)
instructionst::iterator targett