@@ -30,13 +30,14 @@ Author: Daniel Kroening, kroening@kroening.com
3030void reachability_slicert::operator ()(
3131 goto_functionst &goto_functions,
3232 const slicing_criteriont &criterion,
33- bool include_forward_reachability)
33+ bool include_forward_reachability,
34+ message_handlert &message_handler)
3435{
3536 // Replace function calls without body by non-deterministic return values to
3637 // ensure the CFG does not consider instructions after such a call to be
3738 // unreachable.
3839 remove_calls_no_bodyt remove_calls_no_body;
39- remove_calls_no_body (goto_functions);
40+ remove_calls_no_body (goto_functions, message_handler );
4041 goto_functions.update ();
4142
4243 cfg (goto_functions);
@@ -392,13 +393,18 @@ void reachability_slicert::slice(goto_functionst &goto_functions)
392393// / \param include_forward_reachability: Determines if only instructions
393394// / from which the criterion is reachable should be kept (false) or also
394395// / those reachable from the criterion (true)
396+ // / \param message_handler: message handler
395397void reachability_slicer (
396398 goto_modelt &goto_model,
397- const bool include_forward_reachability)
399+ const bool include_forward_reachability,
400+ message_handlert &message_handler)
398401{
399402 reachability_slicert s;
400403 assert_criteriont a;
401- s (goto_model.goto_functions , a, include_forward_reachability);
404+ s (goto_model.goto_functions ,
405+ a,
406+ include_forward_reachability,
407+ message_handler);
402408}
403409
404410// / Perform reachability slicing on goto_model for selected properties.
@@ -408,34 +414,42 @@ void reachability_slicer(
408414// / \param include_forward_reachability: Determines if only instructions
409415// / from which the criterion is reachable should be kept (false) or also
410416// / those reachable from the criterion (true)
417+ // / \param message_handler: message handler
411418void reachability_slicer (
412419 goto_modelt &goto_model,
413420 const std::list<std::string> &properties,
414- const bool include_forward_reachability)
421+ const bool include_forward_reachability,
422+ message_handlert &message_handler)
415423{
416424 reachability_slicert s;
417425 properties_criteriont p (properties);
418- s (goto_model.goto_functions , p, include_forward_reachability);
426+ s (goto_model.goto_functions ,
427+ p,
428+ include_forward_reachability,
429+ message_handler);
419430}
420431
421432// / Perform reachability slicing on goto_model for selected functions.
422433// / \param goto_model: Goto program to slice
423434// / \param functions_list: The functions relevant for the slicing (i.e. starting
424435// / point for the search in the CFG). Anything that is reachable in the CFG
425436// / starting from these functions will be kept.
437+ // / \param message_handler: message handler
426438void function_path_reachability_slicer (
427439 goto_modelt &goto_model,
428- const std::list<std::string> &functions_list)
440+ const std::list<std::string> &functions_list,
441+ message_handlert &message_handler)
429442{
430443 for (const auto &function : functions_list)
431444 {
432445 in_function_criteriont matching_criterion (function);
433446 reachability_slicert slicer;
434- slicer (goto_model.goto_functions , matching_criterion, true );
447+ slicer (
448+ goto_model.goto_functions , matching_criterion, true , message_handler);
435449 }
436450
437451 remove_calls_no_bodyt remove_calls_no_body;
438- remove_calls_no_body (goto_model.goto_functions );
452+ remove_calls_no_body (goto_model.goto_functions , message_handler );
439453
440454 goto_model.goto_functions .update ();
441455 goto_model.goto_functions .compute_loop_numbers ();
@@ -445,19 +459,24 @@ void function_path_reachability_slicer(
445459// / comprising all properties. Only instructions from which the criterion
446460// / is reachable will be kept.
447461// / \param goto_model: Goto program to slice
448- void reachability_slicer (goto_modelt &goto_model)
462+ // / \param message_handler: message handler
463+ void reachability_slicer (
464+ goto_modelt &goto_model,
465+ message_handlert &message_handler)
449466{
450- reachability_slicer (goto_model, false );
467+ reachability_slicer (goto_model, false , message_handler );
451468}
452469
453470// / Perform reachability slicing on goto_model for selected properties. Only
454471// / instructions from which the criterion is reachable will be kept.
455472// / \param goto_model: Goto program to slice
456473// / \param properties: The properties relevant for the slicing (i.e. starting
457474// / point for the search in the cfg)
475+ // / \param message_handler: message handler
458476void reachability_slicer (
459477 goto_modelt &goto_model,
460- const std::list<std::string> &properties)
478+ const std::list<std::string> &properties,
479+ message_handlert &message_handler)
461480{
462- reachability_slicer (goto_model, properties, false );
481+ reachability_slicer (goto_model, properties, false , message_handler );
463482}
0 commit comments