33 bool include_forward_reachability,
40 remove_calls_no_body(goto_functions, message_handler);
52 if(include_forward_reachability)
54 slice(goto_functions);
62 std::vector<reachability_slicert::cfgt::node_indext>
67 std::vector<cfgt::node_indext> sources;
71 criterion(
cfg[e_it.second].function_id, e_it.first) ||
72 is_threaded(e_it.first))
73 sources.push_back(e_it.second);
79 "no slicing criterion found",
81 "provide at least one property using --property <property>"};
95 return node1.function_id == node2.function_id && it1 == it2;
104 std::vector<reachability_slicert::cfgt::node_indext>
106 std::vector<cfgt::node_indext> stack)
108 std::vector<cfgt::node_indext> return_sites;
110 while(!stack.empty())
112 auto &node =
cfg[stack.back()];
115 if(node.reaches_assertion)
117 node.reaches_assertion =
true;
119 for(
const auto &edge : node.in)
121 const auto &pred_node =
cfg[edge.first];
123 if(pred_node.PC->is_end_function())
127 return_sites.push_back(edge.first);
130 std::prev(node.PC)->is_function_call(),
131 "all function return edges should point to the successor of a "
132 "FUNCTION_CALL instruction");
138 stack.push_back(edge.first);
156 std::vector<cfgt::node_indext> stack)
158 while(!stack.empty())
160 auto &node =
cfg[stack.back()];
163 if(node.reaches_assertion)
165 node.reaches_assertion =
true;
167 for(
const auto &edge : node.in)
169 const auto &pred_node =
cfg[edge.first];
171 if(pred_node.PC->is_end_function())
176 stack.push_back(edge.first);
179 std::prev(node.PC)->is_function_call(),
180 "all function return edges should point to the successor of a "
181 "FUNCTION_CALL instruction");
185 else if(pred_node.PC->is_function_call())
192 stack.push_back(edge.first);
208 std::vector<cfgt::node_indext> sources =
get_sources(is_threaded, criterion);
212 std::vector<cfgt::node_indext> return_sites =
228 const cfgt::nodet &call_node,
229 std::vector<cfgt::node_indext> &callsite_successor_stack,
230 std::vector<cfgt::node_indext> &callee_head_stack)
234 INVARIANT(call_node.out.size() == 1,
"Call sites should have one successor");
235 const auto successor_index = call_node.out.begin()->first;
237 auto callsite_successor_pc = std::next(call_node.PC);
239 auto successor_pc =
cfg[successor_index].PC;
243 callee_head_stack.push_back(successor_index);
246 while(!successor_pc->is_end_function())
250 callsite_successor_stack.push_back(
256 callsite_successor_stack.push_back(successor_index);
266 std::vector<reachability_slicert::cfgt::node_indext>
268 std::vector<cfgt::node_indext> stack)
270 std::vector<cfgt::node_indext> called_function_heads;
272 while(!stack.empty())
274 auto &node =
cfg[stack.back()];
277 if(node.reachable_from_assertion)
279 node.reachable_from_assertion =
true;
281 if(node.PC->is_function_call())
290 for(
const auto &edge : node.out)
291 stack.push_back(edge.first);
295 return called_function_heads;
306 std::vector<cfgt::node_indext> stack)
308 while(!stack.empty())
310 auto &node =
cfg[stack.back()];
313 if(node.reachable_from_assertion)
315 node.reachable_from_assertion =
true;
317 if(node.PC->is_function_call())
322 else if(node.PC->is_end_function())
331 for(
const auto &edge : node.out)
332 stack.push_back(edge.first);
347 std::vector<cfgt::node_indext> sources =
get_sources(is_threaded, criterion);
351 std::vector<cfgt::node_indext> return_sites =
367 if(gf_entry.second.body_available())
373 !e.reaches_assertion && !e.reachable_from_assertion &&
374 !i_it->is_end_function())
399 const bool include_forward_reachability,
406 include_forward_reachability,
420 const std::list<std::string> &properties,
421 const bool include_forward_reachability,
428 include_forward_reachability,
440 const std::list<std::string> &functions_list,
443 for(
const auto &
function : functions_list)
448 goto_model.
goto_functions, matching_criterion,
true, message_handler);
478 const std::list<std::string> &properties,