Skip to content

Commit

Permalink
Cleanup symex_target_equationt API
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tautschnig committed Aug 22, 2024
1 parent 6752c40 commit 2aad3d8
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 60 deletions.
2 changes: 1 addition & 1 deletion src/goto-symex/symex_target_equation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ void symex_target_equationt::convert(decision_proceduret &decision_procedure)
const auto convert_SSA_start = std::chrono::steady_clock::now();

convert_without_assertions(decision_procedure);
convert_assertions(decision_procedure);
convert_assertions(decision_procedure, true);

const auto convert_SSA_stop = std::chrono::steady_clock::now();
std::chrono::duration<double> convert_SSA_runtime =
Expand Down
100 changes: 41 additions & 59 deletions src/goto-symex/symex_target_equation.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,53 +183,16 @@ class symex_target_equationt:public symex_targett
/// interface
void convert_without_assertions(decision_proceduret &decision_procedure);

/// Converts assignments: set the equality _lhs==rhs_ to _True_.
/// \param decision_procedure: A handle to a decision procedure
/// interface
void convert_assignments(decision_proceduret &decision_procedure);

/// Converts declarations: these are effectively ignored by the decision
/// procedure.
/// \param decision_procedure: A handle to a decision procedure
/// interface
void convert_decls(decision_proceduret &decision_procedure);

/// Converts assumptions: convert the expression the assumption represents.
/// \param decision_procedure: A handle to a decision procedure interface
void convert_assumptions(decision_proceduret &decision_procedure);

/// Converts assertions: build a disjunction of negated assertions.
/// \param decision_procedure: A handle to a decision procedure interface
/// \param optimized_for_single_assertions: Use an optimized encoding for
/// single assertions (unsound for incremental conversions)
void convert_assertions(
decision_proceduret &decision_procedure,
bool optimized_for_single_assertions = true);

/// Converts constraints: set the represented condition to _True_.
/// \param decision_procedure: A handle to a decision procedure interface
void convert_constraints(decision_proceduret &decision_procedure);

/// Converts goto instructions: convert the expression representing the
/// condition of this goto.
/// \param decision_procedure: A handle to a decision procedure interface
void convert_goto_instructions(decision_proceduret &decision_procedure);

/// Converts guards: convert the expression the guard represents.
/// \param decision_procedure: A handle to a decision procedure interface
void convert_guards(decision_proceduret &decision_procedure);

/// Converts function calls: for each argument build an equality between its
/// symbol and the argument itself.
/// \param decision_procedure: A handle to a decision procedure interface
void convert_function_calls(decision_proceduret &decision_procedure);
bool optimized_for_single_assertions);

/// Converts I/O: for each argument build an equality between its
/// symbol and the argument itself.
/// \param decision_procedure: A handle to a decision procedure interface
void convert_io(decision_proceduret &decision_procedure);

exprt make_expression() const;
typedef std::list<SSA_stept> SSA_stepst;
SSA_stepst SSA_steps;

std::size_t count_assertions() const
{
Expand All @@ -247,27 +210,8 @@ class symex_target_equationt:public symex_targett
}));
}

typedef std::list<SSA_stept> SSA_stepst;
SSA_stepst SSA_steps;

SSA_stepst::iterator get_SSA_step(std::size_t s)
{
SSA_stepst::iterator it=SSA_steps.begin();
for(; s!=0; s--)
{
PRECONDITION(it != SSA_steps.end());
it++;
}
return it;
}

void output(std::ostream &out) const;

void clear()
{
SSA_steps.clear();
}

bool has_threads() const
{
return std::any_of(
Expand All @@ -283,6 +227,44 @@ class symex_target_equationt:public symex_targett
}

protected:
/// Converts assignments: set the equality _lhs==rhs_ to _True_.
/// \param decision_procedure: A handle to a decision procedure
/// interface
void convert_assignments(decision_proceduret &decision_procedure);

/// Converts declarations: these are effectively ignored by the decision
/// procedure.
/// \param decision_procedure: A handle to a decision procedure
/// interface
void convert_decls(decision_proceduret &decision_procedure);

/// Converts assumptions: convert the expression the assumption represents.
/// \param decision_procedure: A handle to a decision procedure interface
void convert_assumptions(decision_proceduret &decision_procedure);

/// Converts constraints: set the represented condition to _True_.
/// \param decision_procedure: A handle to a decision procedure interface
void convert_constraints(decision_proceduret &decision_procedure);

/// Converts goto instructions: convert the expression representing the
/// condition of this goto.
/// \param decision_procedure: A handle to a decision procedure interface
void convert_goto_instructions(decision_proceduret &decision_procedure);

/// Converts guards: convert the expression the guard represents.
/// \param decision_procedure: A handle to a decision procedure interface
void convert_guards(decision_proceduret &decision_procedure);

/// Converts function calls: for each argument build an equality between its
/// symbol and the argument itself.
/// \param decision_procedure: A handle to a decision procedure interface
void convert_function_calls(decision_proceduret &decision_procedure);

/// Converts I/O: for each argument build an equality between its
/// symbol and the argument itself.
/// \param decision_procedure: A handle to a decision procedure interface
void convert_io(decision_proceduret &decision_procedure);

messaget log;

// for enforcing sharing in the expressions stored
Expand Down

0 comments on commit 2aad3d8

Please sign in to comment.