Skip to content

Commit 2aad3d8

Browse files
committed
Cleanup symex_target_equationt API
Remove methods that were never used (and one that wasn't even implemented), mark `protected` what doesn't need to be part of the public API, and remove an unnecessary case of a default parameter.
1 parent 6752c40 commit 2aad3d8

File tree

2 files changed

+42
-60
lines changed

2 files changed

+42
-60
lines changed

src/goto-symex/symex_target_equation.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ void symex_target_equationt::convert(decision_proceduret &decision_procedure)
349349
const auto convert_SSA_start = std::chrono::steady_clock::now();
350350

351351
convert_without_assertions(decision_procedure);
352-
convert_assertions(decision_procedure);
352+
convert_assertions(decision_procedure, true);
353353

354354
const auto convert_SSA_stop = std::chrono::steady_clock::now();
355355
std::chrono::duration<double> convert_SSA_runtime =

src/goto-symex/symex_target_equation.h

+41-59
Original file line numberDiff line numberDiff line change
@@ -183,53 +183,16 @@ class symex_target_equationt:public symex_targett
183183
/// interface
184184
void convert_without_assertions(decision_proceduret &decision_procedure);
185185

186-
/// Converts assignments: set the equality _lhs==rhs_ to _True_.
187-
/// \param decision_procedure: A handle to a decision procedure
188-
/// interface
189-
void convert_assignments(decision_proceduret &decision_procedure);
190-
191-
/// Converts declarations: these are effectively ignored by the decision
192-
/// procedure.
193-
/// \param decision_procedure: A handle to a decision procedure
194-
/// interface
195-
void convert_decls(decision_proceduret &decision_procedure);
196-
197-
/// Converts assumptions: convert the expression the assumption represents.
198-
/// \param decision_procedure: A handle to a decision procedure interface
199-
void convert_assumptions(decision_proceduret &decision_procedure);
200-
201186
/// Converts assertions: build a disjunction of negated assertions.
202187
/// \param decision_procedure: A handle to a decision procedure interface
203188
/// \param optimized_for_single_assertions: Use an optimized encoding for
204189
/// single assertions (unsound for incremental conversions)
205190
void convert_assertions(
206191
decision_proceduret &decision_procedure,
207-
bool optimized_for_single_assertions = true);
208-
209-
/// Converts constraints: set the represented condition to _True_.
210-
/// \param decision_procedure: A handle to a decision procedure interface
211-
void convert_constraints(decision_proceduret &decision_procedure);
212-
213-
/// Converts goto instructions: convert the expression representing the
214-
/// condition of this goto.
215-
/// \param decision_procedure: A handle to a decision procedure interface
216-
void convert_goto_instructions(decision_proceduret &decision_procedure);
217-
218-
/// Converts guards: convert the expression the guard represents.
219-
/// \param decision_procedure: A handle to a decision procedure interface
220-
void convert_guards(decision_proceduret &decision_procedure);
221-
222-
/// Converts function calls: for each argument build an equality between its
223-
/// symbol and the argument itself.
224-
/// \param decision_procedure: A handle to a decision procedure interface
225-
void convert_function_calls(decision_proceduret &decision_procedure);
192+
bool optimized_for_single_assertions);
226193

227-
/// Converts I/O: for each argument build an equality between its
228-
/// symbol and the argument itself.
229-
/// \param decision_procedure: A handle to a decision procedure interface
230-
void convert_io(decision_proceduret &decision_procedure);
231-
232-
exprt make_expression() const;
194+
typedef std::list<SSA_stept> SSA_stepst;
195+
SSA_stepst SSA_steps;
233196

234197
std::size_t count_assertions() const
235198
{
@@ -247,27 +210,8 @@ class symex_target_equationt:public symex_targett
247210
}));
248211
}
249212

250-
typedef std::list<SSA_stept> SSA_stepst;
251-
SSA_stepst SSA_steps;
252-
253-
SSA_stepst::iterator get_SSA_step(std::size_t s)
254-
{
255-
SSA_stepst::iterator it=SSA_steps.begin();
256-
for(; s!=0; s--)
257-
{
258-
PRECONDITION(it != SSA_steps.end());
259-
it++;
260-
}
261-
return it;
262-
}
263-
264213
void output(std::ostream &out) const;
265214

266-
void clear()
267-
{
268-
SSA_steps.clear();
269-
}
270-
271215
bool has_threads() const
272216
{
273217
return std::any_of(
@@ -283,6 +227,44 @@ class symex_target_equationt:public symex_targett
283227
}
284228

285229
protected:
230+
/// Converts assignments: set the equality _lhs==rhs_ to _True_.
231+
/// \param decision_procedure: A handle to a decision procedure
232+
/// interface
233+
void convert_assignments(decision_proceduret &decision_procedure);
234+
235+
/// Converts declarations: these are effectively ignored by the decision
236+
/// procedure.
237+
/// \param decision_procedure: A handle to a decision procedure
238+
/// interface
239+
void convert_decls(decision_proceduret &decision_procedure);
240+
241+
/// Converts assumptions: convert the expression the assumption represents.
242+
/// \param decision_procedure: A handle to a decision procedure interface
243+
void convert_assumptions(decision_proceduret &decision_procedure);
244+
245+
/// Converts constraints: set the represented condition to _True_.
246+
/// \param decision_procedure: A handle to a decision procedure interface
247+
void convert_constraints(decision_proceduret &decision_procedure);
248+
249+
/// Converts goto instructions: convert the expression representing the
250+
/// condition of this goto.
251+
/// \param decision_procedure: A handle to a decision procedure interface
252+
void convert_goto_instructions(decision_proceduret &decision_procedure);
253+
254+
/// Converts guards: convert the expression the guard represents.
255+
/// \param decision_procedure: A handle to a decision procedure interface
256+
void convert_guards(decision_proceduret &decision_procedure);
257+
258+
/// Converts function calls: for each argument build an equality between its
259+
/// symbol and the argument itself.
260+
/// \param decision_procedure: A handle to a decision procedure interface
261+
void convert_function_calls(decision_proceduret &decision_procedure);
262+
263+
/// Converts I/O: for each argument build an equality between its
264+
/// symbol and the argument itself.
265+
/// \param decision_procedure: A handle to a decision procedure interface
266+
void convert_io(decision_proceduret &decision_procedure);
267+
286268
messaget log;
287269

288270
// for enforcing sharing in the expressions stored

0 commit comments

Comments
 (0)