30 const exprt &src_original,
33 if(src_ssa.
id()!=src_original.
id())
47 tmp.
index()=index_value;
53 return std::move(tmp);
58 else if(
id==ID_member)
90 return std::move(tmp2);
92 else if(
id==ID_typecast)
100 return std::move(tmp);
102 else if(
id==ID_byte_extract_little_endian ||
103 id==ID_byte_extract_big_endian)
122 if(expr.
id()==ID_symbol)
124 const auto &type = expr.
type();
125 if(type.id() != ID_code && type.id() != ID_mathematical_function)
129 if(!ns.
lookup(
id, symbol))
158 if(SSA_step.
source.
pc->source_location().as_string().empty())
175 if(SSA_step.
source.
pc->code().get_statement() != ID_function_call)
185 if(type.
id() == ID_array)
216 typedef symex_target_equationt::SSA_stepst::const_iterator ssa_step_iteratort;
217 typedef std::map<mp_integer, std::vector<ssa_step_iteratort>> time_mapt;
222 ssa_step_iteratort last_step_to_keep = target.
SSA_steps.end();
223 bool last_step_was_kept =
false;
228 for(ssa_step_iteratort it = target.
SSA_steps.begin();
233 last_step_to_keep == target.
SSA_steps.end() &&
234 is_last_step_to_keep(it, decision_procedure))
236 last_step_to_keep = it;
244 if(it->is_constraint() ||
247 else if(it->is_atomic_begin())
256 else if(it->is_shared_read() || it->is_shared_write() ||
261 if(it->is_shared_read() || it->is_shared_write())
266 exprt clock_value = decision_procedure.
get(
269 const auto cv = numeric_cast<mp_integer>(clock_value);
275 else if(it->is_atomic_end() && current_time<0)
278 INVARIANT(current_time >= 0,
"time keeping inconsistency");
283 time_mapt::const_iterator time_before_steps_it =
284 time_map.find(time_before);
286 if(time_before_steps_it != time_map.end())
288 std::vector<ssa_step_iteratort> ¤t_time_steps =
289 time_map[current_time];
291 current_time_steps.insert(
292 current_time_steps.end(),
293 time_before_steps_it->second.begin(),
294 time_before_steps_it->second.end());
296 time_map.erase(time_before_steps_it);
304 if(it->is_assignment() &&
313 if(it == last_step_to_keep)
315 last_step_was_kept =
true;
318 time_map[current_time].push_back(it);
322 last_step_to_keep == target.
SSA_steps.end() || last_step_was_kept,
323 "last step in SSA trace to keep must not be filtered out as a sync "
324 "instruction, not-taken branch, PHI node, or similar");
329 unsigned step_nr = 0;
331 for(
const auto &time_and_ssa_steps : time_map)
333 for(
const auto &ssa_step_it : time_and_ssa_steps.second)
335 const auto &SSA_step = *ssa_step_it;
339 goto_trace_step.
step_nr = ++step_nr;
341 goto_trace_step.
thread_nr = SSA_step.source.thread_nr;
342 goto_trace_step.
pc = SSA_step.source.pc;
343 goto_trace_step.
function_id = SSA_step.source.function_id;
344 if(SSA_step.is_assert())
346 goto_trace_step.
comment = SSA_step.comment;
347 goto_trace_step.
property_id = SSA_step.get_property_id();
349 goto_trace_step.
type = SSA_step.type;
350 goto_trace_step.
hidden = SSA_step.hidden;
352 goto_trace_step.
io_id = SSA_step.io_id;
353 goto_trace_step.
formatted = SSA_step.formatted;
358 arg = decision_procedure.
get(arg);
364 (SSA_step.is_assignment() &&
365 (SSA_step.assignment_type ==
367 SSA_step.assignment_type ==
372 if(SSA_step.original_full_lhs.is_not_nil())
378 SSA_step.original_full_lhs,
379 SSA_step.ssa_full_lhs),
384 if(SSA_step.ssa_full_lhs.is_not_nil())
387 decision_procedure.
get(SSA_step.ssa_full_lhs);
393 for(
const auto &j : SSA_step.converted_io_args)
395 if(j.is_constant() || j.id() == ID_string_constant)
397 goto_trace_step.
io_args.push_back(j);
401 exprt tmp = decision_procedure.
get(j);
402 goto_trace_step.
io_args.push_back(tmp);
406 if(SSA_step.is_assert() || SSA_step.is_assume() || SSA_step.is_goto())
408 goto_trace_step.
cond_expr = SSA_step.cond_expr;
411 decision_procedure.
get(SSA_step.cond_handle).
is_true();
414 if(ssa_step_it == last_step_to_keep)
422 symex_target_equationt::SSA_stepst::const_iterator last_step_to_keep,
427 const auto is_last_step_to_keep =
429 symex_target_equationt::SSA_stepst::const_iterator it,
433 target, is_last_step_to_keep, decision_procedure, ns, goto_trace);
437 symex_target_equationt::SSA_stepst::const_iterator step,
440 return step->is_assert() &&
441 decision_procedure.
get(step->cond_handle).
is_false();