@@ -210,6 +210,7 @@ void symex_target_equationt::location(
210
210
void symex_target_equationt::function_call (
211
211
const exprt &guard,
212
212
const irep_idt &function_identifier,
213
+ const std::vector<exprt> &ssa_function_arguments,
213
214
const sourcet &source)
214
215
{
215
216
SSA_steps.push_back (SSA_stept ());
@@ -219,6 +220,7 @@ void symex_target_equationt::function_call(
219
220
SSA_step.type = goto_trace_stept::typet::FUNCTION_CALL;
220
221
SSA_step.source = source;
221
222
SSA_step.function_identifier = function_identifier;
223
+ SSA_step.ssa_function_arguments = ssa_function_arguments;
222
224
223
225
merge_ireps (SSA_step);
224
226
}
@@ -383,6 +385,7 @@ void symex_target_equationt::convert(
383
385
convert_assumptions (prop_conv);
384
386
convert_assertions (prop_conv);
385
387
convert_goto_instructions (prop_conv);
388
+ convert_function_calls (prop_conv);
386
389
convert_io (prop_conv);
387
390
convert_constraints (prop_conv);
388
391
}
@@ -658,6 +661,39 @@ void symex_target_equationt::convert_assertions(
658
661
prop_conv.set_to_true (disjunction (disjuncts));
659
662
}
660
663
664
+ // / converts function calls
665
+ // / \par parameters: decision procedure
666
+ // / \return -
667
+ void symex_target_equationt::convert_function_calls (
668
+ decision_proceduret &dec_proc)
669
+ {
670
+ std::size_t argument_count=0 ;
671
+
672
+ for (auto &step : SSA_steps)
673
+ if (!step.ignore )
674
+ {
675
+ step.converted_function_arguments .reserve (step.ssa_function_arguments .size ());
676
+
677
+ for (const auto &arg : step.ssa_function_arguments )
678
+ {
679
+ if (arg.is_constant () ||
680
+ arg.id ()==ID_string_constant)
681
+ step.converted_function_arguments .push_back (arg);
682
+ else
683
+ {
684
+ const irep_idt identifier=" symex::args::" +std::to_string (argument_count++);
685
+ symbol_exprt symbol (identifier, arg.type ());
686
+
687
+ equal_exprt eq (arg, symbol);
688
+ merge_irep (eq);
689
+
690
+ dec_proc.set_to (eq, true );
691
+ step.converted_function_arguments .push_back (symbol);
692
+ }
693
+ }
694
+ }
695
+ }
696
+
661
697
// / converts I/O
662
698
// / \par parameters: decision procedure
663
699
// / \return -
@@ -690,7 +726,6 @@ void symex_target_equationt::convert_io(
690
726
}
691
727
}
692
728
693
-
694
729
void symex_target_equationt::merge_ireps (SSA_stept &SSA_step)
695
730
{
696
731
merge_irep (SSA_step.guard );
@@ -705,6 +740,9 @@ void symex_target_equationt::merge_ireps(SSA_stept &SSA_step)
705
740
for (auto &step : SSA_step.io_args )
706
741
merge_irep (step);
707
742
743
+ for (auto &arg : SSA_step.ssa_function_arguments )
744
+ merge_irep (arg);
745
+
708
746
// converted_io_args is merged in convert_io
709
747
}
710
748
0 commit comments