Skip to content

Commit 410f50e

Browse files
Merge pull request #4381 from romainbrenguier/clean-up/ssa_step
Move SSA_stept definition to its own header file
2 parents ac808df + 2eea492 commit 410f50e

17 files changed

+567
-487
lines changed

src/goto-checker/goto_symex_fault_localizer.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ operator()(const irep_idt &failed_property_id)
4646
return fault_location;
4747
}
4848

49-
const symex_target_equationt::SSA_stept &
50-
goto_symex_fault_localizert::collect_guards(
49+
const SSA_stept &goto_symex_fault_localizert::collect_guards(
5150
const irep_idt &failed_property_id,
5251
localization_pointst &localization_points,
5352
fault_location_infot &fault_location)
@@ -74,7 +73,7 @@ goto_symex_fault_localizert::collect_guards(
7473
}
7574

7675
bool goto_symex_fault_localizert::check(
77-
const symex_target_equationt::SSA_stept &failed_step,
76+
const SSA_stept &failed_step,
7877
const localization_pointst &localization_points,
7978
const localization_points_valuet &value)
8079
{
@@ -116,7 +115,7 @@ void goto_symex_fault_localizert::update_scores(
116115
}
117116

118117
void goto_symex_fault_localizert::localize_linear(
119-
const symex_target_equationt::SSA_stept &failed_step,
118+
const SSA_stept &failed_step,
120119
const localization_pointst &localization_points)
121120
{
122121
localization_points_valuet v(localization_points.size(), tvt::unknown());

src/goto-checker/goto_symex_fault_localizer.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,23 @@ class goto_symex_fault_localizert
4444
/// Collects the guards as \p localization_points up to \p failed_property_id
4545
/// and initializes fault_location_info, and returns the SSA step of
4646
/// the failed property
47-
const symex_target_equationt::SSA_stept &collect_guards(
47+
const SSA_stept &collect_guards(
4848
const irep_idt &failed_property_id,
4949
localization_pointst &localization_points,
5050
fault_location_infot &fault_location);
5151

5252
// specify a localization point combination to check
5353
typedef std::vector<tvt> localization_points_valuet;
5454
bool check(
55-
const symex_target_equationt::SSA_stept &failed_step,
55+
const SSA_stept &failed_step,
5656
const localization_pointst &,
5757
const localization_points_valuet &);
5858

5959
void update_scores(const localization_pointst &);
6060

6161
// localization method: flip each point
62-
void localize_linear(
63-
const symex_target_equationt::SSA_stept &failed_step,
64-
const localization_pointst &);
62+
void
63+
localize_linear(const SSA_stept &failed_step, const localization_pointst &);
6564
};
6665

6766
#endif // CPROVER_GOTO_CHECKER_GOTO_SYMEX_FAULT_LOCALIZER_H

src/goto-symex/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ SRC = auto_objects.cpp \
1515
show_program.cpp \
1616
show_vcc.cpp \
1717
slice.cpp \
18+
ssa_step.cpp \
1819
symex_assign.cpp \
1920
symex_atomic_section.cpp \
2021
symex_builtin_functions.cpp \

src/goto-symex/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ digraph G {
4848
\subsection symex-overview Overview
4949

5050
The \ref bmct class gets a reference to an \ref symex_target_equationt
51-
"equation" (initially, an empty list of \ref symex_target_equationt::SSA_stept
51+
"equation" (initially, an empty list of \ref SSA_stept
5252
"single-static assignment steps") and a goto-program from the frontend.
5353
The \ref bmct creates a goto_symext to symbolically execute the
5454
goto-program, thereby filling the equation, which can then be passed

src/goto-symex/build_goto_trace.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static void set_internal_dynamic_object(
134134
/// set internal for variables assignments related to dynamic_object and CPROVER
135135
/// internal functions (e.g., __CPROVER_initialize)
136136
static void update_internal_field(
137-
const symex_target_equationt::SSA_stept &SSA_step,
137+
const SSA_stept &SSA_step,
138138
goto_trace_stept &goto_trace_step,
139139
const namespacet &ns)
140140
{
@@ -201,7 +201,7 @@ void build_goto_trace(
201201
last_step_to_keep = it;
202202
}
203203

204-
const symex_target_equationt::SSA_stept &SSA_step=*it;
204+
const SSA_stept &SSA_step = *it;
205205

206206
if(prop_conv.l_get(SSA_step.guard_literal)!=tvt(true))
207207
continue;

src/goto-symex/equation_conversion_exceptions.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ Author: Diffblue Ltd.
1616

1717
#include <util/format_expr.h>
1818

19-
#include "symex_target_equation.h"
19+
#include "ssa_step.h"
2020

2121
class equation_conversion_exceptiont : public std::runtime_error
2222
{
2323
public:
2424
equation_conversion_exceptiont(
2525
const std::string &message,
26-
const symex_target_equationt::SSA_stept &step)
26+
const SSA_stept &step)
2727
: runtime_error(message), step(step)
2828
{
2929
std::ostringstream error_msg;
@@ -40,7 +40,7 @@ class equation_conversion_exceptiont : public std::runtime_error
4040
}
4141

4242
private:
43-
symex_target_equationt::SSA_stept step;
43+
SSA_stept step;
4444
std::string error_message;
4545
};
4646

src/goto-symex/partial_order_concurrency.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ void partial_order_concurrencyt::add_init_writes(
5858
{
5959
init_steps.emplace_back(
6060
e_it->source, goto_trace_stept::typet::SHARED_WRITE);
61-
symex_target_equationt::SSA_stept &SSA_step=init_steps.back();
61+
SSA_stept &SSA_step = init_steps.back();
6262

6363
SSA_step.guard=true_exprt();
6464
// no SSA L2 index, thus nondet value

src/goto-symex/partial_order_concurrency.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class partial_order_concurrencyt:public messaget
2525
explicit partial_order_concurrencyt(const namespacet &_ns);
2626
virtual ~partial_order_concurrencyt();
2727

28-
typedef symex_target_equationt::SSA_stept eventt;
28+
typedef SSA_stept eventt;
2929
typedef symex_target_equationt::SSA_stepst eventst;
3030
typedef eventst::const_iterator event_it;
3131

src/goto-symex/postcondition.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,16 @@ class postconditiont
2222
postconditiont(
2323
const namespacet &_ns,
2424
const value_sett &_value_set,
25-
const symex_target_equationt::SSA_stept &_SSA_step,
26-
const goto_symex_statet &_s):
27-
ns(_ns),
28-
value_set(_value_set),
29-
SSA_step(_SSA_step),
30-
s(_s)
25+
const SSA_stept &_SSA_step,
26+
const goto_symex_statet &_s)
27+
: ns(_ns), value_set(_value_set), SSA_step(_SSA_step), s(_s)
3128
{
3229
}
3330

3431
protected:
3532
const namespacet &ns;
3633
const value_sett &value_set;
37-
const symex_target_equationt::SSA_stept &SSA_step;
34+
const SSA_stept &SSA_step;
3835
const goto_symex_statet &s;
3936

4037
public:

src/goto-symex/precondition.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,21 @@ class preconditiont
2525
const namespacet &_ns,
2626
value_setst &_value_sets,
2727
const goto_programt::const_targett _target,
28-
const symex_target_equationt::SSA_stept &_SSA_step,
29-
const goto_symex_statet &_s):
30-
ns(_ns),
31-
value_sets(_value_sets),
32-
target(_target),
33-
SSA_step(_SSA_step),
34-
s(_s)
28+
const SSA_stept &_SSA_step,
29+
const goto_symex_statet &_s)
30+
: ns(_ns),
31+
value_sets(_value_sets),
32+
target(_target),
33+
SSA_step(_SSA_step),
34+
s(_s)
3535
{
3636
}
3737

3838
protected:
3939
const namespacet &ns;
4040
value_setst &value_sets;
4141
const goto_programt::const_targett target;
42-
const symex_target_equationt::SSA_stept &SSA_step;
42+
const SSA_stept &SSA_step;
4343
const goto_symex_statet &s;
4444
void compute_rec(exprt &dest);
4545

src/goto-symex/show_program.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Author: Daniel Kroening, [email protected]
2424
/// \param count: Step number, incremented after output
2525
static void show_step(
2626
const namespacet &ns,
27-
const symex_target_equationt::SSA_stept &step,
27+
const SSA_stept &step,
2828
const std::string &annotation,
2929
std::size_t &count)
3030
{

src/goto-symex/slice.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ void symex_slicet::slice(symex_target_equationt &equation)
5151
slice(*it);
5252
}
5353

54-
void symex_slicet::slice(symex_target_equationt::SSA_stept &SSA_step)
54+
void symex_slicet::slice(SSA_stept &SSA_step)
5555
{
5656
get_symbols(SSA_step.guard);
5757

@@ -109,8 +109,7 @@ void symex_slicet::slice(symex_target_equationt::SSA_stept &SSA_step)
109109
}
110110
}
111111

112-
void symex_slicet::slice_assignment(
113-
symex_target_equationt::SSA_stept &SSA_step)
112+
void symex_slicet::slice_assignment(SSA_stept &SSA_step)
114113
{
115114
PRECONDITION(SSA_step.ssa_lhs.id() == ID_symbol);
116115
const irep_idt &id=SSA_step.ssa_lhs.get_identifier();
@@ -124,8 +123,7 @@ void symex_slicet::slice_assignment(
124123
get_symbols(SSA_step.ssa_rhs);
125124
}
126125

127-
void symex_slicet::slice_decl(
128-
symex_target_equationt::SSA_stept &SSA_step)
126+
void symex_slicet::slice_decl(SSA_stept &SSA_step)
129127
{
130128
const irep_idt &id = to_symbol_expr(SSA_step.ssa_lhs).get_identifier();
131129

@@ -152,7 +150,7 @@ void symex_slicet::collect_open_variables(
152150
it!=equation.SSA_steps.end();
153151
it++)
154152
{
155-
const symex_target_equationt::SSA_stept &SSA_step=*it;
153+
const SSA_stept &SSA_step = *it;
156154

157155
get_symbols(SSA_step.guard);
158156

0 commit comments

Comments
 (0)