98 if(
auto struct_tag = type_try_dynamic_cast<struct_tag_typet>(src))
100 else if(
auto union_tag = type_try_dynamic_cast<union_tag_typet>(src))
102 else if(
auto enum_tag = type_try_dynamic_cast<c_enum_tag_typet>(src))
117 (expr.
id() == ID_symbol &&
124 expr.
swap(nondet_expr);
131 if(expr.
id() != ID_symbol)
144 const auto &model_symbol = ns.
lookup(it->second);
174 if(expr.
id()==ID_symbol ||
175 expr.
id()==ID_dereference)
198 else if(expr.
id()==ID_index)
203 else if(expr.
id()==ID_member)
208 else if(expr.
id()==ID_dereference)
245 for(exprt::operandst::iterator
246 it=code_function_call.
arguments().begin();
247 it!=code_function_call.
arguments().end();
263 std::advance(i_it, pre_size);
267 std::advance(i_it, post_size);
279 "given symbol `" +
id2string(
id) +
"` not found in symbol table",
287 "` does not represent a volatile variable "
288 "with static lifetime",
309 "given model name " +
id2string(
id) +
" not found in symbol table",
316 "symbol `" +
id2string(
id) +
"` is not a function",
322 if(variable.
type != code_type.return_type())
325 "return type of model `" +
id2string(
id) +
326 "` is not compatible with the "
327 "type of the modelled variable " +
332 if(!code_type.parameters().empty())
335 "model `" +
id2string(
id) +
"` must not take parameters ",
356 const auto &variable_list =
371 for(
const auto &s : model_list)
373 std::string variable;
383 "cannot split argument `" + s +
"` into variable name and model name",
392 "conflicting options for variable `" + variable +
"`",
398 const auto p =
variable_models.insert(std::make_pair(variable, model));
400 if(!p.second && p.first->second != model)
403 "conflicting models for variable `" + variable +
"`",
417 const bool nondet_volatile_variable_opt =
419 const bool nondet_volatile_model_opt =
423 nondet_volatile_opt &&
424 (nondet_volatile_variable_opt || nondet_volatile_model_opt))
434 if(nondet_volatile_opt)
440 if(nondet_volatile_variable_opt)
447 if(nondet_volatile_model_opt)
virtual bool isset(char option) const
const std::list< std::string > & get_values(const std::string &option) const
goto_instruction_codet representation of a function call statement.
const typet & return_type() const
Thrown when failing to deserialize a value from some low level format, like JSON or raw bytes.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
const source_locationt & source_location() const
typet & type()
Return the type of the expression.
function_mapt function_map
symbol_tablet symbol_table
Symbol table.
goto_functionst goto_functions
GOTO functions.
This class represents an instruction in the GOTO intermediate representation.
bool has_condition() const
Does this instruction have a condition?
exprt & assign_rhs_nonconst()
Get the rhs of the assignment for ASSIGN.
exprt & condition_nonconst()
Get the condition of gotos, assume, assert.
goto_instruction_codet & code_nonconst()
Set the code represented by this instruction.
bool is_function_call() const
exprt & assign_lhs_nonconst()
Get the lhs of the assignment for ASSIGN.
A generic container class for the GOTO intermediate representation of one function.
instructionst instructions
The list of instructions in the goto program.
static instructiont make_dead(const symbol_exprt &symbol, const source_locationt &l=source_locationt::nil())
void insert_before_swap(targett target)
Insertion that preserves jumps to "target".
void destructive_insert(const_targett target, goto_programt &p)
Inserts the given program p before target.
static instructiont make_function_call(const code_function_callt &_code, const source_locationt &l=source_locationt::nil())
Create a function call instruction.
static instructiont make_decl(const symbol_exprt &symbol, const source_locationt &l=source_locationt::nil())
Thrown when users pass incorrect command line arguments, for example passing no files to analysis or ...
bool get_bool(const irep_idt &name) const
void remove(const irep_idt &name)
const irep_idt & id() const
const union_typet & follow_tag(const union_tag_typet &) const
Follow type tag of union type.
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().
void nondet_volatile(symbol_table_baset &symbol_table, goto_programt &goto_program)
void typecheck_model(const irep_idt &id, const symbolt &variable, const namespacet &ns)
std::set< irep_idt > nondet_variables
static bool is_volatile(const namespacet &ns, const typet &src)
nondet_volatilet(goto_modelt &goto_model, const optionst &options)
void handle_volatile_expression(exprt &expr, const namespacet &ns, goto_programt &pre, goto_programt &post)
std::map< irep_idt, irep_idt > variable_models
const symbolt & typecheck_variable(const irep_idt &id, const namespacet &ns)
void nondet_volatile_rhs(const symbol_table_baset &symbol_table, exprt &expr, goto_programt &pre, goto_programt &post)
void typecheck_options(const optionst &options)
void nondet_volatile_lhs(const symbol_table_baset &symbol_table, exprt &expr, goto_programt &pre, goto_programt &post)
bool is_set(const std::string &option) const
N.B. opts.is_set("foo") does not imply opts.get_bool_option("foo")
bool get_bool_option(const std::string &option) const
void set_option(const std::string &option, const bool value)
const value_listt & get_list_option(const std::string &option) const
A side_effect_exprt that returns a non-deterministically chosen value.
const irep_idt & get_identifier() const
The symbol table base class interface.
class symbol_exprt symbol_expr() const
Produces a symbol_exprt for a symbol.
typet type
Type of symbol.
irep_idt name
The unique identifier.
The type of an expression, extends irept.
#define Forall_operands(it, 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 ...
Fresh auxiliary symbol creation.
const code_function_callt & to_code_function_call(const goto_instruction_codet &code)
const std::string & id2string(const irep_idt &d)
void parse_nondet_volatile_options(const cmdlinet &cmdline, optionst &options)
void nondet_volatile(goto_modelt &goto_model, const optionst &options)
Havoc reads from volatile expressions, if enabled in the options.
#define NONDET_VOLATILE_MODEL_OPT
#define NONDET_VOLATILE_OPT
#define NONDET_VOLATILE_VARIABLE_OPT
API to expression classes for Pointers.
const dereference_exprt & to_dereference_expr(const exprt &expr)
Cast an exprt to a dereference_exprt.
#define PRECONDITION(CONDITION)
API to expression classes.
const if_exprt & to_if_expr(const exprt &expr)
Cast an exprt to an if_exprt.
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
const member_exprt & to_member_expr(const exprt &expr)
Cast an exprt to a member_exprt.
const index_exprt & to_index_expr(const exprt &expr)
Cast an exprt to an index_exprt.
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.
void split_string(const std::string &s, char delim, std::vector< std::string > &result, bool strip, bool remove_empty)