63 if(symbol.
type.
get_bool(ID_C_no_initialization_required))
88 goto_functionst::function_mapt::iterator fct_entry =
96 if(instruction.is_assign())
105 instruction.assign_rhs_nonconst() = nondet;
110 else if(instruction.is_function_call())
145 const std::set<std::string> &except_values)
148 std::set<std::string> to_exclude;
150 for(
auto const &except : except_values)
152 const bool file_prefix_found = except.find(
":") != std::string::npos;
154 if(file_prefix_found)
156 to_exclude.insert(except);
159 to_exclude.insert(except.substr(2, except.length() - 2));
163 to_exclude.insert(
"./" + except);
178 symbol_it != symbol_table.
end();
181 symbolt &symbol = symbol_it.get_writeable_symbol();
184 if(to_exclude.find(qualified_name) != to_exclude.end())
186 symbol.
value.
set(ID_C_no_nondet_initialization, 1);
205 const auto regex_matcher = std::regex(regex);
209 symbol_it != symbol_table.
end();
212 symbolt &symbol = symbol_it.get_writeable_symbol();
215 if(!std::regex_match(qualified_name, regex_matcher))
217 symbol.
value.
set(ID_C_no_nondet_initialization, 1);
const T & as_const(T &value)
Return a reference to the same object but ensures the type is const.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
bool starts_with(const char *s) const
equivalent of as_string().starts_with(s)
typet & type()
Return the type of the expression.
function_mapt function_map
symbol_tablet symbol_table
Symbol table.
goto_functionst goto_functions
GOTO functions.
A generic container class for the GOTO intermediate representation of one function.
instructionst instructions
The list of instructions in the goto program.
bool get_bool(const irep_idt &name) const
void set(const irep_idt &name, const irep_idt &value)
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().
const symbol_table_baset & get_symbol_table() const
Return first symbol table registered with the namespace.
A side_effect_exprt that returns a non-deterministically chosen value.
const irep_idt & get_file() const
Expression to hold a symbol (variable)
const irep_idt & get_identifier() const
symbolt & get_writeable_ref(const irep_idt &name)
Find a symbol in the symbol table for read-write access.
bool has_symbol(const irep_idt &name) const
Check whether a symbol exists in the symbol table.
virtual iteratort begin() override
virtual iteratort end() override
const irep_idt & display_name() const
Return language specific display name if present.
source_locationt location
Source code location of definition of symbol.
class symbol_exprt symbol_expr() const
Produces a symbol_exprt for a symbol.
typet type
Type of symbol.
exprt value
Initial value of symbol.
const source_locationt & source_location() const
bool has_prefix(const std::string &s, const std::string &prefix)
const std::string & id2string(const irep_idt &d)
void nondet_static_matching(goto_modelt &goto_model, const std::string ®ex)
Nondeterministically initializes global scope variables that match the given regex.
bool is_nondet_initializable_static(const symbol_exprt &symbol_expr, const namespacet &ns)
See the return.
static void nondet_static(const namespacet &ns, goto_modelt &goto_model, const irep_idt &fct_name)
Nondeterministically initializes global scope variables in a goto-function.
Nondeterministically initializes global scope variables, except for constants (such as string literal...
#define CHECK_RETURN(CONDITION)
#define INITIALIZE_FUNCTION
const symbol_exprt & to_symbol_expr(const exprt &expr)
Cast an exprt to a symbol_exprt.
bool is_constant_or_has_constant_components(const typet &type, const namespacet &ns)
Identify whether a given type is constant itself or contains constant components.