|
13 | 13 |
|
14 | 14 | Function: string_constraint_generatort::add_axioms_for_index_of
|
15 | 15 |
|
16 |
| - Inputs: a string expression, a character expression and an integer expression |
| 16 | + Inputs: |
| 17 | + str - a string expression |
| 18 | + c - an expression representing a character |
| 19 | + from_index - an expression representing an index in the string |
17 | 20 |
|
18 | 21 | Outputs: a integer expression
|
19 | 22 |
|
20 |
| - Purpose: add axioms that the returned value is either -1 or greater than |
21 |
| - from_index and the character at that position equals to c |
| 23 | + Purpose: add axioms stating that the returned value is either: |
| 24 | + -1 if the string does not contain c |
| 25 | + an index greater than from_index such that the character of str at |
| 26 | + that position equals c and is the first occurence after from_index. |
22 | 27 |
|
23 | 28 | \*******************************************************************/
|
24 | 29 |
|
@@ -350,6 +355,24 @@ exprt string_constraint_generatort::add_axioms_for_index_of(
|
350 | 355 | }
|
351 | 356 | }
|
352 | 357 |
|
| 358 | +/*******************************************************************\ |
| 359 | +
|
| 360 | +Function: string_constraint_generatort::add_axioms_for_last_index_of |
| 361 | +
|
| 362 | + Inputs: |
| 363 | + str - a string expression |
| 364 | + c - an expression representing a character |
| 365 | + from_index - an expression representing an index in the string |
| 366 | +
|
| 367 | + Outputs: a integer expression |
| 368 | +
|
| 369 | + Purpose: add axioms stating that the returned value is either: |
| 370 | + -1 if the string does not contain c |
| 371 | + an index less than from_index such that the character of str at |
| 372 | + that position equals c and is the last occurence before from_index. |
| 373 | +
|
| 374 | +\*******************************************************************/ |
| 375 | + |
353 | 376 | exprt string_constraint_generatort::add_axioms_for_last_index_of(
|
354 | 377 | const string_exprt &str, const exprt &c, const exprt &from_index)
|
355 | 378 | {
|
|
0 commit comments