Skip to content

Commit 2f9da2b

Browse files
thomasspriggsTGWDB
authored andcommitted
Implement getting arrays from the SMT2 backend
This was previously unimplemented, which put null expressions into the trace steps and resulted in the elements of arrays not being printed when the trace is printed.
1 parent 3e0007f commit 2f9da2b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/solvers/smt2/smt2_conv.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,15 @@ exprt smt2_convt::get(const exprt &expr) const
318318
}
319319
else if(expr.is_constant())
320320
return expr;
321+
else if(const auto &array = expr_try_dynamic_cast<array_exprt>(expr))
322+
{
323+
exprt array_copy = *array;
324+
for(auto &element : array_copy.operands())
325+
{
326+
element = get(element);
327+
}
328+
return array_copy;
329+
}
321330

322331
return nil_exprt();
323332
}

0 commit comments

Comments
 (0)