Skip to content

Commit a4ab7db

Browse files
Updating comments for functions adding axioms for index_of
1 parent f3f5a19 commit a4ab7db

File tree

1 file changed

+18
-19
lines changed

1 file changed

+18
-19
lines changed

src/solvers/refinement/string_constraint_generator_indexof.cpp

+18-19
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ Function: string_constraint_generatort::add_axioms_for_index_of
2020
2121
Outputs: a integer expression
2222
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.
2726
2827
\*******************************************************************/
2928

@@ -80,16 +79,16 @@ Function: string_constraint_generatort::add_axioms_for_index_of_string
8079
8180
Inputs:
8281
haystack - a string expression
83-
substring - a string expression
82+
needle - a string expression
8483
from_index - an expression representing an index in strings
8584
8685
Outputs: an integer expression representing the first index of needle in
8786
haystack after from_index, or -1 if there is none
8887
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.
9392
9493
\*******************************************************************/
9594

@@ -197,17 +196,17 @@ exprt string_constraint_generatort::add_axioms_for_index_of_string(
197196
Function: string_constraint_generatort::add_axioms_for_last_index_of_string
198197
199198
Inputs:
200-
str - a string expression
201-
substring - a string expression
199+
haystack - a string expression
200+
needle - a string expression
202201
from_index - an expression representing an index in strings
203202
204203
Outputs: an integer expression representing the last index of needle in
205204
haystack after from_index, or -1 if there is none
206205
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.
211210
212211
\*******************************************************************/
213212

@@ -368,10 +367,10 @@ Function: string_constraint_generatort::add_axioms_for_last_index_of
368367
369368
Outputs: a integer expression
370369
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.
375374
376375
\*******************************************************************/
377376

0 commit comments

Comments
 (0)