24 for(
const auto &op : dest.
operands())
30 if(dest.
id()==ID_side_effect)
35 if(statement==ID_nondet)
44 if(dest.
id()==ID_side_effect &&
49 dest.
id(ID_nondet_symbol);
59 static unsigned count=0;
72 e1.
id() == ID_dereference &&
80 e2.
id() == ID_dereference &&
96 if(e1.
id()==ID_symbol && e2.
id()==ID_symbol)
108 if(e1.
id()==ID_index || e1.
id()==ID_struct)
109 if(e2.
id()!=ID_dereference && e1.
id()!=e2.
id())
112 if(e2.
id()==ID_index || e2.
id()==ID_struct)
113 if(e2.
id()!=ID_dereference && e1.
id()!=e2.
id())
129 if(dest.
id()!=ID_address_of)
134 if(dest.
id()==ID_member ||
135 dest.
id()==ID_index ||
136 dest.
id()==ID_dereference ||
137 dest.
id()==ID_symbol)
154 const if_exprt if_expr(alias_cond, by, dest, dest.
type());
169 if(lhs.
id()==ID_member)
176 new_rhs.
where().
set(ID_component_name, component_name);
183 else if(lhs.
id()==ID_index)
246 if(statement==ID_assign)
248 else if(statement==ID_assume)
250 else if(statement==ID_skip)
252 else if(statement==ID_decl)
254 else if(statement==ID_assert)
256 else if(statement==ID_expression)
258 else if(statement==ID_printf)
260 else if(statement==ID_asm)
262 else if(statement==ID_fence)
265 false,
"sorry, wp(",
id2string(statement),
"...) is not implemented");
Operator to return the address of an object.
A goto_instruction_codet representing an assignment in the program.
An assumption, which must hold in subsequent code.
const exprt & assumption() const
A goto_instruction_codet representing the declaration of a local variable.
Data structure for representing an arbitrary statement in a program.
const irep_idt & get_statement() const
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 trinary if-then-else operator.
void set(const irep_idt &name, const irep_idt &value)
const irep_idt & id() const
Extract member of struct or union.
const exprt & struct_op() const
irep_idt get_component_name() const
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
A side_effect_exprt that returns a non-deterministically chosen value.
An expression containing a side effect.
const irep_idt & get_statement() const
Operator to update elements in structs and arrays.
#define Forall_operands(it, expr)
const code_assignt & to_code_assign(const goto_instruction_codet &code)
const code_declt & to_code_decl(const goto_instruction_codet &code)
const std::string & id2string(const irep_idt &d)
API to expression classes for Pointers.
const dereference_exprt & to_dereference_expr(const exprt &expr)
Cast an exprt to a dereference_exprt.
const address_of_exprt & to_address_of_expr(const exprt &expr)
Cast an exprt to an address_of_exprt.
#define INVARIANT_WITH_DIAGNOSTICS(CONDITION, REASON,...)
Same as invariant, with one or more diagnostics attached Diagnostics can be of any type that has a sp...
side_effect_exprt & to_side_effect_expr(exprt &expr)
const code_assumet & to_code_assume(const codet &code)
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.
std::string to_string(const string_not_contains_constraintt &expr)
Used for debug printing.
exprt wp_assign(const code_assignt &code, const exprt &post, const namespacet &ns)
void approximate_nondet_rec(exprt &dest, unsigned &count)
exprt wp_assume(const code_assumet &code, const exprt &post, const namespacet &)
void approximate_nondet(exprt &dest)
Approximate the non-deterministic choice in a way cheaper than by (proper) quantification.
exprt wp_decl(const code_declt &code, const exprt &post, const namespacet &ns)
exprt wp(const codet &code, const exprt &post, const namespacet &ns)
Compute the weakest precondition of the given program piece code with respect to the expression post.
void substitute_rec(exprt &dest, const exprt &what, const exprt &by, const namespacet &ns)
replace 'what' by 'by' in 'dest', considering possible aliasing
aliasingt
consider possible aliasing
aliasingt aliasing(const exprt &e1, const exprt &e2, const namespacet &ns)
bool has_nondet(const exprt &dest)
void rewrite_assignment(exprt &lhs, exprt &rhs)