@@ -20,10 +20,9 @@ Function: string_constraint_generatort::add_axioms_for_index_of
20
20
21
21
Outputs: a integer expression
22
22
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.
23
+ Purpose: Add axioms stating that the returned value is the index within
24
+ str of the first occurence of c starting the search at from_index,
25
+ or -1 if no such character occurs at or after position from_index.
27
26
28
27
\*******************************************************************/
29
28
@@ -80,16 +79,16 @@ Function: string_constraint_generatort::add_axioms_for_index_of_string
80
79
81
80
Inputs:
82
81
haystack - a string expression
83
- substring - a string expression
82
+ needle - a string expression
84
83
from_index - an expression representing an index in strings
85
84
86
85
Outputs: an integer expression representing the first index of needle in
87
86
haystack after from_index, or -1 if there is none
88
87
89
- Purpose: add axioms stating that the returned value is an index greater than
90
- from_index such that haystack at that index starts with needle and
91
- is the first occurence of needle in haystack after from_index,
92
- or returned value is -1 if haystack does not contain needle .
88
+ Purpose: Add axioms stating that the returned value is the index within
89
+ haystack of the first occurence of needle starting the search at
90
+ from_index, or -1 if needle does not occur at or after position
91
+ from_index .
93
92
94
93
\*******************************************************************/
95
94
@@ -197,17 +196,17 @@ exprt string_constraint_generatort::add_axioms_for_index_of_string(
197
196
Function: string_constraint_generatort::add_axioms_for_last_index_of_string
198
197
199
198
Inputs:
200
- str - a string expression
201
- substring - a string expression
199
+ haystack - a string expression
200
+ needle - a string expression
202
201
from_index - an expression representing an index in strings
203
202
204
203
Outputs: an integer expression representing the last index of needle in
205
204
haystack after from_index, or -1 if there is none
206
205
207
- Purpose: add axioms stating that the returned value is an index less than
208
- from_index such that str at that index starts with substring and is
209
- the last occurence of substring in str before from_index,
210
- or the returned value is -1 if str does not contain substring .
206
+ Purpose: Add axioms stating that the returned value is the index within
207
+ haystack of the last occurence of needle starting the search
208
+ backward at from_index (ie the index is smaller or equal to
209
+ from_index), or -1 if needle does not occur before from_index .
211
210
212
211
\*******************************************************************/
213
212
@@ -368,10 +367,10 @@ Function: string_constraint_generatort::add_axioms_for_last_index_of
368
367
369
368
Outputs: a integer expression
370
369
371
- Purpose: add axioms stating that the returned value is either:
372
- -1 if the string does not contain c
373
- an index less than from_index such that the character of str at
374
- that position equals c and is the last occurence before from_index.
370
+ Purpose: Add axioms stating that the returned value is the index within
371
+ str of the last occurence of c starting the search backward at
372
+ from_index, or -1 if no such character occurs at or before
373
+ position from_index.
375
374
376
375
\*******************************************************************/
377
376
0 commit comments