54 virtual void output(std::ostream &out)
const override;
75 log_error(
"[CSE] Available Expressions does not implement make_top()");
130 static std::shared_ptr<value_setst>
vsa;
166 runOnFunction(std::pair<const irep_idt, goto_functiont> &F)
override;
177 const std::unordered_map<expr2tc, expr2tc, irep2_hash> &expr2symbol,
179 std::unordered_set<expr2tc, irep2_hash> &matched_expressions)
const;
183 const std::unordered_map<expr2tc, expr2tc, irep2_hash> &expr2symbol,
185 std::unordered_set<expr2tc, irep2_hash> &matched_expressions)
const;
191 unsigned symbol_counter = 0;
192 const std::string prefix =
"__ESBMC_cse_symbol";
This is the basic interface of the abstract interpreter with default implementations of the core func...
Definition ai.h:27
ai_domain_baset()
The constructor is expected to produce 'false' or 'bottom'.
Definition ai_domain.h:19
Abstract domain to obtain all available expressions (AE).
Definition gcse.h:44
static std::shared_ptr< value_setst > vsa
Definition gcse.h:130
void havoc_expr(const expr2tc &e, const goto_programt::const_targett &)
Remove expression e (and everything that it depends on) from available_expressions.
Definition gcse.cpp:360
bool bottom
Unreachable-so-far marker.
Definition gcse.h:103
virtual void make_entry() override
Entry has nothing available yet, but is reachable — distinct from bottom.
Definition gcse.h:66
virtual bool is_top() const override
Definition gcse.h:83
std::unordered_set< expr2tc, irep2_hash > available_expressions
All expressions available.
Definition gcse.h:99
bool merge(const cse_domaint &b, goto_programt::const_targett, goto_programt::const_targett)
Definition gcse.cpp:124
void make_expression_available(const expr2tc &e)
Add non-primitive expression e (and its sub-expressions) into available_expressions.
Definition gcse.cpp:165
virtual void output(std::ostream &out) const override
Definition gcse.cpp:108
bool should_remove_expr(const expr2tc &taint, const expr2tc &src) const
Definition gcse.cpp:217
virtual void make_bottom() override
no states
Definition gcse.h:56
virtual bool is_bottom() const override
Definition gcse.h:79
virtual bool ai_simplify(expr2tc &, const namespacet &) const override
also add
Definition gcse.h:88
void havoc_symbol(const irep_idt &sym)
Remove every expression from available_expressions that depends on symbol sym.
Definition gcse.cpp:252
virtual void make_top() override
all states – the analysis doesn't use this, and domains may refuse to implement it.
Definition gcse.h:71
void havoc_pointee(expr2tc ptr, const goto_programt::const_targett &)
Remove every expression that may read the object ptr points to, which is about to be deallocated.
Definition gcse.cpp:409
expr2tc obtain_max_sub_expr(const expr2tc &e, const cse_domaint &state) const
Definition gcse.cpp:439
void replace_in_lvalue(expr2tc &lhs, const std::unordered_map< expr2tc, expr2tc, irep2_hash > &expr2symbol, const goto_programt::const_targett &to, std::unordered_set< expr2tc, irep2_hash > &matched_expressions) const
Like replace_max_sub_expr, but only in the value operands of an lvalue.
Definition gcse.cpp:501
goto_cse(contextt &ns, std::shared_ptr< value_setst > &vsa)
Definition gcse.h:158
virtual bool runOnProgram(goto_functionst &) override
Definition gcse.cpp:425
symbolt create_cse_symbol(const type2tc &t, const goto_programt::const_targett &to)
Definition gcse.cpp:708
virtual bool runOnFunction(std::pair< const irep_idt, goto_functiont > &F) override
Definition gcse.cpp:548
void replace_max_sub_expr(expr2tc &e, const std::unordered_map< expr2tc, expr2tc, irep2_hash > &expr2symbol, const goto_programt::const_targett &to, std::unordered_set< expr2tc, irep2_hash > &matched_expressions) const
Definition gcse.cpp:464
contextt & context
Definition gcse.h:173
ait< cse_domaint > available_expressions
Definition gcse.h:172
goto_functions_algorithm(bool sideffect)
Definition goto_functions_algorithm.h:13
Definition goto_functions.h:56
instructionst::const_iterator const_targett
Definition goto_program.h:591
Definition namespace.h:10
irep_container< type2t > type2tc
Definition irep2.h:430
irep_container< expr2t > expr2tc
Definition irep2.h:431
#define log_error(fmt,...)
Definition message.h:83
#define true
Definition stdbool.h:11
void abort(void)
Definition stdlib.c:77