Skip to content

Commit d2a3541

Browse files
author
Joel Allred
committed
string_refinement::get(): get length if exists
In string_refinement::get(), we now get the length of the string from the array_pool instead of the array type. We use get_length_if_exists() instead of get_length(), because we want to ignore if the length does not exist, instead of creating a new symbol.
1 parent f1a70a6 commit d2a3541

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/solvers/strings/string_refinement.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1834,9 +1834,12 @@ exprt string_refinementt::get(const exprt &expr) const
18341834
if(const auto arr_model_opt = get_array(super_get, ns, log.debug(), arr))
18351835
return *arr_model_opt;
18361836

1837-
if(generator.array_pool.created_strings().count(arr))
1837+
if(
1838+
const auto &length_from_pool =
1839+
generator.array_pool.get_length_if_exists(arr))
18381840
{
1839-
const exprt length = super_get(arr.length());
1841+
const exprt length = super_get(length_from_pool.value());
1842+
18401843
if(const auto n = numeric_cast<std::size_t>(length))
18411844
{
18421845
const interval_sparse_arrayt sparse_array(

0 commit comments

Comments
 (0)