@@ -103,14 +103,14 @@ exprt string_constraint_generatort::add_axioms_for_index_of_string(
103
103
symbol_exprt contains=fresh_boolean (" contains_substring" );
104
104
105
105
// We add axioms:
106
- // a1 : contains => from_index <= offset <= |str |-|substring |
106
+ // a1 : contains => from_index <= offset <= |haystack |-|needle |
107
107
// a2 : !contains <=> offset=-1
108
108
// a3 : forall n:[0,|substring|[.
109
- // contains => str [n+offset]=substring [n]
109
+ // contains => haystack [n+offset]=needle [n]
110
110
// a4 : forall n:[from_index,offset[.
111
- // contains => (exists m:[0,|substring |[. str [m+n]!=substring [m]])
112
- // a5: forall n:[from_index,|str |-|substring |[.
113
- // !contains => (exists m:[0,|substring |[. str [m+n]!=substring [m])
111
+ // contains => (exists m:[0,|needle |[. haystack [m+n]!=needle [m]])
112
+ // a5: forall n:[from_index,|haystack |-|needle |[.
113
+ // !contains => (exists m:[0,|needle |[. haystack [m+n]!=needle [m])
114
114
115
115
implies_exprt a1 (
116
116
contains,
@@ -161,10 +161,10 @@ exprt string_constraint_generatort::add_axioms_for_index_of_string(
161
161
{
162
162
// Unfold the existential quantifier as a disjunction in case of a constant
163
163
// a4 && a5 <=> a6:
164
- // forall n:[from_index,|str |-|substring |].
164
+ // forall n:[from_index,|haystack |-|needle |].
165
165
// !contains || n < offset =>
166
- // str [n]!=substring [0] || ... ||
167
- // str [n+|substring |-1]!=substring[|substring |-1]
166
+ // haystack [n]!=needle [0] || ... ||
167
+ // haystack [n+|needle |-1]!=needle[|needle |-1]
168
168
symbol_exprt qvar2=fresh_univ_index (" QA_index_of_string_2" , index_type);
169
169
mp_integer sub_length;
170
170
assert (!to_integer (needle.length (), sub_length));
@@ -223,14 +223,14 @@ exprt string_constraint_generatort::add_axioms_for_last_index_of_string(
223
223
// We add axioms:
224
224
// a1 : contains => offset <= from_index && offset <= |haystack| - |needle|
225
225
// a2 : !contains <=> offset=-1
226
- // a3 : forall n:[0, substring .length[,
227
- // contains => str [n+offset]=substring [n]
228
- // a4 : forall n:[offset+1, min(from_index, |str | - |substring |)].
226
+ // a3 : forall n:[0, needle .length[,
227
+ // contains => haystack [n+offset]=needle [n]
228
+ // a4 : forall n:[offset+1, min(from_index, |haystack | - |needle |)].
229
229
// contains =>
230
- // (exists m:[0,|substring|[. str [m+n]!=substring [m]])
231
- // a5: forall n:[0, min(from_index, |str | - |substring |)].
230
+ // (exists m:[0,|substring|[. haystack [m+n]!=needle [m]])
231
+ // a5: forall n:[0, min(from_index, |haystack | - |needle |)].
232
232
// !contains =>
233
- // (exists m:[0,|substring|[. str [m+n]!=substring [m])
233
+ // (exists m:[0,|substring|[. haystack [m+n]!=needle [m])
234
234
235
235
implies_exprt a1 (
236
236
contains,
@@ -283,10 +283,10 @@ exprt string_constraint_generatort::add_axioms_for_last_index_of_string(
283
283
{
284
284
// Unfold the existential quantifier as a disjunction in case of a constant
285
285
// a4 && a5 <=> a6:
286
- // forall n:[0, min(from_index,|str |-|substring |)].
286
+ // forall n:[0, min(from_index,|haystack |-|needle |)].
287
287
// !contains || n > offset =>
288
- // str [n]!=substring [0] || ... ||
289
- // str [n+|substring|-1]!=substring [|substring|-1]
288
+ // haystack [n]!=needle [0] || ... ||
289
+ // haystack [n+|substring|-1]!=needle [|substring|-1]
290
290
symbol_exprt qvar2=fresh_univ_index (" QA_index_of_string_2" , index_type);
291
291
mp_integer sub_length;
292
292
assert (!to_integer (needle.length (), sub_length));
0 commit comments