Skip to content
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
2 changes: 1 addition & 1 deletion regression/cbmc/Initialization6/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE no-new-smt
CORE
main.c

^EXIT=10$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/Pointer_byte_extract4/program-only.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE no-new-smt
CORE
main.c

^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/Pointer_byte_extract4/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE no-new-smt
CORE
main.c

^EXIT=0$
Expand Down
2 changes: 1 addition & 1 deletion regression/cbmc/byte_extract1/test.desc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CORE no-new-smt
CORE
main.c

^EXIT=10$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ void smt2_incremental_decision_proceduret::initialize_array_elements(
identifier_table.emplace(array_identifier.identifier(), array_identifier);
const std::vector<exprt> &elements = array.operands();
const typet &index_type = array.type().index_type();
for(const auto &element : elements)
{
define_dependent_functions(element);
}
for(std::size_t i = 0; i < elements.size(); ++i)
{
const smt_termt index = convert_expr_to_smt(from_integer(i, index_type));
Expand All @@ -125,6 +129,7 @@ void smt2_incremental_decision_proceduret::initialize_array_elements(
const array_of_exprt &array,
const smt_identifier_termt &array_identifier)
{
define_dependent_functions(array.what());
const smt_sortt index_type =
convert_type_to_smt_sort(array.type().index_type());
const smt_identifier_termt array_index_identifier{
Expand Down Expand Up @@ -170,6 +175,8 @@ void send_function_definition(
&expression_identifiers,
std::unordered_map<irep_idt, smt_identifier_termt> &identifier_table)
{
if(identifier_table.count(symbol_identifier))
return;
const smt_declare_function_commandt function{
smt_identifier_termt(
symbol_identifier, convert_type_to_smt_sort(expr.type())),
Expand Down Expand Up @@ -342,6 +349,8 @@ void smt2_incremental_decision_proceduret::define_index_identifiers(
if(const auto with_expr = expr_try_dynamic_cast<with_exprt>(expr_node))
{
const auto index_expr = with_expr->where();
if(expression_identifiers.count(index_expr))
return;
const auto index_term = convert_expr_to_smt(index_expr);
const auto index_identifier =
"index_" + std::to_string(index_sequence());
Expand Down
Loading