Skip to content

Don't generate unnecessary fresh symbols for the GOTO trace #7021

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

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE
KNOWNBUG
pointer_to_int.c
--trace
\[main\.assertion\.1\] line \d+ expected result == -1: success: SUCCESS
Expand Down
47 changes: 8 additions & 39 deletions src/goto-symex/symex_target_equation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -624,33 +624,18 @@ void symex_target_equationt::convert_function_calls(
{
if(!step.ignore)
{
and_exprt::operandst conjuncts;
step.converted_function_arguments.reserve(step.ssa_function_arguments.size());

for(const auto &arg : step.ssa_function_arguments)
{
if(arg.is_constant() ||
arg.id()==ID_string_constant)
step.converted_function_arguments.push_back(arg);
else
if(!arg.is_constant() && arg.id() != ID_string_constant)
{
const irep_idt identifier="symex::args::"+std::to_string(argument_count++);
symbol_exprt symbol(identifier, arg.type());

equal_exprt eq(arg, symbol);
equal_exprt eq{arg, arg};
merge_irep(eq);

decision_procedure.set_to(eq, true);
conjuncts.push_back(eq);
step.converted_function_arguments.push_back(symbol);
decision_procedure.set_to_true(eq);
}
step.converted_function_arguments.push_back(arg);
}
with_solver_hardness(
decision_procedure,
[step_index, &conjuncts, &step](solver_hardnesst &hardness) {
hardness.register_ssa(
step_index, conjunction(conjuncts), step.source.pc);
});
}
++step_index;
}
Expand All @@ -663,32 +648,16 @@ void symex_target_equationt::convert_io(decision_proceduret &decision_procedure)
{
if(!step.ignore)
{
and_exprt::operandst conjuncts;
for(const auto &arg : step.io_args)
{
if(arg.is_constant() ||
arg.id()==ID_string_constant)
step.converted_io_args.push_back(arg);
else
if(!arg.is_constant() && arg.id() != ID_string_constant)
{
const irep_idt identifier =
"symex::io::" + std::to_string(io_count++);
symbol_exprt symbol(identifier, arg.type());

equal_exprt eq(arg, symbol);
equal_exprt eq{arg, arg};
merge_irep(eq);

decision_procedure.set_to(eq, true);
conjuncts.push_back(eq);
step.converted_io_args.push_back(symbol);
decision_procedure.set_to_true(eq);
}
step.converted_io_args.push_back(arg);
}
with_solver_hardness(
decision_procedure,
[step_index, &conjuncts, &step](solver_hardnesst &hardness) {
hardness.register_ssa(
step_index, conjunction(conjuncts), step.source.pc);
});
}
++step_index;
}
Expand Down
Loading