33 std::cout <<
"Checking following program for satness:\n";
39 auto get_goto_function =
40 [
this, &this_goto_function](
43 return this_goto_function;
61 std::cout <<
"Trivially unsat\n";
69 std::cout <<
"Finished symex, invoking decision procedure.\n";
75 throw "error running the SMT solver";
98 new_instructions.begin(),
99 new_instructions.end());
121 if(expr.
id()==ID_equal ||
122 expr.
id()==ID_notequal ||
129 exprt &lhs = rel_expr.lhs();
130 exprt &rhs = rel_expr.rhs();
135 rel_expr.rhs().swap(typecast);
142 for(goto_programt::instructionst::iterator it=
instructions.begin();
148 if(it->assign_lhs().type() != it->assign_rhs().type())
151 it->assign_rhs_nonconst() = typecast;
154 else if(it->is_assume() || it->is_assert())
163 for(patht::iterator it=path.begin();
167 if(it->loc->is_assign() || it->loc->is_assume())
171 else if(it->loc->is_goto())
173 if(it->guard.id()!=ID_nil)
178 else if(it->loc->is_assert())
211 if(t->is_backwards_goto())
214 t->targets.push_back(end);
void slice(symex_bmct &symex, symex_target_equationt &symex_target_equation, const namespacet &ns, const optionst &options, ui_message_handlert &ui_message_handler)
static exprt guard(const exprt::operandst &guards, exprt cond)
virtual exprt get(const exprt &) const =0
Return expr with variables replaced by values from satisfying assignment if available.
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Base class for all expressions.
typet & type()
Return the type of the expression.
The Boolean constant false.
function_mapt function_map
::goto_functiont goto_functiont
static irep_idt entry_point()
Get the identifier of the entry point to a goto model.
A goto function, consisting of function body (see body) and parameter identifiers (see parameter_iden...
A generic container class for the GOTO intermediate representation of one function.
static instructiont make_assumption(const exprt &g, const source_locationt &l=source_locationt::nil())
instructionst instructions
The list of instructions in the goto program.
void copy_from(const goto_programt &src)
Copy a full goto program, preserving targets.
void update()
Update all indices.
std::ostream & output(std::ostream &out) const
Output goto-program to given stream.
static instructiont make_end_function(const source_locationt &l=source_locationt::nil())
instructionst::iterator targett
void destructive_append(goto_programt &p)
Appends the given program p to *this. p is destroyed.
static instructiont make_assignment(const code_assignt &_code, const source_locationt &l=source_locationt::nil())
Create an assignment instruction.
std::list< instructiont > instructionst
static instructiont make_skip(const source_locationt &l=source_locationt::nil())
targett add(instructiont &&instruction)
Adds a given instruction at the end.
virtual symbol_tablet symex_with_state(statet &state, const get_goto_functiont &get_goto_functions)
Symbolically execute the entire program starting from entry point.
const irep_idt & id() const
void set_option(const std::string &option, const bool value)
goto_functionst functions
bool check_sat(bool do_slice, guard_managert &guard_manager)
scratch_program_symext symex
targett assume(const exprt &guard)
void append_loop(goto_programt &program, goto_programt::targett loop_header)
targett assign(const exprt &lhs, const exprt &rhs)
symbol_tablet symex_symbol_table
static optionst get_default_options()
void append(goto_programt::instructionst &instructions)
decision_proceduret * checker
std::unique_ptr< goto_symex_statet > symex_state
exprt eval(const exprt &e)
void append_path(patht &path)
symex_target_equationt equation
std::size_t count_assertions() const
void convert(decision_proceduret &decision_procedure)
Interface method to initiate the conversion into a decision procedure format.
Semantic type conversion.
Decision Procedure Interface.
#define Forall_operands(it, expr)
std::list< path_nodet > patht
void remove_skip(goto_programt &goto_program, goto_programt::targett begin, goto_programt::targett end)
remove unnecessary skip statements
static void fix_types(exprt &expr)
#define UNREACHABLE
This should be used to mark dead code.
const binary_relation_exprt & to_binary_relation_expr(const exprt &expr)
Cast an exprt to a binary_relation_exprt.
This is unused by this implementation of guards, but can be used by other implementations of the same...
std::unique_ptr< statet > initialize_entry_point_state(const get_goto_functiont &get_goto_function)