@@ -331,44 +331,40 @@ exprt string_constraint_generatort::add_axioms_for_last_index_of(
331
331
const exprt &from_index)
332
332
{
333
333
const typet &index_type = str.length ().type ();
334
- symbol_exprt index = fresh_exist_index (" last_index_of" , index_type);
335
- symbol_exprt contains= fresh_boolean (" contains_in_last_index_of" );
334
+ const symbol_exprt index = fresh_exist_index (" last_index_of" , index_type);
335
+ const symbol_exprt contains = fresh_boolean (" contains_in_last_index_of" );
336
336
337
- exprt minus1= from_integer (-1 , index_type);
338
- and_exprt a1 (
337
+ const exprt minus1 = from_integer (-1 , index_type);
338
+ const and_exprt a1 (
339
339
binary_relation_exprt (index , ID_ge, minus1),
340
- binary_relation_exprt (index , ID_lt, from_index_plus_one ),
340
+ binary_relation_exprt (index , ID_le, from_index ),
341
341
binary_relation_exprt (index , ID_lt, str.length ()));
342
342
axioms.push_back (a1);
343
343
344
- equal_exprt a2 (not_exprt ( contains) , equal_exprt (index , minus1));
344
+ const notequal_exprt a2 (contains, equal_exprt (index , minus1));
345
345
axioms.push_back (a2);
346
346
347
- implies_exprt a3 (
348
- contains,
349
- and_exprt (
350
- binary_relation_exprt (from_index, ID_ge, index ),
351
- equal_exprt (str[index ], c)));
347
+ const implies_exprt a3 (contains, equal_exprt (str[index ], c));
352
348
axioms.push_back (a3);
353
349
354
- symbol_exprt n=fresh_univ_index (" QA_last_index_of1" , index_type);
355
- string_constraintt a4 (
356
350
const exprt index1 = from_integer (1 , index_type);
357
351
const plus_exprt from_index_plus_one (from_index, index1);
358
352
const if_exprt end_index (
359
353
binary_relation_exprt (from_index_plus_one, ID_le, str.length ()),
360
354
from_index_plus_one,
361
355
str.length ());
362
356
357
+ const symbol_exprt n = fresh_univ_index (" QA_last_index_of1" , index_type);
358
+ const string_constraintt a4 (
363
359
n,
364
360
plus_exprt (index , index1),
365
361
end_index,
366
362
contains,
367
- not_exprt ( equal_exprt ( str[n], c) ));
363
+ notequal_exprt ( str[n], c));
368
364
axioms.push_back (a4);
369
365
370
- symbol_exprt m= fresh_univ_index (" QA_last_index_of2" , index_type);
371
- string_constraintt a5 (
366
+ const symbol_exprt m = fresh_univ_index (" QA_last_index_of2" , index_type);
367
+ const string_constraintt a5 (
372
368
m, end_index, not_exprt (contains), notequal_exprt (str[m], c));
373
369
axioms.push_back (a5);
374
370
0 commit comments