CBMC
|
#include <invariant_propagation.h>
Public Types | |
typedef ait< invariant_set_domaint > | baset |
![]() | |
typedef goto_programt::const_targett | locationt |
![]() | |
typedef ai_domain_baset | statet |
typedef ai_storage_baset::cstate_ptrt | cstate_ptrt |
typedef ai_history_baset::trace_ptrt | trace_ptrt |
typedef ai_history_baset::trace_sett | trace_sett |
typedef ai_storage_baset::ctrace_set_ptrt | ctrace_set_ptrt |
typedef goto_programt::const_targett | locationt |
Public Member Functions | |
invariant_propagationt (const namespacet &_ns, value_setst &_value_sets) | |
const invariant_sett & | lookup (locationt l) const |
void | initialize (const irep_idt &function, const goto_programt &goto_program) override |
Initialize all the abstract states for a single function. | |
void | make_all_true () |
void | make_all_false () |
void | simplify (goto_programt &goto_program) |
void | simplify (goto_functionst &goto_functions) |
![]() | |
ait () | |
ait (std::unique_ptr< ai_domain_factory_baset > &&df) | |
const invariant_set_domaint & | operator[] (locationt l) const |
Find the analysis result for a given location. | |
![]() | |
ai_recursive_interproceduralt (std::unique_ptr< ai_history_factory_baset > &&hf, std::unique_ptr< ai_domain_factory_baset > &&df, std::unique_ptr< ai_storage_baset > &&st, message_handlert &mh) | |
![]() | |
ai_baset (std::unique_ptr< ai_history_factory_baset > &&hf, std::unique_ptr< ai_domain_factory_baset > &&df, std::unique_ptr< ai_storage_baset > &&st, message_handlert &mh) | |
virtual | ~ai_baset () |
void | operator() (const irep_idt &function_id, const goto_programt &goto_program, const namespacet &ns) |
Run abstract interpretation on a single function. | |
void | operator() (const goto_functionst &goto_functions, const namespacet &ns) |
Run abstract interpretation on a whole program. | |
void | operator() (const abstract_goto_modelt &goto_model) |
Run abstract interpretation on a whole program. | |
void | operator() (const irep_idt &function_id, const goto_functionst::goto_functiont &goto_function, const namespacet &ns) |
Run abstract interpretation on a single function. | |
virtual ctrace_set_ptrt | abstract_traces_before (locationt l) const |
Returns all of the histories that have reached the start of the instruction. | |
virtual ctrace_set_ptrt | abstract_traces_after (locationt l) const |
Returns all of the histories that have reached the end of the instruction. | |
virtual cstate_ptrt | abstract_state_before (locationt l) const |
Get a copy of the abstract state before the given instruction, without needing to know what kind of domain or history is used. | |
virtual cstate_ptrt | abstract_state_after (locationt l) const |
Get a copy of the abstract state after the given instruction, without needing to know what kind of domain or history is used. | |
virtual cstate_ptrt | abstract_state_before (const trace_ptrt &p) const |
The same interfaces but with histories. | |
virtual cstate_ptrt | abstract_state_after (const trace_ptrt &p) const |
virtual void | clear () |
Reset the abstract state. | |
virtual void | output (const namespacet &ns, const irep_idt &function_id, const goto_programt &goto_program, std::ostream &out) const |
Output the abstract states for a single function. | |
virtual jsont | output_json (const namespacet &ns, const irep_idt &function_id, const goto_programt &goto_program) const |
Output the abstract states for a single function as JSON. | |
virtual xmlt | output_xml (const namespacet &ns, const irep_idt &function_id, const goto_programt &goto_program) const |
Output the abstract states for a single function as XML. | |
virtual void | output (const namespacet &ns, const goto_functionst &goto_functions, std::ostream &out) const |
Output the abstract states for a whole program. | |
void | output (const goto_modelt &goto_model, std::ostream &out) const |
Output the abstract states for a whole program. | |
void | output (const namespacet &ns, const goto_functionst::goto_functiont &goto_function, std::ostream &out) const |
Output the abstract states for a function. | |
virtual jsont | output_json (const namespacet &ns, const goto_functionst &goto_functions) const |
Output the abstract states for the whole program as JSON. | |
jsont | output_json (const goto_modelt &goto_model) const |
Output the abstract states for a whole program as JSON. | |
jsont | output_json (const namespacet &ns, const goto_programt &goto_program) const |
Output the abstract states for a single function as JSON. | |
jsont | output_json (const namespacet &ns, const goto_functionst::goto_functiont &goto_function) const |
Output the abstract states for a single function as JSON. | |
virtual xmlt | output_xml (const namespacet &ns, const goto_functionst &goto_functions) const |
Output the abstract states for the whole program as XML. | |
xmlt | output_xml (const goto_modelt &goto_model) const |
Output the abstract states for the whole program as XML. | |
xmlt | output_xml (const namespacet &ns, const goto_programt &goto_program) const |
Output the abstract states for a single function as XML. | |
xmlt | output_xml (const namespacet &ns, const goto_functionst::goto_functiont &goto_function) const |
Output the abstract states for a single function as XML. | |
Protected Types | |
typedef std::list< unsigned > | object_listt |
![]() | |
typedef trace_sett | working_sett |
The work queue, sorted using the history's ordering operator. | |
Protected Member Functions | |
void | add_objects (const goto_programt &goto_program) |
void | add_objects (const goto_functionst &goto_functions) |
void | get_objects (const symbolt &symbol, object_listt &dest) |
void | get_objects_rec (const exprt &src, std::list< exprt > &dest) |
void | get_globals (object_listt &globals) |
bool | check_type (const typet &type) const |
![]() | |
virtual statet & | get_state (locationt l) |
virtual statet & | get_state (trace_ptrt p) |
Get the state for the given history, creating it with the factory if it doesn't exist. | |
![]() | |
bool | visit_edge_function_call (const irep_idt &calling_function_id, trace_ptrt p_call, locationt l_return, const irep_idt &callee_function_id, working_sett &working_set, const goto_programt &callee, const goto_functionst &goto_functions, const namespacet &ns) override |
![]() | |
virtual void | initialize (const irep_idt &function_id, const goto_functionst::goto_functiont &goto_function) |
Initialize all the abstract states for a single function. | |
virtual void | initialize (const goto_functionst &goto_functions) |
Initialize all the abstract states for a whole program. | |
virtual void | finalize () |
Override this to add a cleanup or post-processing step after fixedpoint has run. | |
trace_ptrt | entry_state (const goto_programt &goto_program) |
Set the abstract state of the entry location of a single function to the entry state required by the analysis. | |
trace_ptrt | entry_state (const goto_functionst &goto_functions) |
Set the abstract state of the entry location of a whole program to the entry state required by the analysis. | |
trace_ptrt | get_next (working_sett &working_set) |
Get the next location from the work queue. | |
void | put_in_working_set (working_sett &working_set, trace_ptrt t) |
virtual bool | fixedpoint (trace_ptrt starting_trace, const irep_idt &function_id, const goto_programt &goto_program, const goto_functionst &goto_functions, const namespacet &ns) |
Run the fixedpoint algorithm until it reaches a fixed point. | |
virtual void | fixedpoint (trace_ptrt starting_trace, const goto_functionst &goto_functions, const namespacet &ns) |
virtual bool | visit (const irep_idt &function_id, trace_ptrt p, working_sett &working_set, const goto_programt &goto_program, const goto_functionst &goto_functions, const namespacet &ns) |
Perform one step of abstract interpretation from trace t Depending on the instruction type it may compute a number of "edges" or applications of the abstract transformer. | |
virtual bool | visit_function_call (const irep_idt &function_id, trace_ptrt p_call, working_sett &working_set, const goto_programt &goto_program, const goto_functionst &goto_functions, const namespacet &ns) |
virtual bool | visit_end_function (const irep_idt &function_id, trace_ptrt p, working_sett &working_set, const goto_programt &goto_program, const goto_functionst &goto_functions, const namespacet &ns) |
bool | visit_edge (const irep_idt &function_id, trace_ptrt p, const irep_idt &to_function_id, locationt to_l, trace_ptrt caller_history, const namespacet &ns, working_sett &working_set) |
virtual bool | merge (const statet &src, trace_ptrt from, trace_ptrt to) |
Merge the state src , flowing from tracet from to tracet to , into the state currently stored for tracet to . | |
virtual std::unique_ptr< statet > | make_temporary_state (const statet &s) |
Make a copy of a state. | |
Protected Attributes | |
friend | invariant_set_domain_factoryt |
const namespacet & | ns |
value_setst & | value_sets |
inv_object_storet | object_store |
![]() | |
std::unique_ptr< ai_history_factory_baset > | history_factory |
For creating history objects. | |
std::unique_ptr< ai_domain_factory_baset > | domain_factory |
For creating domain objects. | |
std::unique_ptr< ai_storage_baset > | storage |
message_handlert & | message_handler |
Definition at line 21 of file invariant_propagation.h.
Definition at line 41 of file invariant_propagation.h.
|
protected |
Definition at line 57 of file invariant_propagation.h.
invariant_propagationt::invariant_propagationt | ( | const namespacet & | _ns, |
value_setst & | _value_sets | ||
) |
Definition at line 39 of file invariant_propagation.cpp.
|
protected |
Definition at line 158 of file invariant_propagation.cpp.
|
protected |
Definition at line 66 of file invariant_propagation.cpp.
Definition at line 222 of file invariant_propagation.cpp.
|
protected |
Definition at line 209 of file invariant_propagation.cpp.
|
protected |
Definition at line 112 of file invariant_propagation.cpp.
|
protected |
Definition at line 124 of file invariant_propagation.cpp.
|
overridevirtual |
Initialize all the abstract states for a single function.
Override this to do custom per-domain initialization.
Reimplemented from ai_baset.
Definition at line 243 of file invariant_propagation.cpp.
|
inline |
Definition at line 27 of file invariant_propagation.h.
void invariant_propagationt::make_all_false | ( | ) |
Definition at line 58 of file invariant_propagation.cpp.
void invariant_propagationt::make_all_true | ( | ) |
Definition at line 50 of file invariant_propagation.cpp.
void invariant_propagationt::simplify | ( | goto_functionst & | goto_functions | ) |
Definition at line 252 of file invariant_propagation.cpp.
void invariant_propagationt::simplify | ( | goto_programt & | goto_program | ) |
Definition at line 258 of file invariant_propagation.cpp.
|
protected |
Definition at line 50 of file invariant_propagation.h.
|
protected |
Definition at line 52 of file invariant_propagation.h.
|
protected |
Definition at line 55 of file invariant_propagation.h.
|
protected |
Definition at line 53 of file invariant_propagation.h.