CBMC
|
#include <custom_bitvector_analysis.h>
Classes | |
struct | vectorst |
Public Types | |
typedef unsigned long long | bit_vectort |
typedef std::map< irep_idt, bit_vectort > | bitst |
Public Types inherited from ai_domain_baset | |
typedef goto_programt::const_targett | locationt |
typedef ai_history_baset::trace_ptrt | trace_ptrt |
Public Member Functions | |
void | transform (const irep_idt &function_from, trace_ptrt trace_from, const irep_idt &function_to, trace_ptrt trace_to, ai_baset &ai, 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 is an edge from the last instruction (END_FUNCTION) of the function to the instruction following the call site (this also needs to set the LHS, if applicable) More... | |
void | output (std::ostream &out, const ai_baset &ai, const namespacet &ns) const final override |
void | make_bottom () final override |
no states More... | |
void | make_top () final override |
all states – the analysis doesn't use this directly (see make_entry) and domains may refuse to implement it. More... | |
bool | is_bottom () const final override |
bool | is_top () const final override |
bool | merge (const custom_bitvector_domaint &b, trace_ptrt from, trace_ptrt to) |
void | assign_struct_rec (locationt from, const exprt &lhs, const exprt &rhs, custom_bitvector_analysist &, const namespacet &) |
void | assign_lhs (const exprt &, const vectorst &) |
void | assign_lhs (const irep_idt &, const vectorst &) |
vectorst | get_rhs (const exprt &) const |
vectorst | get_rhs (const irep_idt &) const |
custom_bitvector_domaint () | |
exprt | eval (const exprt &src, custom_bitvector_analysist &) const |
Public Member Functions inherited from ai_domain_baset | |
virtual | ~ai_domain_baset () |
virtual jsont | output_json (const ai_baset &ai, const namespacet &ns) const |
virtual xmlt | output_xml (const ai_baset &ai, const namespacet &ns) const |
virtual void | make_entry () |
Make this domain a reasonable entry-point state For most domains top is sufficient. More... | |
virtual bool | ai_simplify (exprt &condition, const namespacet &) const |
also add More... | |
virtual bool | ai_simplify_lhs (exprt &condition, const namespacet &ns) const |
Simplifies the expression but keeps it as an l-value. More... | |
virtual exprt | to_predicate (void) const |
Gives a Boolean condition that is true for all values represented by the domain. More... | |
Static Public Member Functions | |
static vectorst | merge (const vectorst &a, const vectorst &b) |
static bool | has_get_must_or_may (const exprt &) |
Public Attributes | |
bitst | may_bits |
bitst | must_bits |
tvt | has_values |
Private Types | |
enum class | modet { SET_MUST , CLEAR_MUST , SET_MAY , CLEAR_MAY } |
Private Member Functions | |
void | set_bit (const exprt &, unsigned bit_nr, modet) |
void | set_bit (const irep_idt &, unsigned bit_nr, modet) |
void | erase_blank_vectors (bitst &) |
erase blank bitvectors More... | |
Static Private Member Functions | |
static void | set_bit (bit_vectort &dest, unsigned bit_nr) |
static void | clear_bit (bit_vectort &dest, unsigned bit_nr) |
static bool | get_bit (const bit_vectort src, unsigned bit_nr) |
static irep_idt | object2id (const exprt &) |
Additional Inherited Members | |
Protected Member Functions inherited from ai_domain_baset | |
ai_domain_baset () | |
The constructor is expected to produce 'false' or 'bottom' A default constructor is not part of the domain interface. More... | |
ai_domain_baset (const ai_domain_baset &old) | |
A copy constructor is part of the domain interface. More... | |
Definition at line 23 of file custom_bitvector_analysis.h.
typedef unsigned long long custom_bitvector_domaint::bit_vectort |
Definition at line 71 of file custom_bitvector_analysis.h.
typedef std::map<irep_idt, bit_vectort> custom_bitvector_domaint::bitst |
Definition at line 73 of file custom_bitvector_analysis.h.
|
strongprivate |
Enumerator | |
---|---|
SET_MUST | |
CLEAR_MUST | |
SET_MAY | |
CLEAR_MAY |
Definition at line 117 of file custom_bitvector_analysis.h.
|
inline |
Definition at line 107 of file custom_bitvector_analysis.h.
Definition at line 111 of file custom_bitvector_analysis.cpp.
Definition at line 120 of file custom_bitvector_analysis.cpp.
void custom_bitvector_domaint::assign_struct_rec | ( | locationt | from, |
const exprt & | lhs, | ||
const exprt & | rhs, | ||
custom_bitvector_analysist & | cba, | ||
const namespacet & | ns | ||
) |
Definition at line 227 of file custom_bitvector_analysis.cpp.
|
inlinestaticprivate |
Definition at line 127 of file custom_bitvector_analysis.h.
|
private |
erase blank bitvectors
Definition at line 674 of file custom_bitvector_analysis.cpp.
exprt custom_bitvector_domaint::eval | ( | const exprt & | src, |
custom_bitvector_analysist & | custom_bitvector_analysis | ||
) | const |
Definition at line 701 of file custom_bitvector_analysis.cpp.
|
inlinestaticprivate |
Definition at line 133 of file custom_bitvector_analysis.h.
custom_bitvector_domaint::vectorst custom_bitvector_domaint::get_rhs | ( | const exprt & | rhs | ) | const |
Definition at line 154 of file custom_bitvector_analysis.cpp.
custom_bitvector_domaint::vectorst custom_bitvector_domaint::get_rhs | ( | const irep_idt & | identifier | ) | const |
Definition at line 138 of file custom_bitvector_analysis.cpp.
|
static |
Definition at line 687 of file custom_bitvector_analysis.cpp.
|
inlinefinaloverridevirtual |
Implements ai_domain_baset.
Definition at line 53 of file custom_bitvector_analysis.h.
|
inlinefinaloverridevirtual |
Implements ai_domain_baset.
Definition at line 61 of file custom_bitvector_analysis.h.
|
inlinefinaloverridevirtual |
|
inlinefinaloverridevirtual |
all states – the analysis doesn't use this directly (see make_entry) and domains may refuse to implement it.
Implements ai_domain_baset.
Definition at line 46 of file custom_bitvector_analysis.h.
bool custom_bitvector_domaint::merge | ( | const custom_bitvector_domaint & | b, |
trace_ptrt | from, | ||
trace_ptrt | to | ||
) |
Definition at line 609 of file custom_bitvector_analysis.cpp.
|
inlinestatic |
Definition at line 83 of file custom_bitvector_analysis.h.
Definition at line 59 of file custom_bitvector_analysis.cpp.
|
finaloverridevirtual |
Reimplemented from ai_domain_baset.
Definition at line 562 of file custom_bitvector_analysis.cpp.
|
inlinestaticprivate |
Definition at line 122 of file custom_bitvector_analysis.h.
Definition at line 49 of file custom_bitvector_analysis.cpp.
|
private |
Definition at line 24 of file custom_bitvector_analysis.cpp.
|
finaloverridevirtual |
how function calls are treated: a) there is an edge from each call site to the function head b) there is an edge from the last instruction (END_FUNCTION) of the function to the instruction following the call site (this also needs to set the LHS, if applicable)
in some cases, function calls are skipped, in which case: c) there is an edge from the call instruction to the instruction after
"this" is the domain before the instruction "from" "from" is the instruction to be interpreted "to" is the next instruction (for GOTO, FUNCTION_CALL, END_FUNCTION)
PRECONDITION(from.is_dereferenceable(), "Must not be _::end()") PRECONDITION(to.is_dereferenceable(), "Must not be _::end()") PRECONDITION(are_comparable(from,to) || (from->is_function_call() || from->is_end_function())
The history aware version is used by the abstract interpreter for backwards compatability it calls the older signature
Implements ai_domain_baset.
Definition at line 271 of file custom_bitvector_analysis.cpp.
tvt custom_bitvector_domaint::has_values |
Definition at line 105 of file custom_bitvector_analysis.h.
bitst custom_bitvector_domaint::may_bits |
Definition at line 91 of file custom_bitvector_analysis.h.
bitst custom_bitvector_domaint::must_bits |
Definition at line 91 of file custom_bitvector_analysis.h.