Go to the documentation of this file.
49 std::size_t function_calls;
68 exprt cond = i_it->condition();
77 i_it->condition_nonconst() = cond;
80 else if(i_it->is_assume())
82 exprt cond = i_it->condition();
91 i_it->condition_nonconst() = cond;
94 else if(i_it->is_goto())
96 exprt cond = i_it->condition();
105 i_it->condition_nonconst() = cond;
108 else if(i_it->is_assign())
116 i_it->assign_lhs_nonconst(), ns);
119 i_it->assign_rhs_nonconst(), ns);
121 if(unchanged_lhs && unchanged_rhs)
122 unmodified.assigns++;
124 simplified.assigns++;
126 else if(i_it->is_function_call())
129 auto call_function =
as_const(*i_it).call_function();
130 auto call_arguments =
as_const(*i_it).call_arguments();
135 for(
auto &o : call_arguments)
139 unmodified.function_calls++;
142 simplified.function_calls++;
143 i_it->call_function() = std::move(call_function);
144 i_it->call_arguments() = std::move(call_arguments);
153 m.
status() <<
"Simplified: "
154 <<
" assert: " << simplified.asserts
155 <<
", assume: " << simplified.assumes
156 <<
", goto: " << simplified.gotos
157 <<
", assigns: " << simplified.assigns
158 <<
", function calls: " << simplified.function_calls
161 <<
" assert: " << unmodified.asserts
162 <<
", assume: " << unmodified.assumes
163 <<
", goto: " << unmodified.gotos
164 <<
", assigns: " << unmodified.assigns
165 <<
", function calls: " << unmodified.function_calls
Class that provides messages with a built-in verbosity 'level'.
#define Forall_goto_program_instructions(it, program)
bool static_simplifier(goto_modelt &goto_model, const ai_baset &ai, const optionst &options, message_handlert &message_handler, std::ostream &out)
Simplifies the program using the information in the abstract domain.
mstreamt & status() const
bool write_goto_binary(std::ostream &out, const symbol_tablet &symbol_table, const goto_functionst &goto_functions, irep_serializationt &irepconverter)
Writes a goto program to disc, using goto binary format.
void remove_skip(goto_programt &goto_program, goto_programt::targett begin, goto_programt::targett end)
remove unnecessary skip statements
Base class for all expressions.
virtual cstate_ptrt abstract_state_before(locationt l) const
Get a copy of the abstract state before the given instruction, without needing to know what kind of d...
function_mapt function_map
void remove_unreachable(goto_programt &goto_program)
remove unreachable code
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
const T & as_const(T &value)
Return a reference to the same object but ensures the type is const.
const symbol_table_baset & get_symbol_table() const
Return first symbol table registered with the namespace.
goto_functionst goto_functions
GOTO functions.
bool get_bool_option(const std::string &option) const
This is the basic interface of the abstract interpreter with default implementations of the core func...
mstreamt & progress() const
symbol_tablet symbol_table
Symbol table.
void restore_returns(goto_modelt &goto_model)
restores return statements