Skip to content

Remove duplicate implementation of stash_variables #6725

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions src/goto-instrument/accelerate/polynomial_accelerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ void polynomial_acceleratort::stash_polynomials(
{
expr_sett modified;
utils.find_modified(body, modified);
stash_variables(program, modified, substitution);
utils.stash_variables(program, modified, substitution);

for(std::map<exprt, polynomialt>::iterator it=polynomials.begin();
it!=polynomials.end();
Expand All @@ -740,25 +740,6 @@ void polynomial_acceleratort::stash_polynomials(
}
}

void polynomial_acceleratort::stash_variables(
scratch_programt &program,
expr_sett modified,
substitutiont &substitution)
{
find_symbols_sett vars =
find_symbols_or_nexts(modified.begin(), modified.end());
irep_idt loop_counter_name=to_symbol_expr(loop_counter).get_identifier();
vars.erase(loop_counter_name);

for(const irep_idt &id : vars)
{
const symbolt &orig = symbol_table.lookup_ref(id);
symbolt stashed_sym=utils.fresh_symbol("polynomial::stash", orig.type);
substitution[orig.symbol_expr()]=stashed_sym.symbol_expr();
program.assign(stashed_sym.symbol_expr(), orig.symbol_expr());
}
}

/*
* Finds a precondition which guarantees that all the assumptions and assertions
* along this path hold.
Expand Down
4 changes: 0 additions & 4 deletions src/goto-instrument/accelerate/polynomial_accelerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,6 @@ class polynomial_acceleratort
bool check_inductive(
std::map<exprt, polynomialt> polynomials,
goto_programt::instructionst &body);
void stash_variables(
scratch_programt &program,
expr_sett modified,
substitutiont &substitution);
void stash_polynomials(
scratch_programt &program,
std::map<exprt, polynomialt> &polynomials,
Expand Down