Skip to content

Commit fa227a0

Browse files
Make goto_instruction take a renamedt argument
This reflects the assumptions on the argument better.
1 parent 57c960f commit fa227a0

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

src/goto-symex/symex_goto.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ void goto_symext::symex_goto(statet &state)
5959
exprt new_guard = instruction.get_condition();
6060
clean_expr(new_guard, state, false);
6161

62-
new_guard = state.rename(std::move(new_guard), ns).get();
63-
do_simplify(new_guard);
62+
renamedt<exprt, L2> renamed_guard = state.rename(std::move(new_guard), ns);
63+
if(symex_config.simplify_opt)
64+
renamed_guard.simplify(ns);
65+
new_guard = renamed_guard.get();
6466

6567
if(new_guard.is_false())
6668
{
@@ -71,7 +73,7 @@ void goto_symext::symex_goto(statet &state)
7173
return; // nothing to do
7274
}
7375

74-
target.goto_instruction(state.guard.as_expr(), new_guard, state.source);
76+
target.goto_instruction(state.guard.as_expr(), renamed_guard, state.source);
7577

7678
DATA_INVARIANT(
7779
!instruction.targets.empty(), "goto should have at least one target");

src/goto-symex/symex_target.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,8 @@ class symex_targett
248248
/// goto instruction
249249
virtual void goto_instruction(
250250
const exprt &guard,
251-
const exprt &cond,
252-
const sourcet &source)=0;
251+
const renamedt<exprt, L2> &cond,
252+
const sourcet &source) = 0;
253253

254254
/// Record a _global_ constraint: there is no guard limiting its scope.
255255
/// \param cond: Condition represented by this constraint

src/goto-symex/symex_target_equation.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,14 +304,14 @@ void symex_target_equationt::assertion(
304304

305305
void symex_target_equationt::goto_instruction(
306306
const exprt &guard,
307-
const exprt &cond,
307+
const renamedt<exprt, L2> &cond,
308308
const sourcet &source)
309309
{
310310
SSA_steps.emplace_back(source, goto_trace_stept::typet::GOTO);
311311
SSA_stept &SSA_step=SSA_steps.back();
312312

313313
SSA_step.guard=guard;
314-
SSA_step.cond_expr=cond;
314+
SSA_step.cond_expr = cond.get();
315315

316316
merge_ireps(SSA_step);
317317
}

src/goto-symex/symex_target_equation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class symex_target_equationt:public symex_targett
142142
/// \copydoc symex_targett::goto_instruction()
143143
virtual void goto_instruction(
144144
const exprt &guard,
145-
const exprt &cond,
145+
const renamedt<exprt, L2> &cond,
146146
const sourcet &source);
147147

148148
/// \copydoc symex_targett::constraint()

0 commit comments

Comments
 (0)