Go to the documentation of this file.
98 src.
id() == ID_struct_tag || src.
id() == ID_union_tag ||
99 src.
id() == ID_c_enum_tag)
116 (expr.
id() == ID_symbol &&
123 expr.
swap(nondet_expr);
130 if(expr.
id() != ID_symbol)
143 const auto &model_symbol = ns.
lookup(it->second);
173 if(expr.
id()==ID_symbol ||
174 expr.
id()==ID_dereference)
197 else if(expr.
id()==ID_index)
202 else if(expr.
id()==ID_member)
207 else if(expr.
id()==ID_dereference)
244 for(exprt::operandst::iterator
245 it=code_function_call.
arguments().begin();
246 it!=code_function_call.
arguments().end();
262 std::advance(i_it, pre_size);
266 std::advance(i_it, post_size);
278 "given symbol `" +
id2string(
id) +
"` not found in symbol table",
286 "` does not represent a volatile variable "
287 "with static lifetime",
308 "given model name " +
id2string(
id) +
" not found in symbol table",
315 "symbol `" +
id2string(
id) +
"` is not a function",
321 if(variable.
type != code_type.return_type())
324 "return type of model `" +
id2string(
id) +
325 "` is not compatible with the "
326 "type of the modelled variable " +
331 if(!code_type.parameters().empty())
334 "model `" +
id2string(
id) +
"` must not take parameters ",
355 const auto &variable_list =
370 for(
const auto &s : model_list)
372 std::string variable;
382 "cannot split argument `" + s +
"` into variable name and model name",
391 "conflicting options for variable `" + variable +
"`",
397 const auto p =
variable_models.insert(std::make_pair(variable, model));
399 if(!p.second && p.first->second != model)
402 "conflicting models for variable `" + variable +
"`",
416 const bool nondet_volatile_variable_opt =
418 const bool nondet_volatile_model_opt =
422 nondet_volatile_opt &&
423 (nondet_volatile_variable_opt || nondet_volatile_model_opt))
433 if(nondet_volatile_opt)
439 if(nondet_volatile_variable_opt)
446 if(nondet_volatile_model_opt)
void typecheck_model(const irep_idt &id, const symbolt &variable, const namespacet &ns)
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
void typecheck_options(const optionst &options)
const code_function_callt & to_code_function_call(const goto_instruction_codet &code)
#define Forall_operands(it, expr)
std::map< irep_idt, irep_idt > variable_models
static instructiont make_dead(const symbol_exprt &symbol, const source_locationt &l=source_locationt::nil())
#define NONDET_VOLATILE_OPT
virtual bool isset(char option) const
const dereference_exprt & to_dereference_expr(const exprt &expr)
Cast an exprt to a dereference_exprt.
The type of an expression, extends irept.
const index_exprt & to_index_expr(const exprt &expr)
Cast an exprt to an index_exprt.
const if_exprt & to_if_expr(const exprt &expr)
Cast an exprt to an if_exprt.
typet type
Type of symbol.
Thrown when failing to deserialize a value from some low level format, like JSON or raw bytes.
exprt & assign_lhs_nonconst()
Get the lhs of the assignment for ASSIGN.
Base class for all expressions.
void nondet_volatile_lhs(const symbol_tablet &symbol_table, exprt &expr, goto_programt &pre, goto_programt &post)
void set_option(const std::string &option, const bool value)
static bool is_volatile(const namespacet &ns, const typet &src)
exprt & condition_nonconst()
Get the condition of gotos, assume, assert.
function_mapt function_map
goto_instruction_codet & code_nonconst()
Set the code represented by this instruction.
static instructiont make_decl(const symbol_exprt &symbol, const source_locationt &l=source_locationt::nil())
void nondet_volatile_rhs(const symbol_tablet &symbol_table, exprt &expr, goto_programt &pre, goto_programt &post)
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
#define NONDET_VOLATILE_VARIABLE_OPT
static instructiont make_function_call(const code_function_callt &_code, const source_locationt &l=source_locationt::nil())
Create a function call instruction.
typet & type()
Return the type of the expression.
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
goto_instruction_codet representation of a function call statement.
void split_string(const std::string &s, char delim, std::vector< std::string > &result, bool strip, bool remove_empty)
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
void destructive_insert(const_targett target, goto_programt &p)
Inserts the given program p before target.
const std::string & id2string(const irep_idt &d)
static optionalt< smt_termt > get_identifier(const exprt &expr, const std::unordered_map< exprt, smt_identifier_termt, irep_hash > &expression_handle_identifiers, const std::unordered_map< exprt, smt_identifier_termt, irep_hash > &expression_identifiers)
bool is_set(const std::string &option) const
N.B. opts.is_set("foo") does not imply opts.get_bool_option("foo")
#define PRECONDITION(CONDITION)
const irep_idt & get_identifier() const
class symbol_exprt symbol_expr() const
Produces a symbol_exprt for a symbol.
void handle_volatile_expression(exprt &expr, const namespacet &ns, goto_programt &pre, goto_programt &post)
bool has_condition() const
Does this instruction have a condition?
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
const irep_idt & id() const
void nondet_volatile(symbol_tablet &symbol_table, goto_programt &goto_program)
void parse_nondet_volatile_options(const cmdlinet &cmdline, optionst &options)
nondet_volatilet(goto_modelt &goto_model, const optionst &options)
A side_effect_exprt that returns a non-deterministically chosen value.
std::set< irep_idt > nondet_variables
instructionst instructions
The list of instructions in the goto program.
goto_functionst goto_functions
GOTO functions.
const typet & follow(const typet &) const
Resolve type symbol to the type it points to.
exprt & assign_rhs_nonconst()
Get the rhs of the assignment for ASSIGN.
bool get_bool_option(const std::string &option) const
const symbolt & typecheck_variable(const irep_idt &id, const namespacet &ns)
A generic container class for the GOTO intermediate representation of one function.
const typet & return_type() const
const member_exprt & to_member_expr(const exprt &expr)
Cast an exprt to a member_exprt.
#define NONDET_VOLATILE_MODEL_OPT
void remove(const irep_idt &name)
void insert_before_swap(targett target)
Insertion that preserves jumps to "target".
bool is_function_call() const
void nondet_volatile(goto_modelt &goto_model, const optionst &options)
Havoc reads from volatile expressions, if enabled in the options.
Thrown when users pass incorrect command line arguments, for example passing no files to analysis or ...
const std::list< std::string > & get_values(const std::string &option) const
This class represents an instruction in the GOTO intermediate representation.
const source_locationt & source_location() const
symbol_tablet symbol_table
Symbol table.
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 ...
const value_listt & get_list_option(const std::string &option) const
irep_idt name
The unique identifier.
bool get_bool(const irep_idt &name) const