Skip to content

Commit be477c9

Browse files
Remove assumptions that input char are < 0x100
This could conflict with other constraints and make SAT insatisfiable leading to false positive in verification. Instead it should be to the user of these builtin function to make sure they are used in a way that corresponds to the function they want.
1 parent 836cbad commit be477c9

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/solvers/refinement/string_constraint_generator_transformation.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ static exprt is_upper_case(const exprt &character)
285285
/// 1. res.length = str.length
286286
/// 2. forall i < str.length.
287287
/// res[i] = is_upper_case(str[i]) ? str[i] + diff : str[i]
288-
/// && str[i] < 0x100
289288
///
290289
/// Where `diff` is the difference between lower case and upper case
291290
/// characters: `diff = 'a'-'A' = 0x20` and `is_upper_case` is true for the
@@ -312,9 +311,7 @@ exprt string_constraint_generatort::add_axioms_for_to_lower_case(
312311
// latin-1 supplement is 0x20.
313312
const exprt diff = from_integer(0x20, char_type);
314313
const exprt converted = equal_exprt(res[idx], plus_exprt(str[idx], diff));
315-
const exprt non_converted = and_exprt(
316-
equal_exprt(res[idx], str[idx]),
317-
binary_relation_exprt(str[idx], ID_lt, from_integer(0x100, char_type)));
314+
const exprt non_converted = equal_exprt(res[idx], str[idx]);
318315
return if_exprt(is_upper_case(str[idx]), converted, non_converted);
319316
}();
320317

0 commit comments

Comments
 (0)