Skip to content

Commit 8ab58e6

Browse files
committed
Remove reachability_slicert::operator() definition to cpp file
This is a non-trivial implementation with external dependencies. Upcoming changes will make it even more complex.
1 parent c351198 commit 8ab58e6

File tree

2 files changed

+26
-22
lines changed

2 files changed

+26
-22
lines changed

src/goto-instrument/reachability_slicer.cpp

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,37 @@ Author: Daniel Kroening, [email protected]
1313
/// (and possibly, depending on the parameters, keep those that can be reached
1414
/// from the criterion).
1515

16+
#include "full_slicer_class.h"
1617
#include "reachability_slicer.h"
18+
#include "reachability_slicer_class.h"
19+
20+
#include <util/exception_utils.h>
1721

1822
#include <goto-programs/cfg.h>
1923
#include <goto-programs/remove_calls_no_body.h>
2024
#include <goto-programs/remove_skip.h>
2125
#include <goto-programs/remove_unreachable.h>
2226

23-
#include <util/exception_utils.h>
27+
#include <analyses/is_threaded.h>
2428

25-
#include "full_slicer_class.h"
26-
#include "reachability_slicer_class.h"
29+
void reachability_slicert::operator()(
30+
goto_functionst &goto_functions,
31+
const slicing_criteriont &criterion,
32+
bool include_forward_reachability)
33+
{
34+
cfg(goto_functions);
35+
for(const auto &gf_entry : goto_functions.function_map)
36+
{
37+
forall_goto_program_instructions(i_it, gf_entry.second.body)
38+
cfg[cfg.entry_map[i_it]].function_id = gf_entry.first;
39+
}
40+
41+
is_threadedt is_threaded(goto_functions);
42+
fixedpoint_to_assertions(is_threaded, criterion);
43+
if(include_forward_reachability)
44+
fixedpoint_from_assertions(is_threaded, criterion);
45+
slice(goto_functions);
46+
}
2747

2848
/// Get the set of nodes that correspond to the given criterion, or that can
2949
/// appear in concurrent execution. None of these should be sliced away so

src/goto-instrument/reachability_slicer_class.h

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@ Author: Daniel Kroening, [email protected]
1212
#ifndef CPROVER_GOTO_INSTRUMENT_REACHABILITY_SLICER_CLASS_H
1313
#define CPROVER_GOTO_INSTRUMENT_REACHABILITY_SLICER_CLASS_H
1414

15-
#include <goto-programs/goto_functions.h>
16-
#include <goto-programs/cfg.h>
17-
18-
#include <analyses/is_threaded.h>
15+
#include <goto-programs/goto_program.h>
1916

17+
class goto_functionst;
2018
class slicing_criteriont;
2119

2220
class reachability_slicert
@@ -25,21 +23,7 @@ class reachability_slicert
2523
void operator()(
2624
goto_functionst &goto_functions,
2725
const slicing_criteriont &criterion,
28-
bool include_forward_reachability)
29-
{
30-
cfg(goto_functions);
31-
for(const auto &gf_entry : goto_functions.function_map)
32-
{
33-
forall_goto_program_instructions(i_it, gf_entry.second.body)
34-
cfg[cfg.entry_map[i_it]].function_id = gf_entry.first;
35-
}
36-
37-
is_threadedt is_threaded(goto_functions);
38-
fixedpoint_to_assertions(is_threaded, criterion);
39-
if(include_forward_reachability)
40-
fixedpoint_from_assertions(is_threaded, criterion);
41-
slice(goto_functions);
42-
}
26+
bool include_forward_reachability);
4327

4428
protected:
4529
struct slicer_entryt

0 commit comments

Comments
 (0)