CBMC
Loading...
Searching...
No Matches
field_sensitivity.h
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: Field-sensitive SSA
4
5Author: Michael Tautschnig
6
7\*******************************************************************/
8
9#ifndef CPROVER_GOTO_SYMEX_FIELD_SENSITIVITY_H
10#define CPROVER_GOTO_SYMEX_FIELD_SENSITIVITY_H
11
12#include <util/ssa_expr.h>
13
14class namespacet;
16class symex_targett;
17class value_sett;
18
20{
21public:
27
29 {
30 return static_cast<const ssa_exprt &>(find(ID_expression));
31 }
32};
33
34template <>
36{
37 return base.id() == ID_field_sensitive_ssa;
38}
39
40inline const field_sensitive_ssa_exprt &
42{
45 static_cast<const field_sensitive_ssa_exprt &>(expr);
46 return ret;
47}
48
56
118{
119public:
133
146 const namespacet &ns,
147 goto_symex_statet &state,
148 const ssa_exprt &lhs,
149 const exprt &rhs,
150 symex_targett &target,
151 bool allow_pointer_unsoundness) const;
152
166 [[nodiscard]] exprt
167 apply(const namespacet &ns, goto_symex_statet &state, exprt expr, bool write)
168 const;
171 const namespacet &ns,
172 goto_symex_statet &state,
173 ssa_exprt expr,
174 bool write) const;
175
189 const namespacet &ns,
190 goto_symex_statet &state,
191 const ssa_exprt &ssa_expr,
192 bool disjoined_fields_only) const;
193
203 [[nodiscard]] bool
204 is_divisible(const ssa_exprt &expr, bool disjoined_fields_only) const;
205
206private:
208
209 const bool should_simplify;
211
213 const namespacet &ns,
214 goto_symex_statet &state,
215 const exprt &lhs_fs,
216 const exprt &ssa_rhs,
217 symex_targett &target,
218 bool allow_pointer_unsoundness) const;
219
221 exprt e,
222 const value_sett &value_set,
223 const namespacet &ns) const;
224};
225
226#endif // CPROVER_GOTO_SYMEX_FIELD_SENSITIVITY_H
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
Definition ai.h:562
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition dstring.h:38
Base class for all expressions.
Definition expr.h:56
std::vector< exprt > operandst
Definition expr.h:58
typet & type()
Return the type of the expression.
Definition expr.h:84
field_sensitive_ssa_exprt(const ssa_exprt &ssa, exprt::operandst &&fields)
const ssa_exprt & get_object_ssa() const
Control granularity of object accesses.
exprt simplify_opt(exprt e, const value_sett &value_set, const namespacet &ns) const
const std::size_t max_field_sensitivity_array_size
field_sensitivityt(std::size_t max_array_size, bool should_simplify, const irep_idt &language_mode)
exprt get_fields(const namespacet &ns, goto_symex_statet &state, const ssa_exprt &ssa_expr, bool disjoined_fields_only) const
Compute an expression representing the individual components of a field-sensitive SSA representation ...
void field_assignments_rec(const namespacet &ns, goto_symex_statet &state, const exprt &lhs_fs, const exprt &ssa_rhs, symex_targett &target, bool allow_pointer_unsoundness) const
Assign to the individual fields lhs_fs of a non-expanded symbol lhs.
exprt apply(const namespacet &ns, goto_symex_statet &state, exprt expr, bool write) const
Turn an expression expr into a field-sensitive SSA expression.
void field_assignments(const namespacet &ns, goto_symex_statet &state, const ssa_exprt &lhs, const exprt &rhs, symex_targett &target, bool allow_pointer_unsoundness) const
Assign to the individual fields of a non-expanded symbol lhs.
const irep_idt & language_mode
bool is_divisible(const ssa_exprt &expr, bool disjoined_fields_only) const
Determine whether expr would translate to an atomic SSA expression (returns false) or a composite obj...
Central data structure: state.
const irept & find(const irep_idt &name) const
Definition irep.cpp:93
const irep_idt & id() const
Definition irep.h:388
irept & add(const irep_idt &name)
Definition irep.cpp:103
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition namespace.h:91
Expression providing an SSA-renamed symbol of expressions.
Definition ssa_expr.h:17
The interface of the target container for symbolic execution to record its symbolic steps into.
State type in value_set_domaint, used in value-set analysis and goto-symex.
Definition value_set.h:43
bool can_cast_expr< field_sensitive_ssa_exprt >(const exprt &base)
const field_sensitive_ssa_exprt & to_field_sensitive_ssa_expr(const exprt &expr)
STL namespace.
#define PRECONDITION(CONDITION)
Definition invariant.h:463
ssize_t write(int fildes, const void *buf, size_t nbyte)
Definition unistd.c:195