4#ifndef CPROVER_ANALYSES_AI_H
5#define CPROVER_ANALYSES_AI_H
64 virtual std::unique_ptr<statet>
68 virtual std::unique_ptr<statet>
71 assert(!l->is_end_function());
106 typedef std::unordered_map<unsigned, goto_programt::const_targett>
115 std::pair<unsigned, goto_programt::const_targett>(l->location_number, l));
154 const goto_functionst::function_mapt::const_iterator f_it,
175template <
typename domainT>
186 typename state_mapt::iterator it =
state_map.find(l);
188 throw "failed to find state";
200 typename state_mapt::const_iterator it =
state_map.find(l);
202 throw "failed to find state";
207 std::unique_ptr<statet>
210 typename state_mapt::const_iterator it =
state_map.find(t);
213 std::unique_ptr<statet> d = std::make_unique<domainT>();
214 assert(d->is_bottom());
218 return std::make_unique<domainT>(it->second);
227 typedef std::unordered_map<
245 typename state_mapt::const_iterator it =
state_map.find(l);
247 throw "failed to find state";
258 return static_cast<domainT &
>(dest).
merge(
259 static_cast<const domainT &
>(src), from, to);
264 return std::make_unique<domainT>(
static_cast<const domainT &
>(s));
275 void dummy(
const domainT &s)
286 const namespacet &)
override
288 throw "not implemented";
Abstract Interpretation Domain.
virtual bool merge_shared(const statet &src, goto_programt::const_targett from, goto_programt::const_targett to, const namespacet &ns)=0
bool visit(goto_programt::const_targett l, working_sett &working_set, const goto_programt &goto_program, const goto_functionst &goto_functions, const namespacet &ns)
Definition ai.cpp:115
void operator()(const goto_functionst &goto_functions, const namespacet &ns)
Run analysis over Module (Goto Functions).
Definition ai.h:54
void sequential_fixedpoint(const goto_functionst &goto_functions, const namespacet &ns)
Definition ai.cpp:279
virtual bool merge(const statet &src, goto_programt::const_targett from, goto_programt::const_targett to)=0
virtual void fixedpoint(const goto_functionst &goto_functions, const namespacet &ns)=0
virtual const statet & find_state(goto_programt::const_targett l) const =0
std::unordered_map< unsigned, goto_programt::const_targett > working_sett
Definition ai.h:107
bool fixedpoint(const goto_programt &goto_program, const goto_functionst &goto_functions, const namespacet &ns)
Definition ai.cpp:90
void entry_state(const goto_programt &)
Definition ai.cpp:49
virtual void clear()
Resets the domain.
Definition ai.h:76
ai_domain_baset statet
Definition ai.h:29
bool continue_past_failed_assertions
goto_programt::get_successors gives an ASSERT whose guard is false no successor, as though a violatio...
Definition ai.h:85
virtual void output(const goto_functionst &goto_functions, std::ostream &out) const
Definition ai.cpp:13
virtual std::unique_ptr< statet > make_temporary_state(const statet &s)=0
virtual statet & get_state(goto_programt::const_targett l)=0
void put_in_working_set(working_sett &working_set, goto_programt::const_targett l)
Definition ai.h:112
bool do_function_call(goto_programt::const_targett l_call, goto_programt::const_targett l_return, const goto_functionst &goto_functions, const goto_functionst::function_mapt::const_iterator f_it, const namespacet &ns)
Definition ai.cpp:171
virtual std::unique_ptr< statet > abstract_state_before(goto_programt::const_targett l) const =0
void operator()(const goto_programt &goto_program, const namespacet &ns)
Run analysis over Program.
Definition ai.h:39
bool do_function_call_rec(goto_programt::const_targett l_call, goto_programt::const_targett l_return, const expr2tc &function, const goto_functionst &goto_functions, const namespacet &ns)
Definition ai.cpp:242
goto_programt::const_targett get_next(working_sett &working_set)
Definition ai.cpp:79
virtual std::unique_ptr< statet > abstract_state_after(goto_programt::const_targett l) const
Definition ai.h:69
virtual void finalize()
Definition ai.cpp:74
The interface offered by a domain, allows code to manipulate domains without knowing their exact type...
Definition ai_domain.h:16
virtual statet & get_state(goto_programt::const_targett l) override
Definition ai.h:237
state_mapt state_map
Definition ai.h:233
const statet & find_state(goto_programt::const_targett l) const override
Definition ai.h:243
void fixedpoint(const goto_functionst &goto_functions, const namespacet &ns) override
Definition ai.h:267
std::unique_ptr< statet > make_temporary_state(const statet &s) override
Definition ai.h:262
std::unordered_map< goto_programt::const_targett, domainT, const_target_hash, pointee_address_equalt > state_mapt
Definition ai.h:232
std::unique_ptr< statet > abstract_state_before(goto_programt::const_targett t) const override
Definition ai.h:208
bool target_is_mapped(goto_programt::const_targett l) const
Definition ai.h:193
bool merge(const statet &src, goto_programt::const_targett from, goto_programt::const_targett to) override
Definition ai.h:252
const domainT & operator[](goto_programt::const_targett l) const
Definition ai.h:198
void clear() override
Resets the domain.
Definition ai.h:221
domainT & operator[](goto_programt::const_targett l)
Definition ai.h:184
Definition goto_functions.h:56
Definition goto_functions.h:23
A generic container class for a control flow graph for one function, in the form of a goto-program.
Definition goto_program.h:63
instructionst::const_iterator const_targett
Definition goto_program.h:591
Definition namespace.h:10
irep_container< expr2t > expr2tc
Definition irep2.h:431
void initialize()
Definition solidity_misc.c:90
Definition goto_program.h:764
Functor to check whether iterators from different collections point at the same object.
Definition goto_program.h:775