Skip to content

Commit d0da778

Browse files
peterschrammeltautschnig
authored andcommitted
GraphML output: Split array-list into assignments
Witness validators cannot handle array lists.
1 parent 611cba2 commit d0da778

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/goto-programs/graphml_witness.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,21 @@ std::string graphml_witnesst::convert_assign_rec(
6666
{
6767
std::string result;
6868

69-
if(assign.rhs().id()==ID_array)
69+
if(assign.rhs().id() == ID_array_list)
70+
{
71+
const array_list_exprt &array_list = to_array_list_expr(assign.rhs());
72+
const auto &ops = array_list.operands();
73+
74+
for(std::size_t listidx = 0; listidx != ops.size(); listidx += 2)
75+
{
76+
const index_exprt index{assign.lhs(), ops[listidx]};
77+
if(!result.empty())
78+
result += ' ';
79+
result +=
80+
convert_assign_rec(identifier, code_assignt{index, ops[listidx + 1]});
81+
}
82+
}
83+
else if(assign.rhs().id() == ID_array)
7084
{
7185
const array_typet &type = to_array_type(assign.rhs().type());
7286

0 commit comments

Comments
 (0)