34 unsigned atomic_section_id,
53 unsigned atomic_section_id,
98 unsigned atomic_section_id,
103 SSA_step.
guard=guard;
114 unsigned atomic_section_id,
119 SSA_step.
guard=guard;
131 const exprt &ssa_full_lhs,
132 const exprt &original_full_lhs,
133 const exprt &ssa_rhs,
142 SSA_step.
guard=guard;
170 SSA_step.
guard=guard;
202 SSA_step.
guard=guard;
218 SSA_step.
guard=guard;
235 SSA_step.
guard=guard;
248 const std::list<exprt> &args)
253 SSA_step.
guard=guard;
257 SSA_step.
io_id=output_id;
268 const std::list<exprt> &args)
273 SSA_step.
guard=guard;
277 SSA_step.
io_id=output_id;
289 const std::list<exprt> &args)
294 SSA_step.
guard=guard;
298 SSA_step.
io_id=input_id;
312 SSA_step.
guard=guard;
324 const std::string &msg,
330 SSA_step.
guard=guard;
348 SSA_step.
guard=guard;
359 const std::string &msg,
405 if(step.is_assignment() && !step.ignore)
408 decision_procedure.
debug(),
410 std::ostringstream oss;
427 if(step.is_decl() && !step.ignore)
433 prop_conv.
convert(step.cond_expr);
439 "Error converting decls for step", step));
459 std::ostringstream oss;
466 step.guard_literal = prop_conv.
convert(step.guard);
472 "Error converting guard for step", step));
494 std::ostringstream oss;
501 step.cond_literal = prop_conv.
convert(step.cond_expr);
507 "Error converting assumptions for step", step));
530 std::ostringstream oss;
537 step.cond_literal = prop_conv.
convert(step.cond_expr);
543 "Error converting goto instructions for step", step));
558 if(step.is_constraint())
563 decision_procedure.
debug(),
565 std::ostringstream oss;
578 "Error converting constraints for step", step));
595 if(number_of_assertions==0)
598 if(number_of_assertions==1)
608 else if(step.is_assume())
618 disjuncts.reserve(number_of_assertions);
633 step.cond_literal = prop_conv.
convert(implication);
639 "Error converting assertions for step", step));
645 else if(step.is_assume())
667 std::size_t io_count=0;
672 for(
const auto &arg : step.io_args)
674 if(arg.is_constant() ||
675 arg.id()==ID_string_constant)
676 step.converted_io_args.push_back(arg);
680 symbol.
type()=arg.type();
686 dec_proc.
set_to(eq,
true);
687 step.converted_io_args.push_back(symbol);
705 for(
auto &step : SSA_step.
io_args)
717 step.output(ns, out);
718 out <<
"--------------\n";
724 std::ostream &out)
const 728 out <<
"Thread " <<
source.thread_nr;
730 if(
source.pc->source_location.is_not_nil())
731 out <<
" " <<
source.pc->source_location <<
'\n';
745 out <<
"LOCATION" <<
'\n';
break;
747 out <<
"INPUT" <<
'\n';
break;
749 out <<
"OUTPUT" <<
'\n';
break;
752 out <<
"DECL" <<
'\n';
757 out <<
"ASSIGNMENT (";
767 out <<
"VISIBLE_ACTUAL_PARAMETER";
770 out <<
"HIDDEN_ACTUAL_PARAMETER";
787 out <<
"DEAD\n";
break;
789 out <<
"FUNCTION_CALL\n";
break;
791 out <<
"FUNCTION_RETURN\n";
break;
793 out <<
"CONSTRAINT\n";
break;
795 out <<
"SHARED READ\n";
break;
797 out <<
"SHARED WRITE\n";
break;
799 out <<
"ATOMIC_BEGIN\n";
break;
801 out <<
"AUTOMIC_END\n";
break;
803 out <<
"SPAWN\n";
break;
805 out <<
"MEMORY_BARRIER\n";
break;
829 out <<
"Thread " << source.thread_nr;
831 if(source.pc->source_location.is_not_nil())
832 out <<
" " << source.pc->source_location <<
'\n';
840 out <<
"ASSERT " <<
format(cond_expr) <<
'\n';
843 out <<
"ASSUME " <<
format(cond_expr) <<
'\n';
846 out <<
"LOCATION" <<
'\n';
849 out <<
"INPUT" <<
'\n';
852 out <<
"OUTPUT" <<
'\n';
856 out <<
"DECL" <<
'\n';
857 out <<
format(ssa_lhs) <<
'\n';
861 out <<
"ASSIGNMENT (";
862 switch(assignment_type)
871 out <<
"VISIBLE_ACTUAL_PARAMETER";
874 out <<
"HIDDEN_ACTUAL_PARAMETER";
894 out <<
"FUNCTION_CALL\n";
897 out <<
"FUNCTION_RETURN\n";
900 out <<
"CONSTRAINT\n";
903 out <<
"SHARED READ\n";
906 out <<
"SHARED WRITE\n";
909 out <<
"ATOMIC_BEGIN\n";
912 out <<
"AUTOMIC_END\n";
918 out <<
"MEMORY_BARRIER\n";
921 out <<
"IF " <<
format(cond_expr) <<
" GOTO\n";
928 if(is_assert() || is_assume() || is_assignment() || is_constraint())
929 out <<
format(cond_expr) <<
'\n';
931 if(is_assert() || is_constraint())
934 if(is_shared_read() || is_shared_write())
935 out <<
format(ssa_lhs) <<
'\n';
937 out <<
"Guard: " <<
format(guard) <<
'\n';
virtual void spawn(const exprt &guard, const sourcet &source)
spawn a new thread
virtual void function_call(const exprt &guard, const irep_idt &identifier, const sourcet &source)
just record a location
virtual void memory_barrier(const exprt &guard, const sourcet &source)
Generate Equation using Symbolic Execution.
void convert(prop_convt &prop_conv)
unsigned atomic_section_id
std::string comment(const rw_set_baset::entryt &entry, bool write)
void convert_assumptions(prop_convt &prop_conv)
converts assumptions
bool is_shared_read() const
std::string from_expr(const namespacet &ns, const irep_idt &identifier, const exprt &expr)
virtual void assumption(const exprt &guard, const exprt &cond, const sourcet &source)
record an assumption
virtual void input(const exprt &guard, const sourcet &source, const irep_idt &input_id, const std::list< exprt > &args)
just record input
virtual void goto_instruction(const exprt &guard, const exprt &cond, const sourcet &source)
record a goto instruction
bool is_constraint() const
assignment_typet assignment_type
virtual void atomic_begin(const exprt &guard, unsigned atomic_section_id, const sourcet &source)
start an atomic section
static mstreamt & eom(mstreamt &m)
std::string unwrap_exception(const std::exception &e, int level)
Given a potentially nested exception, produce a string with all of nested exceptions information...
virtual void atomic_end(const exprt &guard, unsigned atomic_section_id, const sourcet &source)
end an atomic section
virtual void shared_write(const exprt &guard, const ssa_exprt &ssa_object, unsigned atomic_section_id, const sourcet &source)
write to a sharedvariable
bool is_shared_write() const
The boolean constant true.
virtual void constraint(const exprt &cond, const std::string &msg, const sourcet &source)
record a constraint
Exceptions that can be raised during the equation conversion phase.
void util_throw_with_nested(T &&t)
void convert_constraints(decision_proceduret &decision_procedure) const
converts constraints
virtual void decl(const exprt &guard, const ssa_exprt &ssa_lhs, const sourcet &source, assignment_typet assignment_type)
declare a fresh variable
Exceptions that can be raised in bv_conversion.
API to expression classes.
#define PRECONDITION(CONDITION)
virtual void assignment(const exprt &guard, const ssa_exprt &ssa_lhs, const exprt &ssa_full_lhs, const exprt &original_full_lhs, const exprt &ssa_rhs, const sourcet &source, assignment_typet assignment_type)
write to a variable
virtual literalt convert(const exprt &expr)=0
virtual void output_fmt(const exprt &guard, const sourcet &source, const irep_idt &output_id, const irep_idt &fmt, const std::list< exprt > &args)
just record formatted output
virtual void set_to(const exprt &expr, bool value)=0
bool is_assignment() const
virtual void output(const exprt &guard, const sourcet &source, const irep_idt &fmt, const std::list< exprt > &args)
just record output
std::list< exprt > io_args
exprt disjunction(const exprt::operandst &op)
std::vector< exprt > operandst
void convert_goto_instructions(prop_convt &prop_conv)
converts goto instructions
literalt const_literal(bool value)
void convert_assignments(decision_proceduret &decision_procedure) const
converts assignments
virtual void shared_read(const exprt &guard, const ssa_exprt &ssa_object, unsigned atomic_section_id, const sourcet &source)
read from a shared variable
virtual void assertion(const exprt &guard, const exprt &cond, const std::string &msg, const sourcet &source)
record an assertion
void convert_assertions(prop_convt &prop_conv)
converts assertions
void set_to_false(const exprt &expr)
void convert_decls(prop_convt &prop_conv) const
converts declarations
Base class for all expressions.
virtual void function_return(const exprt &guard, const irep_idt &identifier, const sourcet &source)
just record a location
void set_to_true(const exprt &expr)
std::string to_string(const string_constraintt &expr)
Used for debug printing.
const exprt & get_original_expr() const
void conditional_output(mstreamt &mstream, const std::function< void(mstreamt &)> &output_generator) const
Generate output to mstream using output_generator if the configured verbosity is at least as high as ...
virtual void location(const exprt &guard, const sourcet &source)
just record a location
std::size_t count_assertions() const
void set_identifier(const irep_idt &identifier)
Expression to hold a symbol (variable)
void output(const namespacet &ns, std::ostream &out) const
virtual void dead(const exprt &guard, const ssa_exprt &ssa_lhs, const sourcet &source)
declare a fresh variable
void merge_ireps(SSA_stept &SSA_step)
goto_trace_stept::typet type
Expression providing an SSA-renamed symbol of expressions.
void convert_guards(prop_convt &prop_conv)
converts guards
void convert_io(decision_proceduret &decision_procedure)
converts I/O