Skip to content

Commit ffa00d7

Browse files
committed
Symex target equation: convert assignments first
Converting assignments (equalities) permits the optimisation of re-using variables generated for a right-hand side to represent the left-hand side. Consequently, no free variables need to be introduced for those left-hand sides when the symbol is seen. If converting, e.g., guards before assignments, no such optimisation is possible.
1 parent 856bcd4 commit ffa00d7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/goto-symex/symex_target_equation.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,9 +332,13 @@ void symex_target_equationt::convert_without_assertions(
332332
hardness.register_ssa_size(SSA_steps.size());
333333
});
334334

335-
convert_guards(decision_procedure);
335+
// The order matters here: the decision procedure may be able to re-use
336+
// variables obtained from constructing the right-hand side of an assignment
337+
// for the left-hand side. Those left-hand sides might then appear in guards
338+
// or assumptions, so do assignments and decls before any of the others.
336339
convert_assignments(decision_procedure);
337340
convert_decls(decision_procedure);
341+
convert_guards(decision_procedure);
338342
convert_assumptions(decision_procedure);
339343
convert_goto_instructions(decision_procedure);
340344
convert_function_calls(decision_procedure);

0 commit comments

Comments
 (0)