mirror of
https://github.com/Z3Prover/z3
synced 2025-04-05 17:14:07 +00:00
fix max/min length to handle concatenation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
f1b8376739
commit
0fc9f1d46a
|
@ -932,7 +932,10 @@ unsigned seq_util::str::min_length(expr* s) const {
|
|||
return 0u;
|
||||
};
|
||||
while (is_concat(s, s1, s2)) {
|
||||
result += get_length(s1);
|
||||
if (is_concat(s1))
|
||||
result += min_length(s1);
|
||||
else
|
||||
result += get_length(s1);
|
||||
s = s2;
|
||||
}
|
||||
result += get_length(s);
|
||||
|
@ -960,7 +963,10 @@ unsigned seq_util::str::max_length(expr* s) const {
|
|||
return UINT_MAX;
|
||||
};
|
||||
while (is_concat(s, s1, s2)) {
|
||||
result = u.max_plus(get_length(s1), result);
|
||||
if (is_concat(s1))
|
||||
result = u.max_plus(max_length(s1), result);
|
||||
else
|
||||
result = u.max_plus(get_length(s1), result);
|
||||
s = s2;
|
||||
}
|
||||
result = u.max_plus(get_length(s), result);
|
||||
|
|
Loading…
Reference in a new issue