Go to the documentation of this file.
22 #ifndef CPROVER_ANALYSES_CONSTANT_PROPAGATOR_H
23 #define CPROVER_ANALYSES_CONSTANT_PROPAGATOR_H
78 virtual bool is_top() const final
override
184 dirty(goto_functions),
192 dirty(goto_function),
200 dirty(goto_model.goto_functions),
209 const irep_idt &function_identifier,
215 operator()(function_identifier, goto_function, ns);
239 #endif // CPROVER_ANALYSES_CONSTANT_PROPAGATOR_H
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Replace symbols with constants while maintaining syntactically valid expressions.
virtual void make_top() final override
all states – the analysis doesn't use this, and domains may refuse to implement it.
address_of_aware_replace_symbolt replace_const
should_track_valuet should_track_value
bool is_constant(const exprt &expr) const
constant_propagator_ait(goto_modelt &goto_model, should_track_valuet should_track_value=track_all_values)
Dirty variables are ones which have their address taken so we can't reliably work out where they may ...
bool two_way_propagate_rec(const exprt &expr, const namespacet &ns, const constant_propagator_ait *cp)
handles equalities and conjunctions containing equalities
bool merge(const constant_propagator_domaint &other, trace_ptrt from, trace_ptrt to)
static bool partial_evaluate(const valuest &known_values, exprt &expr, const namespacet &ns)
Attempt to evaluate expression using domain knowledge This function changes the expression that is pa...
static void assign_rec(valuest &dest_values, const exprt &lhs, const exprt &rhs, const namespacet &ns, const constant_propagator_ait *cp, bool is_assignment)
Assign value rhs to lhs, recording any newly-known constants in dest_values.
constant_propagator_ait(const goto_functiont &goto_function, should_track_valuet should_track_value=track_all_values)
void set_dirty_to_top(const dirtyt &dirty, const namespacet &ns)
Base class for all expressions.
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
virtual bool is_top() const final override
virtual void output(std::ostream &out, const ai_baset &ai_base, const namespacet &ns) const override
Expression to hold a symbol (variable)
std::function< bool(const exprt &, const namespacet &)> should_track_valuet
ai_history_baset::trace_ptrt trace_ptrt
static bool replace_constants_and_simplify(const valuest &known_values, exprt &expr, const namespacet &ns)
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
void output(std::ostream &out, const namespacet &ns) const
static bool track_all_values(const exprt &, const namespacet &)
bool merge(const valuest &src)
join
virtual bool is_bottom() const final override
A goto function, consisting of function body (see body) and parameter identifiers (see parameter_iden...
virtual void make_bottom() final override
no states
void replace_types_rec(const replace_symbolt &replace_const, exprt &expr)
::goto_functiont goto_functiont
A collection of goto functions.
goto_functionst goto_functions
GOTO functions.
virtual void transform(const irep_idt &function_from, trace_ptrt trace_from, const irep_idt &function_to, trace_ptrt trace_to, ai_baset &ai_base, const namespacet &ns) final override
how function calls are treated: a) there is an edge from each call site to the function head b) there...
virtual bool ai_simplify(exprt &condition, const namespacet &ns) const final override
Simplify the condition given context-sensitive knowledge from the abstract state.
static bool partial_evaluate_with_all_rounding_modes(const valuest &known_values, exprt &expr, const namespacet &ns)
Attempt to evaluate an expression in all rounding modes.
constant_propagator_ait(const irep_idt &function_identifier, goto_functionst::goto_functiont &goto_function, const namespacet &ns, should_track_valuet should_track_value=track_all_values)
void set_to(const symbol_exprt &lhs, const exprt &rhs)
This is the basic interface of the abstract interpreter with default implementations of the core func...
bool meet(const valuest &src, const namespacet &ns)
meet
void operator()(const irep_idt &function_id, const goto_programt &goto_program, const namespacet &ns)
Run abstract interpretation on a single function.
void replace(goto_functionst::goto_functiont &, const namespacet &)
virtual void make_entry() final override
Make this domain a reasonable entry-point state.
The interface offered by a domain, allows code to manipulate domains without knowing their exact type...
constant_propagator_ait(const goto_functionst &goto_functions, should_track_valuet should_track_value=track_all_values)
void set(const class symbol_exprt &old_expr, const exprt &new_expr)
Sets old_expr to be replaced by new_expr.
symbol_tablet symbol_table
Symbol table.
Replace a symbol expression by a given expression.