26 const irep_idt &destination_function)
34 for(
const auto &func :
54 for(
const auto &ins : fct.second.body.instructions)
70 if(
id2string(gf_entry.first).find(name_snippet) != std::string::npos)
87 message.
debug() <<
"No properties given, so aggressive slicer "
88 <<
"is running over all possible properties"
101 if(!property_loc.has_value())
102 throw "unable to find property in call graph";
115 message.
debug() <<
"Preserving the following functions \n";
Aggressive slicer Consider the control flow graph of the goto program and a criterion description of ...
std::set< irep_idt > get_reaching_functions(const call_grapht::directed_grapht &graph, const irep_idt &function)
Get functions that can reach a given function.
std::list< irep_idt > get_shortest_function_path(const call_grapht::directed_grapht &graph, const irep_idt &src, const irep_idt &dest)
Get list of functions on the shortest path between two functions.
std::set< irep_idt > get_functions_reachable_within_n_steps(const call_grapht::directed_grapht &graph, const std::set< irep_idt > &start_functions, std::size_t n)
Get either callers or callees reachable from a given list of functions within N steps.
Function Call Graph Helpers.
message_handlert & message_handler
std::list< std::string > user_specified_properties
call_grapht::directed_grapht call_graph
void doit()
Removes the body of all functions except those on the shortest path or functions that are reachable f...
std::list< std::string > name_snippets
void get_all_functions_containing_properties()
Finds all functions that contain a property, and adds them to the list of functions to keep.
bool preserve_all_direct_paths
void note_functions_to_keep(const irep_idt &destination_function)
notes functions to keep in the slice based on the program start function and the given destination fu...
const irep_idt start_function
std::set< irep_idt > functions_to_keep
void find_functions_that_contain_name_snippet()
Finds all functions whose name contains a name snippet and adds them to the std::unordered_set of ire...
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
function_mapt function_map
symbol_tablet symbol_table
Symbol table.
goto_functionst goto_functions
GOTO functions.
Class that provides messages with a built-in verbosity 'level'.
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
bool lookup(const irep_idt &name, const symbolt *&symbol) const override
See documentation for namespace_baset::lookup().
const std::string & id2string(const irep_idt &d)
void remove_function(goto_modelt &goto_model, const irep_idt &identifier, message_handlert &message_handler)
Remove the body of function "identifier" such that an analysis will treat it as a side-effect free fu...
Remove function definition.
std::optional< source_locationt > find_property(const irep_idt &property, const goto_functionst &goto_functions)
Returns a source_locationt that corresponds to the property given by an irep_idt.
#define INITIALIZE_FUNCTION
const code_typet & to_code_type(const typet &type)
Cast a typet to a code_typet.