Skip to content

Commit ede560a

Browse files
Define ID_array_list
Replaces the string literal "array-list".
1 parent 768e8a6 commit ede560a

File tree

9 files changed

+9
-8
lines changed

9 files changed

+9
-8
lines changed

src/ansi-c/expr2c.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3913,7 +3913,7 @@ std::string expr2ct::convert_with_precedence(
39133913
else if(src.id()==ID_array)
39143914
return convert_array(src, precedence);
39153915

3916-
else if(src.id()=="array-list")
3916+
else if(src.id() == ID_array_list)
39173917
return convert_array_list(src, precedence);
39183918

39193919
else if(src.id()==ID_typecast)

src/goto-programs/interpreter_evaluate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ void interpretert::evaluate(
934934
return;
935935
}
936936
}
937-
else if(expr.op0().id()=="array-list")
937+
else if(expr.op0().id() == ID_array_list)
938938
{
939939
// This sort of construct comes from boolbv_get, but doesn't seem
940940
// to have an exprt yet. Its operands are a list of key-value pairs.

src/solvers/flattening/boolbv_get.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ exprt boolbvt::bv_get_unbounded_array(const exprt &expr) const
375375

376376
if(size_mpint>100 || size.id()==ID_infinity)
377377
{
378-
result=exprt("array-list", type);
378+
result = exprt(ID_array_list, type);
379379
result.type().set(ID_size, integer2string(size_mpint));
380380

381381
result.operands().reserve(values.size()*2);

src/solvers/refinement/string_refinement.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2050,7 +2050,7 @@ exprt substitute_array_lists(exprt expr, size_t string_max_length)
20502050
for(auto &operand : expr.operands())
20512051
operand = substitute_array_lists(operand, string_max_length);
20522052

2053-
if(expr.id()=="array-list")
2053+
if(expr.id() == ID_array_list)
20542054
{
20552055
DATA_INVARIANT(
20562056
expr.operands().size()>=2,

src/solvers/refinement/string_refinement_util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ interval_sparse_arrayt::of_expr(const exprt &expr, const exprt &extra_value)
189189
return interval_sparse_arrayt(*array_expr, extra_value);
190190
if(const auto &with_expr = expr_try_dynamic_cast<with_exprt>(expr))
191191
return interval_sparse_arrayt(*with_expr);
192-
if(expr.id() == "array-list")
192+
if(expr.id() == ID_array_list)
193193
return of_array_list(expr, extra_value);
194194
return {};
195195
}

src/solvers/smt1/smt1_conv.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ exprt smt1_convt::ce_value(
219219
if(index_expr.is_nil())
220220
return nil_exprt();
221221

222-
exprt array_list("array-list", type);
222+
exprt array_list(ID_array_list, type);
223223
array_list.copy_to_operands(index_expr, value_expr);
224224

225225
return array_list;

src/solvers/smt1/smt1_conv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ class smt1_convt:public prop_convt
158158
const std::string &value)
159159
{
160160
exprt tmp=ce_value(identifier.type, index, value, false);
161-
if(tmp.id()=="array-list" && identifier.value.id()=="array-list")
161+
if(tmp.id() == ID_array_list && identifier.value.id() == ID_array_list)
162162
{
163163
forall_operands(it, tmp)
164164
identifier.value.copy_to_operands(*it);

src/util/irep_ids.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ IREP_ID_ONE(array_of)
246246
IREP_ID_ONE(array_equal)
247247
IREP_ID_ONE(array_set)
248248
IREP_ID_ONE(array_copy)
249+
IREP_ID_ONE(array_list)
249250
IREP_ID_ONE(mod)
250251
IREP_ID_ONE(rem)
251252
IREP_ID_ONE(shr)

src/util/simplify_expr_array.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ bool simplify_exprt::simplify_index(exprt &expr)
167167
return false;
168168
}
169169
}
170-
else if(array.id()=="array-list")
170+
else if(array.id() == ID_array_list)
171171
{
172172
// These are index/value pairs, alternating.
173173
for(size_t i=0; i<array.operands().size()/2; i++)

0 commit comments

Comments
 (0)